public class DBDatabaseDriverSQLite extends DBDatabaseDriver
Modifier and Type | Class and Description |
---|---|
static class |
DBDatabaseDriverSQLite.DBCommandSQLite
Defines the SQLite command type.
|
DBDatabaseDriver.DBSeqTable, DBDatabaseDriver.DBSetGenKeys
ddlColumnDefaults, GENERAL_SQL_KEYWORDS, ILLEGAL_NAME_CHARS, reservedSQLKeywords, SQL_BOOLEAN_FALSE, SQL_BOOLEAN_TRUE, SQL_CONCAT_EXPR, SQL_CURRENT_DATE, SQL_CURRENT_DATETIME, SQL_DATABASE_LINK, SQL_DATE_PATTERN, SQL_DATE_TEMPLATE, SQL_DATETIME_PATTERN, SQL_DATETIME_TEMPLATE, SQL_FUNC_ABS, SQL_FUNC_AVG, SQL_FUNC_CEILING, SQL_FUNC_COALESCE, SQL_FUNC_DAY, SQL_FUNC_DECODE, SQL_FUNC_DECODE_ELSE, SQL_FUNC_DECODE_PART, SQL_FUNC_DECODE_SEP, SQL_FUNC_ESCAPE, SQL_FUNC_FLOOR, SQL_FUNC_LENGTH, SQL_FUNC_LOWER, SQL_FUNC_LTRIM, SQL_FUNC_MAX, SQL_FUNC_MIN, SQL_FUNC_MODULO, SQL_FUNC_MONTH, SQL_FUNC_REPLACE, SQL_FUNC_REVERSE, SQL_FUNC_ROUND, SQL_FUNC_RTRIM, SQL_FUNC_STRINDEX, SQL_FUNC_STRINDEXFROM, SQL_FUNC_SUBSTRING, SQL_FUNC_SUBSTRINGEX, SQL_FUNC_SUM, SQL_FUNC_TRIM, SQL_FUNC_TRUNC, SQL_FUNC_UPPER, SQL_FUNC_YEAR, SQL_NULL_VALUE, SQL_PARAMETER, SQL_QUOTES_CLOSE, SQL_QUOTES_OPEN, SQL_RENAME_COLUMN, SQL_RENAME_TABLE
Constructor and Description |
---|
DBDatabaseDriverSQLite()
Constructor for the SQLite database driver.
|
Modifier and Type | Method and Description |
---|---|
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 '?' |
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.
|
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.
|
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
|
addEnableRelationStmt, addStatementParam, appendElementName, appendElementName, appendSQLTextValue, attachDatabase, checkDatabase, close, createCombinedCommand, detachDatabase, detectQuoteName, executeBatch, executeQuery, extractErrorMessage, getColumnAutoValue, getSQLDateTimeString, getSQLNumberString, getSQLTextString, getValueString, isDDLColumnDefaults, prepareStatement, setDDLColumnDefaults, stringToBoolean
public DBDatabaseDriverSQLite()
public DBCommand createCommand(DBDatabase db)
createCommand
in class DBDatabaseDriver
db
- the database for which to create a command object forpublic boolean isSupported(DBDriverFeature type)
isSupported
in class DBDatabaseDriver
type
- type of requested feature. @see DBDriverFeaturepublic String getSQLPhrase(int phrase)
getSQLPhrase
in class DBDatabaseDriver
phrase
- the identifier of the phraseDBDatabaseDriver.getSQLPhrase(int)
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 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 typeSQLException
- 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 usedpublic 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 connectionCopyright © 2008–2017 Apache Software Foundation. All rights reserved.