|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.db.DBDatabaseDriver
org.apache.empire.db.sqlite.DBDatabaseDriverSQLite
public class DBDatabaseDriverSQLite
This class provides support for the SQLite database system.
Nested Class Summary | |
---|---|
static class |
DBDatabaseDriverSQLite.DBCommandSQLite
Defines the SQLite command type. |
Nested classes/interfaces inherited from class org.apache.empire.db.DBDatabaseDriver |
---|
DBDatabaseDriver.DBSeqTable, DBDatabaseDriver.DBSetGenKeys |
Field Summary |
---|
Constructor Summary | |
---|---|
DBDatabaseDriverSQLite()
Constructor for the SQLite database driver. |
Method Summary | |
---|---|
DBCommand |
createCommand(DBDatabase db)
Creates a new SQLite command object. |
int |
executeSQL(String sqlCmd,
Object[] sqlParams,
Connection conn,
DBDatabaseDriver.DBSetGenKeys genKeys)
Executes the select, update or delete SQL-Command with a Statement object. |
String |
getConvertPhrase(DataType destType,
DataType srcType,
Object format)
Returns a data type convertion phrase template for this driver The returned template must contain a '?' which will be replaced by a column expression. |
void |
getDDLScript(DBCmdType type,
DBObject dbo,
DBSQLScript script)
Appends the required DLL commands to create, drop or alter an object to the supplied DBDQLScript. |
Object |
getNextSequenceValue(DBDatabase db,
String SeqName,
int minValue,
Connection conn)
Returns the next value of a named sequence The numbers are used for fields of type DBExpr.DT_AUTOINC. If a driver supports this function it must return true for isSupported(DBDriverFeature.SEQUENCES). |
Object |
getResultValue(ResultSet rset,
int columnIndex,
DataType dataType)
Reads a single column value from the given JDBC ResultSet and returns a value object of desired data type. See DBExpr.getValueClass(DataType) for java class type mapping. |
String |
getSQLPhrase(int phrase)
Gets an sql phrase template for this database system. |
Timestamp |
getUpdateTimestamp(Connection conn)
Overridden. |
boolean |
isSupported(DBDriverFeature type)
Returns whether or not a particular feature is supported by this driver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBDatabaseDriverSQLite()
Method Detail |
---|
public int executeSQL(String sqlCmd, Object[] sqlParams, Connection conn, DBDatabaseDriver.DBSetGenKeys genKeys) throws SQLException
DBDatabaseDriver
executeSQL
in class DBDatabaseDriver
sqlCmd
- the SQL-CommandsqlParams
- array of sql command parameters used for prepared statements (Optional).conn
- a valid connection to the database.genKeys
- allows to set the auto generated key of a record (INSERT statements only)
SQLException
- if a database access error occurspublic DBCommand createCommand(DBDatabase db)
createCommand
in class DBDatabaseDriver
db
- the database for which to create a command object for
public boolean isSupported(DBDriverFeature type)
isSupported
in class DBDatabaseDriver
type
- type of requested feature. @see DBDriverFeature
public String getSQLPhrase(int phrase)
getSQLPhrase
in class DBDatabaseDriver
phrase
- the identifier of the phrase
DBDatabaseDriver.getSQLPhrase(int)
public Object getResultValue(ResultSet rset, int columnIndex, DataType dataType) throws SQLException
DBDatabaseDriver
Reads a single column value from the given JDBC ResultSet and returns a value object of desired data type.
See DBExpr.getValueClass(DataType)
for java class type mapping.
This gives the driver the opportunity to change the value i.e. to simulate missing data types with other types.
getResultValue
in class DBDatabaseDriver
rset
- the sql Resultset with the current data rowcolumnIndex
- one based column Index of the desired columndataType
- the required data type
SQLException
- if a database access error occurspublic String getConvertPhrase(DataType destType, DataType srcType, Object format)
DBDatabaseDriver
getConvertPhrase
in class DBDatabaseDriver
destType
- the target data typesrcType
- the source data typeformat
- additional formatting information (optional)
DBDatabaseDriver.getConvertPhrase(DataType, DataType, Object)
public Timestamp getUpdateTimestamp(Connection conn)
getUpdateTimestamp
in class DBDatabaseDriver
conn
- the connection that might be used
public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script)
DBDatabaseDriver
getDDLScript
in class DBDatabaseDriver
type
- operation to perform (CREATE, DROP, ALTER)dbo
- the object for which to perform the operation (DBDatabase, DBTable, DBView, DBColumn, DBRelation)script
- the script to which to add the DDL command(s)DBDatabaseDriver.getDDLScript(DBCmdType, DBObject, DBSQLScript)
public Object getNextSequenceValue(DBDatabase db, String SeqName, int minValue, Connection conn)
DBDatabaseDriver
getNextSequenceValue
in class DBDatabaseDriver
db
- the databaseSeqName
- the name of the sequenceminValue
- the minimum value of the sequenceconn
- a valid database connection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |