com.j256.ormlite.db
Class Db2DatabaseType

java.lang.Object
  extended by com.j256.ormlite.db.BaseDatabaseType
      extended by com.j256.ormlite.db.Db2DatabaseType
All Implemented Interfaces:
DatabaseType

public class Db2DatabaseType
extends BaseDatabaseType
implements DatabaseType

IBM DB2 database type information used to create the tables, etc..

WARNING: I have not tested this unfortunately because of a lack of access to a DB2 instance. Love to get 1-2 hours of access to an database to test/tweak this. Undoubtably is it wrong. Please contact the author if you'd like to help.

Author:
graywatson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.j256.ormlite.db.BaseDatabaseType
BaseDatabaseType.BooleanNumberFieldConverter
 
Field Summary
 
Fields inherited from class com.j256.ormlite.db.BaseDatabaseType
booleanConverter
 
Constructor Summary
Db2DatabaseType()
           
 
Method Summary
protected  void appendBooleanType(StringBuilder sb)
          Output the SQL type for a Java boolean.
protected  void appendByteType(StringBuilder sb)
          Output the SQL type for a Java byte.
 void appendEscapedEntityName(StringBuilder sb, String word)
          Add a entity-name word to the string builder wrapped in the proper characters to escape it.
protected  void appendObjectType(StringBuilder sb)
          Output the SQL type for a Java object.
protected  void configureGeneratedId(StringBuilder sb, FieldType fieldType, List<String> statementsBefore, List<String> additionalArgs, List<String> queriesAfter)
          Output the SQL necessary to configure a generated-id column.
 String getDriverClassName()
          Return the class name of the database driver.
 String getDriverUrlPart()
          Return the part in the database URI which identifies the particular database.
 
Methods inherited from class com.j256.ormlite.db.BaseDatabaseType
appendCanBeNull, appendColumnArg, appendCreateTableSuffix, appendDateType, appendDefaultValue, appendDoubleType, appendEnumIntType, appendEnumStringType, appendEscapedWord, appendFloatType, appendIntegerType, appendLimitValue, appendLongType, appendSelectNextValFromSequence, appendShortType, appendStringType, buildDatabaseAccess, configureGeneratedIdSequence, configureId, convertColumnName, dropColumnArg, generateIdSequenceName, getCommentLinePrefix, getDefaultVarcharWidth, getFieldConverter, isCreateTableReturnsZero, isEntityNamesMustBeUpCase, isIdSequenceNeeded, isLimitAfterSelect, isLimitSqlSupported, isVarcharFieldWidthSupported, loadDriver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.j256.ormlite.db.DatabaseType
appendColumnArg, appendCreateTableSuffix, appendEscapedWord, appendLimitValue, appendSelectNextValFromSequence, buildDatabaseAccess, convertColumnName, dropColumnArg, generateIdSequenceName, getCommentLinePrefix, getFieldConverter, isCreateTableReturnsZero, isEntityNamesMustBeUpCase, isIdSequenceNeeded, isLimitAfterSelect, isLimitSqlSupported, isVarcharFieldWidthSupported, loadDriver
 

Constructor Detail

Db2DatabaseType

public Db2DatabaseType()
Method Detail

getDriverUrlPart

public String getDriverUrlPart()
Description copied from interface: DatabaseType
Return the part in the database URI which identifies the particular database. Usually the URI is in the form jdbc:ddd:... where ddd is the driver url part.

Specified by:
getDriverUrlPart in interface DatabaseType

getDriverClassName

public String getDriverClassName()
Description copied from interface: DatabaseType
Return the class name of the database driver.

Specified by:
getDriverClassName in interface DatabaseType

appendBooleanType

protected void appendBooleanType(StringBuilder sb)
Description copied from class: BaseDatabaseType
Output the SQL type for a Java boolean.

Overrides:
appendBooleanType in class BaseDatabaseType

appendByteType

protected void appendByteType(StringBuilder sb)
Description copied from class: BaseDatabaseType
Output the SQL type for a Java byte.

Overrides:
appendByteType in class BaseDatabaseType

appendObjectType

protected void appendObjectType(StringBuilder sb)
Description copied from class: BaseDatabaseType
Output the SQL type for a Java object.

Overrides:
appendObjectType in class BaseDatabaseType

configureGeneratedId

protected void configureGeneratedId(StringBuilder sb,
                                    FieldType fieldType,
                                    List<String> statementsBefore,
                                    List<String> additionalArgs,
                                    List<String> queriesAfter)
Description copied from class: BaseDatabaseType
Output the SQL necessary to configure a generated-id column. This may add to the before statements list or additional arguments later. NOTE: Only one of configureGeneratedIdSequence, configureGeneratedId, or configureId will be called.

Overrides:
configureGeneratedId in class BaseDatabaseType

appendEscapedEntityName

public void appendEscapedEntityName(StringBuilder sb,
                                    String word)
Description copied from interface: DatabaseType
Add a entity-name word to the string builder wrapped in the proper characters to escape it. This avoids problems with table, column, and sequence-names being reserved words.

Specified by:
appendEscapedEntityName in interface DatabaseType
Overrides:
appendEscapedEntityName in class BaseDatabaseType


Copyright © 2010. All Rights Reserved.