Package com.bayesserver.data
Class DatabaseDataReaderCommand
- java.lang.Object
-
- com.bayesserver.data.DatabaseDataReaderCommand
-
- All Implemented Interfaces:
DataReaderCommand
public final class DatabaseDataReaderCommand extends Object implements DataReaderCommand
Provides a default implementation ofDataReaderCommandfor reading databases.
-
-
Constructor Summary
Constructors Constructor Description DatabaseDataReaderCommand(String connectionUrl, String queryText)Initializes a new instance of theDatabaseDataReaderCommandclass.DatabaseDataReaderCommand(String connectionUrl, String queryText, int queryTimeout)Initializes a new instance of theDatabaseDataReaderCommandclass.DatabaseDataReaderCommand(String connectionUrl, String queryText, String user, String password)Initializes a new instance of theDatabaseDataReaderCommandclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataReaderexecuteReader()Returns an instance ofIDataReader.booleangetAutoCommit()Gets the auto commit value to be set on each connection created.intgetFetchSize()Gets the fetch size to be set on each statement created.intgetQueryTimeout()Gets the timeout to be used when statements are executed.voidsetAutoCommit(boolean value)Sets the auto commit value to be set on each connection created.voidsetFetchSize(int value)Sets the fetch size to be set on each statement created.voidsetQueryTimeout(int value)Sets the timeout to be used when statements are executed.
-
-
-
Constructor Detail
-
DatabaseDataReaderCommand
public DatabaseDataReaderCommand(String connectionUrl, String queryText)
Initializes a new instance of theDatabaseDataReaderCommandclass.- Parameters:
connectionUrl- The jdbc database connection url.queryText- The select sql. When temporal data is present any non temporal data must be sorted by the case identifier, and temporal data must be sorted by both the case identifier and time.
-
DatabaseDataReaderCommand
public DatabaseDataReaderCommand(String connectionUrl, String queryText, String user, String password)
Initializes a new instance of theDatabaseDataReaderCommandclass.- Parameters:
connectionUrl- The jdbc database connection url.queryText- The select sql.user- The user name.password- The password for the specified user. When temporal data is present any non temporal data must be sorted by the case identifier, and temporal data must be sorted by both the case identifier and time.
-
DatabaseDataReaderCommand
public DatabaseDataReaderCommand(String connectionUrl, String queryText, int queryTimeout)
Initializes a new instance of theDatabaseDataReaderCommandclass.- Parameters:
connectionUrl- The jdbc database connection url.queryText- The select sql.queryTimeout- The timeout to set on statements that are executed. When temporal data is present any non temporal data must be sorted by the case identifier, and temporal data must be sorted by both the case identifier and time.
-
-
Method Detail
-
getQueryTimeout
public int getQueryTimeout()
Gets the timeout to be used when statements are executed.
-
setQueryTimeout
public void setQueryTimeout(int value)
Sets the timeout to be used when statements are executed.
-
getAutoCommit
public boolean getAutoCommit()
Gets the auto commit value to be set on each connection created.
-
setAutoCommit
public void setAutoCommit(boolean value)
Sets the auto commit value to be set on each connection created.
-
getFetchSize
public int getFetchSize()
Gets the fetch size to be set on each statement created.
-
setFetchSize
public void setFetchSize(int value)
Sets the fetch size to be set on each statement created.
-
executeReader
public DataReader executeReader()
Returns an instance ofIDataReader.- Specified by:
executeReaderin interfaceDataReaderCommand- Returns:
- A data reader.
-
-