org.riverock.dbrevision.db
Class Database

java.lang.Object
  extended by org.riverock.dbrevision.db.Database
Direct Known Subclasses:
DB2Database, HyperSonicDatabase, InterbaseDatabase, MaxDBDatabase, MySqlDatabase, OracleDatabase, PostgreeSqlDatabase, SqlServerDatabase

public abstract class Database
extends Object

Database $Revision: 1141 $ $Date: 2006-12-14 17:43:29 +0300 (Чт, 14 дек 2006) $


Nested Class Summary
static class Database.Family
          Database family
 
Constructor Summary
Database(Connection conn)
          Constructor
 
Method Summary
abstract  void addColumn(DbTable table, DbField field)
           
abstract  void createForeignKey(DbTable view)
           
abstract  void createSequence(DbSequence seq)
           
abstract  void createTable(DbTable table)
           
abstract  void createView(DbView view)
           
abstract  void dropConstraint(DbForeignKey impPk)
           
abstract  void dropSequence(String nameSequence)
           
abstract  void dropTable(DbTable table)
           
abstract  void dropTable(String nameTable)
           
abstract  byte[] getBlobField(ResultSet rs, String nameField, int maxLength)
           
abstract  String getClobField(ResultSet rs, String nameFeld)
           
abstract  String getClobField(ResultSet rs, String nameFeld, int maxLength)
           
 Connection getConnection()
          Get jdbc connection
abstract  String getDefaultSchemaName(DatabaseMetaData databaseMetaData)
           
abstract  String getDefaultTimestampValue()
           
abstract  Database.Family getFamily()
          get family for this adapter
abstract  int getMaxLengthStringField()
           
abstract  String getOnDeleteSetNull()
           
abstract  List<DbSequence> getSequnceList(String schemaPattern)
           
abstract  List<DbView> getViewList(String schemaPattern, String tablePattern)
           
abstract  String getViewText(DbView view)
           
abstract  boolean isBatchUpdate()
          Is this db support batch update?
abstract  boolean isByteArrayInUtf8()
           
abstract  boolean isNeedUpdateBracket()
           
abstract  boolean isSchemaSupports()
           
abstract  void setBlobField(String tableName, String fieldName, byte[] bytes, String whereQuery, Object[] objects, int[] fieldTyped)
           
 void setConnection(Connection conn)
           
abstract  void setLongVarbinary(PreparedStatement ps, int index, DbDataFieldData fieldData)
           
abstract  void setLongVarchar(PreparedStatement ps, int index, DbDataFieldData fieldData)
           
abstract  boolean testExceptionConstraintExists(Exception e)
           
abstract  boolean testExceptionIndexUniqueKey(Exception e)
           
abstract  boolean testExceptionIndexUniqueKey(Exception e, String index)
           
abstract  boolean testExceptionSequenceExists(Exception e)
           
abstract  boolean testExceptionTableExists(Exception e)
           
abstract  boolean testExceptionTableNotFound(Exception e)
           
abstract  boolean testExceptionViewExists(Exception e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Database

public Database(Connection conn)
Constructor

Parameters:
conn - connection
Method Detail

setConnection

public void setConnection(Connection conn)

getConnection

public Connection getConnection()
Get jdbc connection

Returns:
connection

getFamily

public abstract Database.Family getFamily()
get family for this adapter

Returns:
family

setBlobField

public abstract void setBlobField(String tableName,
                                  String fieldName,
                                  byte[] bytes,
                                  String whereQuery,
                                  Object[] objects,
                                  int[] fieldTyped)

isBatchUpdate

public abstract boolean isBatchUpdate()
Is this db support batch update?

Returns:
true if support

isNeedUpdateBracket

public abstract boolean isNeedUpdateBracket()

isByteArrayInUtf8

public abstract boolean isByteArrayInUtf8()

isSchemaSupports

public abstract boolean isSchemaSupports()

getDefaultSchemaName

public abstract String getDefaultSchemaName(DatabaseMetaData databaseMetaData)

getClobField

public abstract String getClobField(ResultSet rs,
                                    String nameFeld)

getBlobField

public abstract byte[] getBlobField(ResultSet rs,
                                    String nameField,
                                    int maxLength)

createTable

public abstract void createTable(DbTable table)

createView

public abstract void createView(DbView view)

createSequence

public abstract void createSequence(DbSequence seq)

dropTable

public abstract void dropTable(DbTable table)

dropTable

public abstract void dropTable(String nameTable)

dropSequence

public abstract void dropSequence(String nameSequence)

dropConstraint

public abstract void dropConstraint(DbForeignKey impPk)

addColumn

public abstract void addColumn(DbTable table,
                               DbField field)

createForeignKey

public abstract void createForeignKey(DbTable view)

getOnDeleteSetNull

public abstract String getOnDeleteSetNull()

getDefaultTimestampValue

public abstract String getDefaultTimestampValue()

getViewList

public abstract List<DbView> getViewList(String schemaPattern,
                                         String tablePattern)

getSequnceList

public abstract List<DbSequence> getSequnceList(String schemaPattern)

getViewText

public abstract String getViewText(DbView view)

setLongVarbinary

public abstract void setLongVarbinary(PreparedStatement ps,
                                      int index,
                                      DbDataFieldData fieldData)

setLongVarchar

public abstract void setLongVarchar(PreparedStatement ps,
                                    int index,
                                    DbDataFieldData fieldData)

getClobField

public abstract String getClobField(ResultSet rs,
                                    String nameFeld,
                                    int maxLength)
Parameters:
rs - result set
nameFeld - name of field
maxLength - max length of CLOB field
Returns:
value of specific table columns

testExceptionTableNotFound

public abstract boolean testExceptionTableNotFound(Exception e)

testExceptionIndexUniqueKey

public abstract boolean testExceptionIndexUniqueKey(Exception e,
                                                    String index)

testExceptionIndexUniqueKey

public abstract boolean testExceptionIndexUniqueKey(Exception e)

testExceptionTableExists

public abstract boolean testExceptionTableExists(Exception e)

testExceptionViewExists

public abstract boolean testExceptionViewExists(Exception e)

testExceptionSequenceExists

public abstract boolean testExceptionSequenceExists(Exception e)

testExceptionConstraintExists

public abstract boolean testExceptionConstraintExists(Exception e)

getMaxLengthStringField

public abstract int getMaxLengthStringField()
Returns:
- int. Max size of char field


Copyright © 2008 Riverock community. All Rights Reserved.