Update of /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv546/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects
Modified Files:
FrontBaseDialect.java IngresDialect.java DB2Dialect.java
InterbaseDialect.java MAXDBDialect.java H2Dialect.java
MySQLDialect.java McKoiDialect.java InformixDialect.java
SybaseDialect.java TimesTenDialect.java PointbaseDialect.java
HibernateDialect.java Oracle9iDialect.java
DaffodilDialect.java DerbyDialect.java ProgressDialect.java
SQLServerDialect.java AxionDialect.java DialectFactory.java
PostgreSQLDialect.java FirebirdDialect.java HSQLDialect.java
Log Message:
No longer use class names of the jdbc drive to decide which dialect to
use. Now we use database product name and version.
Index: DialectFactory.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/DialectFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DialectFactory.java 22 Jul 2006 14:21:31 -0000 1.2
--- DialectFactory.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 19,27 ****
package net.sourceforge.squirrel_sql.plugins.dbcopy.dialects;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;
- import java.util.StringTokenizer;
import javax.swing.JFrame;
--- 19,28 ----
package net.sourceforge.squirrel_sql.plugins.dbcopy.dialects;
+ import java.io.PrintWriter;
+ import java.io.StringWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;
import javax.swing.JFrame;
***************
*** 29,35 ****
import net.sourceforge.squirrel_sql.client.session.ISession;
! import net.sourceforge.squirrel_sql.fw.sql.ISQLDriver;
import net.sourceforge.squirrel_sql.fw.util.StringManager;
import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
import net.sourceforge.squirrel_sql.plugins.dbcopy.UserCancelledOperationException;
import net.sourceforge.squirrel_sql.plugins.dbcopy.prefs.DBCopyPreferenceBean;
--- 30,38 ----
import net.sourceforge.squirrel_sql.client.session.ISession;
! import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData;
import net.sourceforge.squirrel_sql.fw.util.StringManager;
import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
+ import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
+ import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
import net.sourceforge.squirrel_sql.plugins.dbcopy.UserCancelledOperationException;
import net.sourceforge.squirrel_sql.plugins.dbcopy.prefs.DBCopyPreferenceBean;
***************
*** 47,50 ****
--- 50,57 ----
public static final int DEST_TYPE = 1;
+ /** Logger for this class. */
+ private final static ILogger s_log =
+ LoggerController.createLogger(DialectFactory.class);
+
private static final AxionDialect axionDialect = new AxionDialect();
***************
*** 141,230 ****
public static boolean isAxionSession(ISession session) {
! return testDriverName(session, prefs.getAxionDriverClass())
|| testSessionDialect(session, AxionDialect.class);
}
public static boolean isDaffodilSession(ISession session) {
! return testDriverName(session, prefs.getDaffodilDriverClass())
|| testSessionDialect(session, DaffodilDialect.class);
}
public static boolean isDB2Session(ISession session) {
! return testDriverName(session, prefs.getDb2DriverClass())
|| testSessionDialect(session, DB2Dialect.class);
}
public static boolean isDerbySession(ISession session) {
! return testDriverName(session, prefs.getDerbyDriverClass())
|| testSessionDialect(session, DerbyDialect.class);
}
public static boolean isFirebirdSession(ISession session) {
! return testDriverName(session, prefs.getFirebirdDriverClass())
|| testSessionDialect(session, FirebirdDialect.class);
}
public static boolean isFrontBaseSession(ISession session) {
! return testDriverName(session, prefs.getFrontbaseDriverClass())
|| testSessionDialect(session, FrontBaseDialect.class);
}
public static boolean isH2Dialect(ISession session) {
! return testDriverName(session, prefs.getH2DriverClass())
|| testSessionDialect(session, H2Dialect.class);
}
public static boolean isHSQLSession(ISession session) {
! return testDriverName(session, prefs.getHypersonicDriverClass())
|| testSessionDialect(session, HSQLDialect.class);
}
public static boolean isIngresSession(ISession session) {
! return testDriverName(session, prefs.getIngresDriverClass())
|| testSessionDialect(session, IngresDialect.class);
}
public static boolean isMaxDBSession(ISession session) {
! return testDriverName(session, prefs.getMaxDbDriverClass())
|| testSessionDialect(session, MAXDBDialect.class);
}
public static boolean isMcKoiSession(ISession session) {
! return testDriverName(session, prefs.getMckoiDriverClass())
|| testSessionDialect(session, McKoiDialect.class);
}
public static boolean isMSSQLServerSession(ISession session) {
! return testDriverName(session, prefs.getMssqlserverDriverClass())
|| testSessionDialect(session, SQLServerDialect.class);
}
public static boolean isMySQLSession(ISession session) {
! return testDriverName(session, prefs.getMysqlDriverClass())
|| testSessionDialect(session, MySQLDialect.class);
}
public static boolean isOracleSession(ISession session) {
! return testDriverName(session, prefs.getOracleDriverClass())
|| testSessionDialect(session, Oracle9iDialect.class);
}
public static boolean isPointbase(ISession session) {
! return testDriverName(session, prefs.getPointbaseDriverClass())
|| testSessionDialect(session, PointbaseDialect.class);
}
public static boolean isPostgreSQL(ISession session) {
! return testDriverName(session, prefs.getPostgresqlDriverClass())
|| testSessionDialect(session, PostgreSQLDialect.class);
}
public static boolean isProgressSQL(ISession session) {
! return testDriverName(session, prefs.getProgressDriverClass())
|| testSessionDialect(session, ProgressDialect.class);
}
public static boolean isSyBaseSession(ISession session) {
! return testDriverName(session, prefs.getSybaseDriverClass())
|| testSessionDialect(session, SybaseDialect.class);
}
--- 148,237 ----
public static boolean isAxionSession(ISession session) {
! return dialectSupportsProduct(session, axionDialect)
|| testSessionDialect(session, AxionDialect.class);
}
public static boolean isDaffodilSession(ISession session) {
! return dialectSupportsProduct(session, daffodilDialect)
|| testSessionDialect(session, DaffodilDialect.class);
}
public static boolean isDB2Session(ISession session) {
! return dialectSupportsProduct(session, db2Dialect)
|| testSessionDialect(session, DB2Dialect.class);
}
public static boolean isDerbySession(ISession session) {
! return dialectSupportsProduct(session, derbyDialect)
|| testSessionDialect(session, DerbyDialect.class);
}
public static boolean isFirebirdSession(ISession session) {
! return dialectSupportsProduct(session, firebirdDialect)
|| testSessionDialect(session, FirebirdDialect.class);
}
public static boolean isFrontBaseSession(ISession session) {
! return dialectSupportsProduct(session, frontbaseDialect)
|| testSessionDialect(session, FrontBaseDialect.class);
}
public static boolean isH2Dialect(ISession session) {
! return dialectSupportsProduct(session, h2Dialect)
|| testSessionDialect(session, H2Dialect.class);
}
public static boolean isHSQLSession(ISession session) {
! return dialectSupportsProduct(session, hsqlDialect)
|| testSessionDialect(session, HSQLDialect.class);
}
public static boolean isIngresSession(ISession session) {
! return dialectSupportsProduct(session, ingresDialect)
|| testSessionDialect(session, IngresDialect.class);
}
public static boolean isMaxDBSession(ISession session) {
! return dialectSupportsProduct(session, maxDbDialect)
|| testSessionDialect(session, MAXDBDialect.class);
}
public static boolean isMcKoiSession(ISession session) {
! return dialectSupportsProduct(session, mckoiDialect)
|| testSessionDialect(session, McKoiDialect.class);
}
public static boolean isMSSQLServerSession(ISession session) {
! return dialectSupportsProduct(session, sqlserverDialect)
|| testSessionDialect(session, SQLServerDialect.class);
}
public static boolean isMySQLSession(ISession session) {
! return dialectSupportsProduct(session, mysqlDialect)
|| testSessionDialect(session, MySQLDialect.class);
}
public static boolean isOracleSession(ISession session) {
! return dialectSupportsProduct(session, oracle9iDialect)
|| testSessionDialect(session, Oracle9iDialect.class);
}
public static boolean isPointbase(ISession session) {
! return dialectSupportsProduct(session, pointbaseDialect)
|| testSessionDialect(session, PointbaseDialect.class);
}
public static boolean isPostgreSQL(ISession session) {
! return dialectSupportsProduct(session, postgreSQLDialect)
|| testSessionDialect(session, PostgreSQLDialect.class);
}
public static boolean isProgressSQL(ISession session) {
! return dialectSupportsProduct(session, progressDialect)
|| testSessionDialect(session, ProgressDialect.class);
}
public static boolean isSyBaseSession(ISession session) {
! return dialectSupportsProduct(session, sybaseDialect)
|| testSessionDialect(session, SybaseDialect.class);
}
***************
*** 241,263 ****
* the ISession's driver class name; false otherwise.
*/
! private static boolean testDriverName(ISession session, String nameToMatch) {
boolean result = false;
! if (session != null && nameToMatch != null) {
! ISQLDriver driver = session.getDriver();
! if (driver != null) {
! String driverClassName = driver.getDriverClassName();
! if (driverClassName != null) {
! String driverClassNameLC = driverClassName.toLowerCase();
! StringTokenizer st = new StringTokenizer(nameToMatch);
! while (st.hasMoreTokens()) {
! String token = st.nextToken();
! if (driverClassNameLC.startsWith(token.toLowerCase())) {
! result = true;
! break;
! }
! }
!
! }
! }
}
return result;
--- 248,272 ----
* the ISession's driver class name; false otherwise.
*/
! private static boolean dialectSupportsProduct(ISession session,
! HibernateDialect dialect)
! {
boolean result = false;
! if (session != null && dialect != null) {
! SQLDatabaseMetaData data = session.getSQLConnection().getSQLMetaData();
! try {
! String productName = data.getDatabaseProductName();
! String productVersion = data.getDatabaseProductVersion();
! result = dialect.supportsProduct(productName, productVersion);
! } catch (Exception e) {
! s_log.error(
! "Encountered unexpected exception while attempting to " +
! "determine database product name/version: "+e.getMessage());
! if (s_log.isDebugEnabled()) {
! StringWriter s = new StringWriter();
! PrintWriter p = new PrintWriter(s);
! e.printStackTrace(p);
! s_log.debug(s.getBuffer().toString());
! }
! }
}
return result;
Index: DB2Dialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/DB2Dialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DB2Dialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- DB2Dialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 160,163 ****
return "DB2";
}
!
}
--- 160,187 ----
return "DB2";
}
!
! /**
! * Returns boolean value indicating whether or not this dialect supports the
! * specified database product/version.
! *
! * @param databaseProductName the name of the database as reported by
! * DatabaseMetaData.getDatabaseProductName()
! * @param databaseProductVersion the version of the database as reported by
! * DatabaseMetaData.getDatabaseProductVersion()
! * @return true if this dialect can be used for the specified product name
! * and version; false otherwise.
! */
! public boolean supportsProduct(String databaseProductName,
! String databaseProductVersion)
! {
! if (databaseProductName == null) {
! return false;
! }
! if (databaseProductName.trim().startsWith("DB2")) {
! // We don't yet have the need to discriminate by version.
! return true;
! }
! return false;
! }
!
}
Index: SybaseDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/SybaseDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SybaseDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- SybaseDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 135,138 ****
return "Sybase";
}
!
}
--- 135,162 ----
return "Sybase";
}
!
! /**
! * Returns boolean value indicating whether or not this dialect supports the
! * specified database product/version.
! *
! * @param databaseProductName the name of the database as reported by
! * DatabaseMetaData.getDatabaseProductName()
! * @param databaseProductVersion the version of the database as reported by
! * DatabaseMetaData.getDatabaseProductVersion()
! * @return true if this dialect can be used for the specified product name
! * and version; false otherwise.
! */
! public boolean supportsProduct(String databaseProductName,
! String databaseProductVersion)
! {
! if (databaseProductName == null) {
! return false;
! }
! String lname = databaseProductName.trim().toLowerCase();
! if (lname.startsWith("sybase") || lname.startsWith("adaptive")) {
! // We don't yet have the need to discriminate by version.
! return true;
! }
! return false;
! }
}
Index: InformixDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/InformixDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** InformixDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- InformixDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 19,24 ****
package net.sourceforge.squirrel_sql.plugins.dbcopy.dialects;
- import java.sql.Types;
-
import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo;
--- 19,22 ----
***************
*** 125,127 ****
--- 123,150 ----
return "Informix";
}
+
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().startsWith("Informix")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
+
}
Index: HSQLDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/HSQLDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HSQLDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- HSQLDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 126,130 ****
*/
public String getDisplayName() {
! return "HyperSonic";
}
}
--- 126,155 ----
*/
public String getDisplayName() {
! return "HSQL";
}
+
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().startsWith("HSQL")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
+
}
Index: ProgressDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/ProgressDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ProgressDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- ProgressDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 131,134 ****
return "Progress";
}
!
}
--- 131,157 ----
return "Progress";
}
!
! /**
! * Returns boolean value indicating whether or not this dialect supports the
! * specified database product/version.
! *
! * @param databaseProductName the name of the database as reported by
! * DatabaseMetaData.getDatabaseProductName()
! * @param databaseProductVersion the version of the database as reported by
! * DatabaseMetaData.getDatabaseProductVersion()
! * @return true if this dialect can be used for the specified product name
! * and version; false otherwise.
! */
! public boolean supportsProduct(String databaseProductName,
! String databaseProductVersion)
! {
! if (databaseProductName == null) {
! return false;
! }
! if (databaseProductName.trim().toLowerCase().startsWith("progress")) {
! // We don't yet have the need to discriminate by version.
! return true;
! }
! return false;
! }
}
Index: MAXDBDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/MAXDBDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MAXDBDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- MAXDBDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 114,116 ****
--- 114,141 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ String lname = databaseProductName.trim().toLowerCase();
+ if (lname.startsWith("sap") || lname.startsWith("maxdb")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
+
}
Index: McKoiDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/McKoiDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** McKoiDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- McKoiDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 137,139 ****
--- 137,162 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("mckoi")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: H2Dialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/H2Dialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2Dialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- H2Dialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 351,354 ****
--- 351,378 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().startsWith("H2")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
+
}
Index: SQLServerDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/SQLServerDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SQLServerDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- SQLServerDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 137,139 ****
--- 137,162 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("microsoft")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: MySQLDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/MySQLDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MySQLDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- MySQLDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 132,134 ****
--- 132,157 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("mysql")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: FirebirdDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/FirebirdDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FirebirdDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- FirebirdDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 139,142 ****
--- 139,166 ----
return "Firebird";
}
+
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().startsWith("Firebird")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: Oracle9iDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/Oracle9iDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Oracle9iDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- Oracle9iDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 145,147 ****
--- 145,170 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("oracle")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: AxionDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/AxionDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AxionDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- AxionDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 138,141 ****
--- 138,165 ----
return "Axion";
}
+
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().startsWith("Axion")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: TimesTenDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/TimesTenDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TimesTenDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- TimesTenDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 124,126 ****
--- 124,149 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("timesten")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: PointbaseDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/PointbaseDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PointbaseDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- PointbaseDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 142,144 ****
--- 142,167 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("pointbase")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: FrontBaseDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/FrontBaseDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FrontBaseDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- FrontBaseDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 165,167 ****
--- 165,190 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().startsWith("FrontBase")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: HibernateDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/HibernateDialect.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** HibernateDialect.java 21 Jul 2006 03:13:04 -0000 1.1
--- HibernateDialect.java 22 Jul 2006 23:41:19 -0000 1.2
***************
*** 155,157 ****
--- 155,170 ----
int getColumnLength(int columnSize, int dataType);
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion);
}
Index: InterbaseDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/InterbaseDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** InterbaseDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- InterbaseDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 19,24 ****
package net.sourceforge.squirrel_sql.plugins.dbcopy.dialects;
- import java.sql.Types;
-
import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo;
--- 19,22 ----
***************
*** 126,128 ****
--- 124,149 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("interbase")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: PostgreSQLDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/PostgreSQLDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PostgreSQLDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- PostgreSQLDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 154,156 ****
--- 154,179 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("postgresql")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: DerbyDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/DerbyDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DerbyDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- DerbyDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 130,132 ****
--- 130,155 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().startsWith("Apache Derby")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: IngresDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/IngresDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** IngresDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- IngresDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 156,158 ****
--- 156,182 ----
return "Ingres";
}
+
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().toLowerCase().startsWith("informix")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
}
Index: DaffodilDialect.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/dialects/DaffodilDialect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DaffodilDialect.java 22 Jul 2006 14:21:31 -0000 1.2
--- DaffodilDialect.java 22 Jul 2006 23:41:19 -0000 1.3
***************
*** 151,153 ****
--- 151,178 ----
}
+ /**
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
+ *
+ * @param databaseProductName the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
+ * @param databaseProductVersion the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
+ */
+ public boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion)
+ {
+ if (databaseProductName == null) {
+ return false;
+ }
+ if (databaseProductName.trim().startsWith("Daffodil")) {
+ // We don't yet have the need to discriminate by version.
+ return true;
+ }
+ return false;
+ }
+
+
}
|