Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.j256.ormlite.db;
 
 import java.util.List;
 
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 us if you'd like to help with this class.

Author(s):
graywatson
public class Db2DatabaseType extends BaseDatabaseType implements DatabaseType {
	private final static String DATABASE_URL_PORTION = "db2";
	private final static String DATABASE_NAME = "DB2";
	private final static String DRIVER_CLASS_NAME = "COM.ibm.db2.jdbc.app.DB2Driver";
	public boolean isDatabaseUrlThisType(String urlString dbTypePart) {
		return .equals(dbTypePart);
	}
	protected String getDriverClassName() {
	}
	public String getDatabaseName() {
		return ;
	}
	protected void appendBooleanType(StringBuilder sbFieldType fieldTypeint fieldWidth) {
		sb.append("SMALLINT");
	}
	protected void appendByteType(StringBuilder sbFieldType fieldTypeint fieldWidth) {
		sb.append("SMALLINT");
	}
	protected void appendByteArrayType(StringBuilder sbFieldType fieldTypeint fieldWidth) {
		sb.append("VARCHAR [] FOR BIT DATA");
	}
	protected void appendSerializableType(StringBuilder sbFieldType fieldTypeint fieldWidth) {
		sb.append("VARCHAR [] FOR BIT DATA");
	}
	protected void configureGeneratedId(String tableNameStringBuilder sbFieldType fieldType,
			List<StringstatementsBeforeList<StringstatementsAfterList<StringadditionalArgs,
			List<StringqueriesAfter) {
		sb.append("GENERATED ALWAYS AS IDENTITY ");
		configureId(sbfieldTypestatementsBeforeadditionalArgsqueriesAfter);
	}
	public void appendEscapedEntityName(StringBuilder sbString name) {
		sb.append('\"').append(name).append('\"');
	}
	public boolean isOffsetSqlSupported() {
		// there is no easy way to do this in this database type
		return false;
	}
New to GrepCode? Check out our FAQ X