fr.cnes.sitools.dataset.database.jdbc
Class SQLListIdDatabaseRequest

java.lang.Object
  extended by fr.cnes.sitools.dataset.database.jdbc.SQLDatabaseRequest
      extended by fr.cnes.sitools.dataset.database.jdbc.SQLListIdDatabaseRequest
All Implemented Interfaces:
DatabaseRequest

public class SQLListIdDatabaseRequest
extends SQLDatabaseRequest

Create a request SQL with prepared statement

Author:
m.gond (AKKA Technologies)

Constructor Summary
SQLListIdDatabaseRequest(DatabaseRequestParameters params, java.lang.String[] idList)
          Create a AbstractDatabaseRequest
 
Method Summary
 int calculateTotalCountFromBase()
          Compute from the database the number of Records in the current request
 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
 Record getRecord()
          Return the current ResultSet in a Record object
 int getTotalCount()
          get the number of records in the current request
 boolean isLastResult()
          Deprecated. 
 boolean nextResult()
          Move the cursor on the next result.
 
Methods inherited from class fr.cnes.sitools.dataset.database.jdbc.SQLDatabaseRequest
buildURI, checkRequest, getDistinctRequestAsString, getMaxResultsToSend, getPageSize, getPrimaryKeys, getRequestAsString, getSelectedPrimaryKey, getStartIndex, isCountDone, setAttributeValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLListIdDatabaseRequest

public SQLListIdDatabaseRequest(DatabaseRequestParameters params,
                                java.lang.String[] idList)
Create a AbstractDatabaseRequest

Parameters:
params - the request parameters
idList - the list of ids
Method Detail

createDistinctRequest

public final void createDistinctRequest()
                                 throws SitoolsException
Description copied from interface: DatabaseRequest
Create a SQL Distinct request

Specified by:
createDistinctRequest in interface DatabaseRequest
Overrides:
createDistinctRequest in class SQLDatabaseRequest
Throws:
SitoolsException - when occurs

createRequest

public final void createRequest()
                         throws SitoolsException
Description copied from interface: DatabaseRequest
Create a Request

Specified by:
createRequest in interface DatabaseRequest
Overrides:
createRequest in class SQLDatabaseRequest
Throws:
SitoolsException - when request fails

getTotalCount

public final int getTotalCount()
Description copied from interface: DatabaseRequest
get the number of records in the current request

Specified by:
getTotalCount in interface DatabaseRequest
Overrides:
getTotalCount in class SQLDatabaseRequest
Returns:
the number of records in the current request

getCount

public final int getCount()
Description copied from interface: DatabaseRequest
Get the number of results in the current request for pagination purpose

Specified by:
getCount in interface DatabaseRequest
Overrides:
getCount in class SQLDatabaseRequest
Returns:
the number of results in the current request for pagination purpose

nextResult

public final boolean nextResult()
                         throws SitoolsException
Description copied from interface: DatabaseRequest
Move the cursor on the next result.

Specified by:
nextResult in interface DatabaseRequest
Overrides:
nextResult in class SQLDatabaseRequest
Returns:
true if the new current row is valid; false if there are no more rows
Throws:
SitoolsException - if a database access error occurs or this method is called on a closed result set

isLastResult

@Deprecated
public final boolean isLastResult()
                           throws SitoolsException
Deprecated. 

Description copied from interface: DatabaseRequest
Retrieves whether the cursor is on the last row of this ResultSet object or is the last ResultSet to send.

Specified by:
isLastResult in interface DatabaseRequest
Overrides:
isLastResult in class SQLDatabaseRequest
Returns:
true if the cursor is on the last row or is the last row to send.; false otherwise
Throws:
SitoolsException - if a database access error occurs or this method is called on a closed result set

getRecord

public final Record getRecord()
                       throws SitoolsException
Description copied from interface: DatabaseRequest
Return the current ResultSet in a Record object

Specified by:
getRecord in interface DatabaseRequest
Overrides:
getRecord in class SQLDatabaseRequest
Returns:
the Record of the current ResultSet
Throws:
SitoolsException - if a database access error occurs or this method is called on a closed result set

close

public final void close()
                 throws SitoolsException
Description copied from class: SQLDatabaseRequest
Close the current JDBC request

Specified by:
close in interface DatabaseRequest
Overrides:
close in class SQLDatabaseRequest
Throws:
SitoolsException - if there is an error while closing the JDBC request

calculateTotalCountFromBase

public int calculateTotalCountFromBase()
                                throws SitoolsException
Description copied from interface: DatabaseRequest
Compute from the database the number of Records in the current request

Specified by:
calculateTotalCountFromBase in interface DatabaseRequest
Overrides:
calculateTotalCountFromBase in class SQLDatabaseRequest
Returns:
the number of total results or 0 if it cannot perform the request
Throws:
SitoolsException - if a database access error occurs or this method is called on a closed result set


Copyright © 2010-2013 CNES. All Rights Reserved.