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 ofDataReaderCommand
for reading databases.
-
-
Constructor Summary
Constructors Constructor Description DatabaseDataReaderCommand(String connectionUrl, String queryText)
Initializes a new instance of theDatabaseDataReaderCommand
class.DatabaseDataReaderCommand(String connectionUrl, String queryText, int queryTimeout)
Initializes a new instance of theDatabaseDataReaderCommand
class.DatabaseDataReaderCommand(String connectionUrl, String queryText, String user, String password)
Initializes a new instance of theDatabaseDataReaderCommand
class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataReader
executeReader()
Returns an instance ofIDataReader
.boolean
getAutoCommit()
Gets the auto commit value to be set on each connection created.int
getFetchSize()
Gets the fetch size to be set on each statement created.int
getQueryTimeout()
Gets the timeout to be used when statements are executed.void
setAutoCommit(boolean value)
Sets the auto commit value to be set on each connection created.void
setFetchSize(int value)
Sets the fetch size to be set on each statement created.void
setQueryTimeout(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 theDatabaseDataReaderCommand
class.- 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 theDatabaseDataReaderCommand
class.- 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 theDatabaseDataReaderCommand
class.- 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:
executeReader
in interfaceDataReaderCommand
- Returns:
- A data reader.
-
-