|
||||||||||
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 |
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 parametersMethod Detail |
---|
public java.util.List<java.lang.String> getPrimaryKeys()
DatabaseRequest
getPrimaryKeys
in interface DatabaseRequest
public java.util.List<java.lang.String> getSelectedPrimaryKey()
DatabaseRequest
getSelectedPrimaryKey
in interface DatabaseRequest
public void createDistinctRequest() throws SitoolsException
DatabaseRequest
createDistinctRequest
in interface DatabaseRequest
SitoolsException
- when occurspublic void createRequest() throws SitoolsException
DatabaseRequest
createRequest
in interface DatabaseRequest
SitoolsException
- when request failspublic int calculateTotalCountFromBase() throws SitoolsException
DatabaseRequest
calculateTotalCountFromBase
in interface DatabaseRequest
SitoolsException
- if a database access error occurs or this method is called on a closed result setpublic int getTotalCount()
DatabaseRequest
getTotalCount
in interface DatabaseRequest
public int getCount()
DatabaseRequest
getCount
in interface DatabaseRequest
public final int getStartIndex()
DatabaseRequest
getStartIndex
in interface DatabaseRequest
public boolean nextResult() throws SitoolsException
DatabaseRequest
nextResult
in interface DatabaseRequest
true
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
DatabaseRequest
ResultSet
object or is the last
ResultSet
to send.
isLastResult
in interface DatabaseRequest
true
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 setpublic Record getRecord() throws SitoolsException
DatabaseRequest
ResultSet
in a Record
object
getRecord
in interface DatabaseRequest
Record
of the current ResultSet
SitoolsException
- if a database access error occurs or this method is called on a closed result setpublic final java.lang.String buildURI() throws SitoolsException
DatabaseRequest
buildURI
in interface DatabaseRequest
SitoolsException
- if a database access error occurs or this method is called on a closed result setpublic static final void setAttributeValues(Record record, java.sql.ResultSet rs) throws java.sql.SQLException
record
- the Record
rs
- the resultset
java.sql.SQLException
- if a database access error occurs or this method is called on a closed result setpublic void close() throws SitoolsException
close
in interface DatabaseRequest
SitoolsException
- if there is an error while closing the JDBC requestpublic final boolean isCountDone()
isCountDone
in interface DatabaseRequest
public final int getMaxResultsToSend()
getMaxResultsToSend
in interface DatabaseRequest
property in the sitools.properties file
,
Guide
public final int getPageSize()
property in the sitools.properties file
,
Guide
public final java.lang.String getDistinctRequestAsString()
DatabaseRequest
getDistinctRequestAsString
in interface DatabaseRequest
public final java.lang.String getRequestAsString() throws SitoolsException
DatabaseRequest
getRequestAsString
in interface DatabaseRequest
SitoolsException
- when occurspublic void checkRequest() throws SitoolsException
DatabaseRequest
checkRequest
in interface DatabaseRequest
SitoolsException
- if the given request is not correct
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |