org.rimudb.sql
Class DerbyAdapter

java.lang.Object
  extended by org.rimudb.sql.DefaultAdapter
      extended by org.rimudb.sql.DerbyAdapter
All Implemented Interfaces:
ISQLAdapter

public class DerbyAdapter
extends DefaultAdapter


Field Summary
 
Fields inherited from class org.rimudb.sql.DefaultAdapter
DB_H2, DB_HSQLDB, DB_ISERIES, DB_MYSQL, DB_SQLSERVER, DB_UNKNOWN, IDX_INDEX, IDX_PRIMARY, IDX_UNIQUE, LOCK_DELETE, LOCK_INSERT, LOCK_NONE, LOCK_SELECT, LOCK_UPDATE
 
Fields inherited from interface org.rimudb.sql.ISQLAdapter
IDENTITY_GENERATED_KEYS, IDENTITY_INSERT_STMT, IDENTITY_SEPARATE_STATEMENT
 
Constructor Summary
DerbyAdapter()
           
 
Method Summary
 java.lang.String convertAutoIncrement(boolean autoIncrement)
          Return the String used for auto increment columns.
 java.lang.String convertSQLType(int type, long precision, int scale)
          Convert the SQL type to a type that the database can handle.
 java.lang.String getCreateIfExistsClause()
          Return the If Exists clause for a create table statement
 java.lang.String getDropIfExistsClause()
          Return the clause for "drop if exists".
 java.lang.String getEndLimitClause(int maxRecords, int offset)
          Returns a clause for a select statement that limits the number of records returned to the first n records.
 java.lang.String getIdentitySelectSQL(java.lang.String tableName, java.lang.String columnName, int columnType)
          Return an SQL statement that will return the value assigned to an auto-increment column.
 boolean getSupportsGetGeneratedKeys()
           
 boolean getSupportsMultipleGetGeneratedKeys()
          Return true if this database supports returning a multiple row result set of generated keys
 boolean getSupportsReturnGeneratedKeys()
          Return true if the database supports the use of prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); If it doesn't then the method prepareStatement(sql, identityColumns[]); will be used.
 
Methods inherited from class org.rimudb.sql.DefaultAdapter
build, build, buildGroupByClause, buildOrderByClause, buildSelectClause, buildSQL, buildSQL, buildSQL, buildWhereClause, convertNullCapable, correctRecordData, getBeginLimitClause, getCloseQuote, getCreateTableSQL, getDatabaseConfiguration, getDatabaseMetaData, getDatabaseNames, getDeleteStatement, getDropTableSQL, getInsertStatement, getLockingHint, getOpenQuote, getPrimaryKeySelectStatement, getPrimaryKeyUpdateStatement, getQuoter, getSelectAllSQL, getSelectCountSQL, getTableType, getTruncateTableSQL, hasPrimaryKeyClause, isInsertIndentityStatementSupported, setDatabaseConfiguration, setDatabaseMetaData, setUseQuotes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyAdapter

public DerbyAdapter()
Method Detail

convertAutoIncrement

public java.lang.String convertAutoIncrement(boolean autoIncrement)
Description copied from interface: ISQLAdapter
Return the String used for auto increment columns.

Parameters:
autoIncrement - boolean
Returns:
String

convertSQLType

public java.lang.String convertSQLType(int type,
                                       long precision,
                                       int scale)
Convert the SQL type to a type that the database can handle.

Specified by:
convertSQLType in interface ISQLAdapter
Overrides:
convertSQLType in class DefaultAdapter
Parameters:
type - int
precision - long
scale - int
Returns:
String

getEndLimitClause

public java.lang.String getEndLimitClause(int maxRecords,
                                          int offset)
Returns a clause for a select statement that limits the number of records returned to the first n records.

Parameters:
maxRecords - int
offset - int
Returns:
String

getCreateIfExistsClause

public java.lang.String getCreateIfExistsClause()
Description copied from interface: ISQLAdapter
Return the If Exists clause for a create table statement

Specified by:
getCreateIfExistsClause in interface ISQLAdapter
Specified by:
getCreateIfExistsClause in class DefaultAdapter
Returns:
String

getDropIfExistsClause

public java.lang.String getDropIfExistsClause()
Description copied from interface: ISQLAdapter
Return the clause for "drop if exists".

Specified by:
getDropIfExistsClause in interface ISQLAdapter
Specified by:
getDropIfExistsClause in class DefaultAdapter
Returns:
String

getSupportsReturnGeneratedKeys

public boolean getSupportsReturnGeneratedKeys()
Description copied from interface: ISQLAdapter
Return true if the database supports the use of prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); If it doesn't then the method prepareStatement(sql, identityColumns[]); will be used.

Returns:
boolean

getSupportsMultipleGetGeneratedKeys

public boolean getSupportsMultipleGetGeneratedKeys()
Description copied from interface: ISQLAdapter
Return true if this database supports returning a multiple row result set of generated keys

Returns:
boolean

getSupportsGetGeneratedKeys

public boolean getSupportsGetGeneratedKeys()

getIdentitySelectSQL

public java.lang.String getIdentitySelectSQL(java.lang.String tableName,
                                             java.lang.String columnName,
                                             int columnType)
Return an SQL statement that will return the value assigned to an auto-increment column.

Specified by:
getIdentitySelectSQL in interface ISQLAdapter
Overrides:
getIdentitySelectSQL in class DefaultAdapter
Parameters:
tableName - String
columnName - String
columnType - int
Returns:
String


Copyright © 2008-2011 Simon Ritchie. All Rights Reserved.