org.rimudb.sql
Class DB2Adapter

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

public class DB2Adapter
extends DefaultAdapter

This class converts to iSeries (AS/400) types


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
DB2Adapter()
           
 
Method Summary
 java.lang.String convertAutoIncrement(boolean autoIncrement)
          Return the String used for auto increment columns
 java.lang.String convertNullCapable(boolean nullCapable, boolean isAutoIncrement)
          Return the String for null capability
 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.
protected  java.lang.String getParameter(java.lang.String s, java.lang.String parameterName, java.lang.String delimiter)
          Return the value of a parameter in a String that begins with the paraemterName and ends with the delimiter (or end of String).
 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.
 boolean hasPrimaryKeyClause()
          Return true if the Create Table statement should have a PRIMARY KEY clause
 
Methods inherited from class org.rimudb.sql.DefaultAdapter
build, build, buildGroupByClause, buildOrderByClause, buildSelectClause, buildSQL, buildSQL, buildSQL, buildWhereClause, convertSQLType, correctRecordData, getBeginLimitClause, getCloseQuote, getCreateTableSQL, getDatabaseConfiguration, getDatabaseMetaData, getDatabaseNames, getDeleteStatement, getDropTableSQL, getIdentitySelectSQL, getInsertStatement, getLockingHint, getOpenQuote, getPrimaryKeySelectStatement, getPrimaryKeyUpdateStatement, getQuoter, getSelectAllSQL, getSelectCountSQL, getTableType, getTruncateTableSQL, isInsertIndentityStatementSupported, setDatabaseConfiguration, setDatabaseMetaData, setUseQuotes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2Adapter

public DB2Adapter()
Method Detail

convertNullCapable

public java.lang.String convertNullCapable(boolean nullCapable,
                                           boolean isAutoIncrement)
Return the String for null capability

Specified by:
convertNullCapable in interface ISQLAdapter
Overrides:
convertNullCapable in class DefaultAdapter
Parameters:
nullCapable - boolean
isAutoIncrement - boolean
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

convertAutoIncrement

public java.lang.String convertAutoIncrement(boolean autoIncrement)
Return the String used for auto increment columns

Parameters:
autoIncrement - boolean
Returns:
String

hasPrimaryKeyClause

public boolean hasPrimaryKeyClause()
Return true if the Create Table statement should have a PRIMARY KEY clause

Specified by:
hasPrimaryKeyClause in interface ISQLAdapter
Overrides:
hasPrimaryKeyClause in class DefaultAdapter
Returns:
boolean

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

getParameter

protected java.lang.String getParameter(java.lang.String s,
                                        java.lang.String parameterName,
                                        java.lang.String delimiter)
Return the value of a parameter in a String that begins with the paraemterName and ends with the delimiter (or end of String).

Parameters:
s -
parameterName -
delimiter -
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


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