|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.triactive.jdo.store.DatabaseAdapter
com.triactive.jdo.store.DB2Adapter
class DB2Adapter
Provides methods for adapting SQL language elements to the DB2 database.
DatabaseAdapter
Field Summary |
---|
Fields inherited from class com.triactive.jdo.store.DatabaseAdapter |
---|
databaseMajorVersion, databaseMinorVersion, databaseProductName, databaseProductVersion, identifierQuoteString, keywords, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, storesLowerCaseIdentifiers, storesUpperCaseIdentifiers, typeMappings, typesByTypeNumber |
Constructor Summary | |
---|---|
protected |
DB2Adapter(java.sql.DatabaseMetaData metadata)
Constructs a DB2 adapter based on the given JDBC metadata. |
Method Summary | |
---|---|
java.lang.String |
getDropTableStatement(BaseTable table)
Returns the appropriate SQL to drop the given table. |
java.lang.String |
getSchemaName(java.sql.Connection conn)
|
int |
getUnlimitedLengthPrecisionValue(TypeInfo typeInfo)
Returns the precision value to be used when creating string columns of "unlimited" length. |
java.lang.String |
getVendorID()
|
NumericExpression |
lengthMethod(CharacterExpression str)
Returns the appropriate SQL expression for the JDOQL String.length() method. |
ColumnInfo |
newColumnInfo(java.sql.ResultSet rs)
A factory for ColumnInfo objects. |
TableExpression |
newTableExpression(QueryStatement qs,
Table table,
SQLIdentifier rangeVar)
Returns a new TableExpression object appropriate for this DBMS. |
CharacterExpression |
substringMethod(CharacterExpression str,
NumericExpression begin)
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin) method. |
CharacterExpression |
substringMethod(CharacterExpression str,
NumericExpression begin,
NumericExpression end)
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin,end) method. |
boolean |
supportsBooleanComparison()
|
boolean |
supportsDeferredConstraints()
|
boolean |
supportsNullsInCandidateKeys()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected DB2Adapter(java.sql.DatabaseMetaData metadata)
metadata
- the database metadata.Method Detail |
---|
public java.lang.String getVendorID()
getVendorID
in class DatabaseAdapter
public java.lang.String getSchemaName(java.sql.Connection conn) throws java.sql.SQLException
getSchemaName
in class DatabaseAdapter
java.sql.SQLException
public boolean supportsBooleanComparison()
supportsBooleanComparison
in class DatabaseAdapter
public boolean supportsDeferredConstraints()
supportsDeferredConstraints
in class DatabaseAdapter
public boolean supportsNullsInCandidateKeys()
supportsNullsInCandidateKeys
in class DatabaseAdapter
public ColumnInfo newColumnInfo(java.sql.ResultSet rs)
DatabaseAdapter
ResultSet
object passed must have been
obtained from a call to DatabaseMetaData.getColumns().
The constructor only retrieves the values from the current row; the
caller is required to advance to the next row with ResultSet.next()
.
newColumnInfo
in class DatabaseAdapter
rs
- The result set returned from DatabaseMetaData.getColumns().public TableExpression newTableExpression(QueryStatement qs, Table table, SQLIdentifier rangeVar)
DatabaseAdapter
newTableExpression
in class DatabaseAdapter
qs
- The query statement in which the table expression will
be included.table
- The main table in the expression.rangeVar
- The SQL alias, or "range variable", to assign to the
expression or to the main table.public int getUnlimitedLengthPrecisionValue(TypeInfo typeInfo)
DatabaseAdapter
TypeInfo.precision
). However, for some
types in some databases the value must be computed specially.
getUnlimitedLengthPrecisionValue
in class DatabaseAdapter
typeInfo
- the typeInfo object for which the precision value is
needed.
public java.lang.String getDropTableStatement(BaseTable table)
DatabaseAdapter
DROP TABLE FOO CASCADE
getDropTableStatement
in class DatabaseAdapter
table
- The table to drop.
public NumericExpression lengthMethod(CharacterExpression str)
DatabaseAdapter
CHAR_LENGTH(str)
lengthMethod
in class DatabaseAdapter
str
- The argument to the length() method.
public CharacterExpression substringMethod(CharacterExpression str, NumericExpression begin)
DatabaseAdapter
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1.SUBSTRING(str FROM begin)
substringMethod
in class DatabaseAdapter
str
- The first argument to the substring() method.begin
- The second argument to the substring() method.
public CharacterExpression substringMethod(CharacterExpression str, NumericExpression begin, NumericExpression end)
DatabaseAdapter
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1. Note also that an end position is given, while most SQL substring functions take a length.SUBSTRING(str FROM begin FOR len)
substringMethod
in class DatabaseAdapter
str
- The first argument to the substring() method.begin
- The second argument to the substring() method.end
- The third argument to the substring() method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |