JavaDoc


FireBirdDatabaseHandler

org.dbreplicator.replication.DBHandler
Class FireBirdDatabaseHandler

java.lang.Object
  extended by org.dbreplicator.replication.DBHandler.AbstractDataBaseHandler
      extended by org.dbreplicator.replication.DBHandler.FireBirdDatabaseHandler

public class FireBirdDatabaseHandler
extends AbstractDataBaseHandler

Method overrides specific to the Firebird database engine.


Field Summary
 
Fields inherited from class org.dbreplicator.replication.DBHandler.AbstractDataBaseHandler
ignoredColumns_Table, trackPrimaryKeyUpdation_Table, trackReplicationTablesUpdation_Table
 
Constructor Summary
FireBirdDatabaseHandler()
           
FireBirdDatabaseHandler(ConnectionPool connectionPool0)
           
 
Method Summary
 boolean checkSchema(java.lang.String schemaName)
           
 void createScheduleTable(java.lang.String subName)
           
 void createShadowTable(java.lang.String pubsubName, java.lang.String tableName, java.lang.String allColSequence, java.lang.String[] primaryColumns)
          Creates Shadow Table as per the database.
 void createShadowTableTriggers(java.lang.String pubsubName, java.lang.String tableName, java.util.ArrayList colInfoList, java.lang.String[] primCols)
          Creates ShadowTable triggers on different replication tables.
 void deleteRecordsFromSuperLogTable(java.sql.Statement subStatment)
           
 void dropGenerator(java.sql.Connection con, java.lang.String sequenceName)
           
 void dropGenerators(java.sql.Connection con, java.lang.String generatorName)
           
 void dropPublisherSystemTables(java.sql.Connection con)
           
 void dropSubscriberSystemTables(java.sql.Connection con)
           
 int getAppropriatePrecision(int columnSize, java.lang.String datatypeName)
          This method is implemented in child classes if precision exceed the maximum precision of the data type
 int getAppropriateScale(int columnScale)
           
 AbstractColumnObject getColumnObject(TypeInfo typeInfo)
          According to the sqlType, different column's for different databases are handled saperately.
 java.lang.Object getMinValOfSyncIdTodeleteRecordsFromShadowTable(java.lang.String tableName, java.sql.Statement stmt)
           
 java.lang.String getRepTableInsertQuery(java.lang.String pubsubName, RepTable repTable)
           
 java.lang.String getScheduleTableName()
           
 boolean isColumnSizeExceedMaximumSize(TypeInfo typeInfo)
           
 boolean isDataTypeOptionalSizeSupported(TypeInfo typeInfo)
           
 boolean isForeignKeyException(java.sql.SQLException ex)
          isForeignKeyException
 boolean isPrimaryKeyException(java.sql.SQLException ex)
          isPrimaryKeyException
 boolean isSchemaSupported()
          isSchemaSupported Returing false because FireBird database does not support schema
 java.sql.PreparedStatement makePrimaryPreperedStatement(java.sql.Connection pub_sub_Connection, java.lang.String[] primaryColumns, java.lang.String shadowTable, java.lang.String local_pub_sub_name)
           
 java.sql.PreparedStatement makePrimaryPreperedStatementBackwardTraversing(java.lang.String[] primaryColumns, long lastId, java.lang.String local_pub_sub_name, java.lang.String shadowTable)
           
 void makeProvisionForLOBDataTypes(java.util.ArrayList dataTypeList)
          CLOB and BLOB type columns do not added in trigger definition So this type columns has been removed fom the arraylist
 java.lang.String saveRepTableData(java.sql.Connection connection, java.lang.String pubsubName, RepTable repTable)
          Save the RepTable data which is a system table.
 void setColumnPrecisionInTypeInfo(TypeInfo typeInfo, java.sql.ResultSetMetaData rsmt, int columnIndex)
           
 void setTypeInfo(TypeInfo typeInfo, java.sql.ResultSet rs)
          This is a very important function which sets the parameter (instance of Class TypeInfo) with the corresponding typeName of the sqlType for different databases.
 
