001 /** 002 * Copyright (c) 2003 Daffodil Software Ltd all rights reserved, 003 * Modifications Copyright (c) 2008 Regiscope Digital Imaging Co, LLC, All rights reserved. 004 * This program is free software; you can redistribute it and/or modify 005 * it under the terms of version 2 of the GNU General Public License as 006 * published by the Free Software Foundation. 007 * There are special exceptions to the terms and conditions of the GPL 008 * as it is applied to this software. See the GNU General Public License for more details. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License 016 * along with this program; if not, write to the Free Software 017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 018 */ 019 020 package org.dbreplicator.replication.DBHandler; 021 022 import java.sql.*; 023 import java.util.*; 024 025 import org.dbreplicator.replication.*; 026 import org.dbreplicator.replication.column.*; 027 import org.apache.log4j.Logger; 028 029 /** 030 * Generic methods common to all databases. 031 */ 032 public class GeneralDataBaseHandler extends AbstractDataBaseHandler 033 { 034 protected static Logger log=Logger.getLogger(GeneralDataBaseHandler.class.getName()); 035 036 public GeneralDataBaseHandler() 037 {} 038 039 public GeneralDataBaseHandler(ConnectionPool connectionPool0) { 040 connectionPool = connectionPool0; 041 vendorType = Utility.DataBase_General; 042 } 043 044 045 protected void createSuperLogTable(String pubName) throws SQLException, 046 RepException 047 {} 048 049 protected void createRepTable(String pubName) throws SQLException, 050 RepException 051 {} 052 053 public void createShadowTable(String pubsubName, String tableName, 054 String allColSequence,String[] primaryColumns) throws RepException 055 {} 056 057 public void createShadowTableTriggers(String pubName, String tableName, 058 ArrayList colNameDataType, 059 String[] primCols) throws RepException 060 {} 061 062 public boolean isDataTypeOptionalSizeSupported(TypeInfo typeInfo) 063 { 064 new Exception(" NOT IMPLENMENTED. ").printStackTrace(); 065 return false; 066 } 067 068 public void setTypeInfo(TypeInfo typeInfo, ResultSet rs) throws RepException, 069 SQLException 070 {} 071 072 public AbstractColumnObject getColumnObject(TypeInfo typeInfo) throws 073 RepException 074 { 075 throw new RepException("", null); 076 } 077 078 public boolean isPrimaryKeyException(SQLException ex) throws SQLException 079 { 080 return false; 081 } 082 083 protected void createIndex(String pubsubName,String tableName) throws RepException { 084 085 } 086 087 088 public int getAppropriateScale(int columnScale) { 089 return columnScale; 090 } 091 public PreparedStatement makePrimaryPreperedStatement(Connection pub_sub_Connection, String[] primaryColumns,String shadowTable,String local_pub_sub_name) throws SQLException, RepException { 092 return null; 093 } 094 095 096 097 098 public boolean isForeignKeyException(SQLException ex) throws SQLException { 099 return false; 100 } 101 102 /** 103 * makeCommonPreparedStatement 104 * 105 * @param shadowTable String 106 * @param local_pub_sub_name String 107 * @return PreparedStatement 108 */ 109 public PreparedStatement makeCommonPreparedStatement(String shadowTable, 110 String local_pub_sub_name) { 111 return null; 112 } 113 protected void createIgnoredColumnsTable(String pubName) throws SQLException, 114 RepException { } 115 116 /** 117 * createTrackReplicationTablesUpdationTable 118 * 119 * @param pubSubName String 120 */ 121 protected void createTrackReplicationTablesUpdationTable(String pubSubName) { 122 } 123 124 /** 125 * createTriggerForTrackReplicationTablesUpdationTable 126 * 127 * @param pubSubName String 128 */ 129 protected void createTriggerForTrackReplicationTablesUpdationTable(String 130 pubSubName) { 131 } 132 133 public PreparedStatement makePrimaryPreperedStatementBackwardTraversing( 134 String[] primaryColumns, long lastId, String local_pub_sub_name, 135 String shadowTable) throws SQLException, RepException { 136 return null; 137 } 138 protected void createTrackPrimaryTable(String pubsubName,String[] primCols) throws RepException { 139 140 } 141 142 /** 143 * isSchemaSupported 144 * 145 * @return boolean 146 */ 147 public boolean isSchemaSupported() { 148 return true; 149 } 150 }

