|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.cnes.sitools.dataset.database.jdbc.SQLDatabaseRequest
public class SQLDatabaseRequest
Create a request SQL
| Constructor Summary | |
|---|---|
SQLDatabaseRequest(DatabaseRequestParameters params)
Create a SQLDatabaseRequest |
|
| Method Summary | |
|---|---|
java.lang.String |
buildURI()
Build the URI to the current Record |
int |
calculateTotalCountFromBase()
Compute from the database the number of Records in the current request |
void |
checkRequest()
Check that the given request is correct and can be executed |
void |
close()
Close the current JDBC request |
void |
createDistinctRequest()
Create a SQL Distinct request |
void |
createRequest()
Create a Request |
int |
getCount()
Get the number of results in the current request for pagination purpose |
java.lang.String |
getDistinctRequestAsString()
Gets the distinct request as a String |
int |
getMaxResultsToSend()
Gets the maxResultsToSend value |
int |
getPageSize()
Get the number of records in the current request when no limit parameter is set |
java.util.List<java.lang.String> |
getPrimaryKeys()
Get the list of primary keys in the DataSet |
Record |
getRecord()
Return the current ResultSet in a Record object |
java.lang.String |
getRequestAsString()
Gets the request as a String |
java.util.List<java.lang.String> |
getSelectedPrimaryKey()
Get the selected primary keys |
int |
getStartIndex()
Get the index of the first result in the current request |
int |
getTotalCount()
get the number of records in the current request |
boolean |
isCountDone()
If the count must be done or not |
boolean |
isLastResult()
Deprecated. |
boolean |
nextResult()
Move the cursor on the next result. |
static void |
setAttributeValues(Record record,
java.sql.ResultSet rs)
Fill in attributes for a given Record |
void |
setMaxResultsToSend(int maxResultsToSend)
Sets the value of maxResultsToSend |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLDatabaseRequest(DatabaseRequestParameters params)
SQLDatabaseRequest
params - the request parameters| Method Detail |
|---|
public java.util.List<java.lang.String> getPrimaryKeys()
DatabaseRequest
getPrimaryKeys in interface DatabaseRequestpublic java.util.List<java.lang.String> getSelectedPrimaryKey()
DatabaseRequest
getSelectedPrimaryKey in interface DatabaseRequest
public void createDistinctRequest()
throws SitoolsException
DatabaseRequest
createDistinctRequest in interface DatabaseRequestSitoolsException - when occurs
public void createRequest()
throws SitoolsException
DatabaseRequest
createRequest in interface DatabaseRequestSitoolsException - when request fails
public int calculateTotalCountFromBase()
throws SitoolsException
DatabaseRequest
calculateTotalCountFromBase in interface DatabaseRequestSitoolsException - if a database access error occurs or this method is called on a closed result setpublic int getTotalCount()
DatabaseRequest
getTotalCount in interface DatabaseRequestpublic int getCount()
DatabaseRequest
getCount in interface DatabaseRequestpublic final int getStartIndex()
DatabaseRequest
getStartIndex in interface DatabaseRequest
public boolean nextResult()
throws SitoolsException
DatabaseRequest
nextResult in interface DatabaseRequesttrue if the new current row is valid; false if there are no more rows
SitoolsException - if a database access error occurs or this method is called on a closed result set
@Deprecated
public boolean isLastResult()
throws SitoolsException
DatabaseRequestResultSet object or is the last
ResultSet to send.
isLastResult in interface DatabaseRequesttrue if the cursor is on the last row or is the last row to send.; false
otherwise
SitoolsException - if a database access error occurs or this method is called on a closed result set
public Record getRecord()
throws SitoolsException
DatabaseRequestResultSet in a Record object
getRecord in interface DatabaseRequestRecord of the current ResultSet
SitoolsException - if a database access error occurs or this method is called on a closed result set
public final java.lang.String buildURI()
throws SitoolsException
DatabaseRequest
buildURI in interface DatabaseRequestSitoolsException - if a database access error occurs or this method is called on a closed result set
public static final void setAttributeValues(Record record,
java.sql.ResultSet rs)
throws java.sql.SQLException
record - the Recordrs - the resultset
java.sql.SQLException - if a database access error occurs or this method is called on a closed result set
public void close()
throws SitoolsException
close in interface DatabaseRequestSitoolsException - if there is an error while closing the JDBC requestpublic final boolean isCountDone()
isCountDone in interface DatabaseRequestpublic final int getMaxResultsToSend()
getMaxResultsToSend in interface DatabaseRequestproperty in the sitools.properties file,
Guidepublic final int getPageSize()
property in the sitools.properties file,
Guidepublic final void setMaxResultsToSend(int maxResultsToSend)
maxResultsToSend - the maxResultsToSend to setpublic final java.lang.String getDistinctRequestAsString()
DatabaseRequest
getDistinctRequestAsString in interface DatabaseRequest
public final java.lang.String getRequestAsString()
throws SitoolsException
DatabaseRequest
getRequestAsString in interface DatabaseRequestSitoolsException - when occurs
public void checkRequest()
throws SitoolsException
DatabaseRequest
checkRequest in interface DatabaseRequestSitoolsException - if the given request is not correct
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||