Methods inherited from class org.dbreplicator.replication.DBHandler.AbstractDataBaseHandler
createClientSystemTables, createRemoteSystemTables, createSchemas, CreateSequenceOnLogTable, CreateSequenceOnRepTable, CreateSequenceOnShadowTable, createSubscribedTablesTriggersAndShadowTables, dropSequences, dropTriggersAndShadowTable, fireDropQuery, getBookMarkTableName, getColumnNamesAndDataTypes, getColumnNamesAndDataTypes1, getIgnoredColumns_Table, getLocalServerName, getLogTableName, getPublicationTableName, getRepTableName, getShadowTableColumnDataTypeSequence, getShadowTableName, getSubscriptionTableName, getTableColumns, getTrackPrimayKeyUpdation_Table, getTrackReplicationTablesUpdation_Table, getvendorName, setDefaultSchema, setIgnoredColumns, setLocalServerName, updateDataType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FireBirdDatabaseHandler

public FireBirdDatabaseHandler()

FireBirdDatabaseHandler

public FireBirdDatabaseHandler(ConnectionPool connectionPool0)
Method Detail

createShadowTable

public void createShadowTable(java.lang.String pubsubName,
                              java.lang.String tableName,
                              java.lang.String allColSequence,
                              java.lang.String[] primaryColumns)
                       throws RepException
Description copied from class: AbstractDataBaseHandler
Creates Shadow Table as per the database.

Specified by:
createShadowTable in class AbstractDataBaseHandler
Throws:
RepException

createShadowTableTriggers

public void createShadowTableTriggers(java.lang.String pubsubName,
                                      java.lang.String tableName,
                                      java.util.ArrayList colInfoList,
                                      java.lang.String[] primCols)
                               throws RepException
Description copied from class: AbstractDataBaseHandler
Creates ShadowTable triggers on different replication tables.

Specified by:
createShadowTableTriggers in class AbstractDataBaseHandler
Throws:
RepException

isDataTypeOptionalSizeSupported

public boolean isDataTypeOptionalSizeSupported(TypeInfo typeInfo)
Specified by:
isDataTypeOptionalSizeSupported in class AbstractDataBaseHandler

setTypeInfo

public void setTypeInfo(TypeInfo typeInfo,
                        java.sql.ResultSet rs)
                 throws RepException,
                        java.sql.SQLException
Description copied from class: AbstractDataBaseHandler
This is a very important function which sets the parameter (instance of Class TypeInfo) with the corresponding typeName of the sqlType for different databases. So that we can make corresponding queries.

Specified by:
setTypeInfo in class AbstractDataBaseHandler
Throws:
RepException
java.sql.SQLException

getColumnObject

public AbstractColumnObject getColumnObject(TypeInfo typeInfo)
                                     throws RepException
Description copied from class: AbstractDataBaseHandler
According to the sqlType, different column's for different databases are handled saperately. It returns the object of AbstractColumnObject which is extended by each type of column Object classes. This fundamental is used basically for handeling Blob and Clob type of columns.

Specified by:
getColumnObject in class AbstractDataBaseHandler
Throws:
RepException

getRepTableInsertQuery

public java.lang.String getRepTableInsertQuery(java.lang.String pubsubName,
                                               RepTable repTable)

dropGenerator

public void dropGenerator(java.sql.Connection con,
                          java.lang.String sequenceName)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

makeProvisionForLOBDataTypes

public void makeProvisionForLOBDataTypes(java.util.ArrayList dataTypeList)
CLOB and BLOB type columns do not added in trigger definition So this type columns has been removed fom the arraylist

Overrides:
makeProvisionForLOBDataTypes in class AbstractDataBaseHandler
Parameters:
dataTypeList - ArrayList

isColumnSizeExceedMaximumSize

public boolean isColumnSizeExceedMaximumSize(TypeInfo typeInfo)
                                      throws java.sql.SQLException,
                                             RepException
Throws:
java.sql.SQLException
RepException

setColumnPrecisionInTypeInfo

public void setColumnPrecisionInTypeInfo(TypeInfo typeInfo,
                                         java.sql.ResultSetMetaData rsmt,
                                         int columnIndex)
                                  throws java.sql.SQLException
Overrides:
setColumnPrecisionInTypeInfo in class AbstractDataBaseHandler
Throws:
java.sql.SQLException

getAppropriatePrecision

public int getAppropriatePrecision(int columnSize,
                                   java.lang.String datatypeName)
Description copied from class: AbstractDataBaseHandler
This method is implemented in child classes if precision exceed the maximum precision of the data type

Overrides:
getAppropriatePrecision in class AbstractDataBaseHandler
Parameters:
columnSize - int
Returns:
int

checkSchema

public boolean checkSchema(java.lang.String schemaName)
Overrides:
checkSchema in class AbstractDataBaseHandler

getAppropriateScale

public int getAppropriateScale(int columnScale)
                        throws RepException
Specified by:
getAppropriateScale in class AbstractDataBaseHandler
Throws:
RepException

createScheduleTable

public void createScheduleTable(java.lang.String subName)
                         throws java.sql.SQLException,
                                RepException
Throws:
java.sql.SQLException
RepException

getScheduleTableName

public java.lang.String getScheduleTableName()
Overrides:
getScheduleTableName in class AbstractDataBaseHandler

saveRepTableData

public java.lang.String saveRepTableData(java.sql.Connection connection,
                                         java.lang.String pubsubName,
                                         RepTable repTable)
                                  throws java.sql.SQLException,
                                         RepException
Description copied from class: AbstractDataBaseHandler
Save the RepTable data which is a system table. It store the Publication/Subscription Name, its corresponding table with filter clause and conflict resolver.

Overrides:
saveRepTableData in class AbstractDataBaseHandler
Throws:
java.sql.SQLException
RepException

dropPublisherSystemTables

public void dropPublisherSystemTables(java.sql.Connection con)
Overrides:
dropPublisherSystemTables in class AbstractDataBaseHandler

dropSubscriberSystemTables

public void dropSubscriberSystemTables(java.sql.Connection con)
Overrides:
dropSubscriberSystemTables in class AbstractDataBaseHandler

deleteRecordsFromSuperLogTable

public void deleteRecordsFromSuperLogTable(java.sql.Statement subStatment)
                                    throws java.sql.SQLException
Overrides:
deleteRecordsFromSuperLogTable in class AbstractDataBaseHandler
Throws:
java.sql.SQLException

dropGenerators

public void dropGenerators(java.sql.Connection con,
                           java.lang.String generatorName)
                    throws java.sql.SQLException
Overrides:
dropGenerators in class AbstractDataBaseHandler
Throws:
java.sql.SQLException

makePrimaryPreperedStatement

public java.sql.PreparedStatement makePrimaryPreperedStatement(java.sql.Connection pub_sub_Connection,
                                                               java.lang.String[] primaryColumns,
                                                               java.lang.String shadowTable,
                                                               java.lang.String local_pub_sub_name)
                                                        throws java.sql.SQLException,
                                                               RepException
Specified by:
makePrimaryPreperedStatement in class AbstractDataBaseHandler
Throws:
java.sql.SQLException
RepException

isPrimaryKeyException

public boolean isPrimaryKeyException(java.sql.SQLException ex)
isPrimaryKeyException

Specified by:
isPrimaryKeyException in class AbstractDataBaseHandler
Parameters:
ex - SQLException
Returns:
boolean

isForeignKeyException

public boolean isForeignKeyException(java.sql.SQLException ex)
isForeignKeyException

Specified by:
isForeignKeyException in class AbstractDataBaseHandler
Parameters:
ex - SQLException
Returns:
boolean

getMinValOfSyncIdTodeleteRecordsFromShadowTable

public java.lang.Object getMinValOfSyncIdTodeleteRecordsFromShadowTable(java.lang.String tableName,
                                                                        java.sql.Statement stmt)
                                                                 throws java.sql.SQLException
Overrides:
getMinValOfSyncIdTodeleteRecordsFromShadowTable in class AbstractDataBaseHandler
Throws:
java.sql.SQLException

makePrimaryPreperedStatementBackwardTraversing

public java.sql.PreparedStatement makePrimaryPreperedStatementBackwardTraversing(java.lang.String[] primaryColumns,
                                                                                 long lastId,
                                                                                 java.lang.String local_pub_sub_name,
                                                                                 java.lang.String shadowTable)
                                                                          throws java.sql.SQLException,
                                                                                 RepException
Specified by:
makePrimaryPreperedStatementBackwardTraversing in class AbstractDataBaseHandler
Throws:
java.sql.SQLException
RepException

isSchemaSupported

public boolean isSchemaSupported()
isSchemaSupported Returing false because FireBird database does not support schema

Specified by:
isSchemaSupported in class AbstractDataBaseHandler
Returns:
boolean



Powered by Drupal - Theme by Danger4k