org.apache.ddlutils
Class PlatformUtils

java.lang.Object
  extended by org.apache.ddlutils.PlatformUtils

public class PlatformUtils
extends Object

Utility functions for dealing with database platforms.

Version:
$Revision: 279421 $

Field Summary
static String JDBC_DRIVER_DATADIRECT_DB2
          The DataDirect Connect DB2 jdbc driver.
static String JDBC_DRIVER_DATADIRECT_ORACLE
          The DataDirect Connect Oracle jdbc driver.
static String JDBC_DRIVER_DATADIRECT_SQLSERVER
          The DataDirect Connect SQLServer jdbc driver.
static String JDBC_DRIVER_DATADIRECT_SYBASE
          The DataDirect Connect Sybase jdbc driver.
static String JDBC_DRIVER_INET_DB2
          The i-net DB2 jdbc driver.
static String JDBC_DRIVER_INET_ORACLE
          The i-net Oracle jdbc driver.
static String JDBC_DRIVER_INET_POOLED
          The i-net pooled jdbc driver for SQLServer and Sybase.
static String JDBC_DRIVER_INET_SQLSERVER
          The i-net SQLServer jdbc driver.
static String JDBC_DRIVER_INET_SYBASE
          The i-net Sybase jdbc driver.
static String JDBC_DRIVER_JSQLCONNECT_SQLSERVER
          The JNetDirect SQLServer jdbc driver.
static String JDBC_DRIVER_JTDS
          The jTDS jdbc driver for SQLServer and Sybase.
static String JDBC_SUBPROTOCOL_DATADIRECT_DB2
          The subprotocol used by the DataDirect DB2 driver.
static String JDBC_SUBPROTOCOL_DATADIRECT_ORACLE
          The subprotocol used by the DataDirect Oracle driver.
static String JDBC_SUBPROTOCOL_DATADIRECT_SQLSERVER
          The subprotocol used by the DataDirect SQLServer driver.
static String JDBC_SUBPROTOCOL_DATADIRECT_SYBASE
          The subprotocol used by the DataDirect Sybase driver.
static String JDBC_SUBPROTOCOL_INET_DB2
          The subprotocol used by the i-net DB2 driver.
static String JDBC_SUBPROTOCOL_INET_ORACLE
          The subprotocol used by the i-net Oracle driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER
          A subprotocol used by the i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER_POOLED_1
          A subprotocol used by the pooled i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER_POOLED_2
          A subprotocol used by the pooled i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER6
          A subprotocol used by the i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER6_POOLED_1
          A subprotocol used by the pooled i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER6_POOLED_2
          A subprotocol used by the pooled i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER7
          A subprotocol used by the i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER7_POOLED_1
          A subprotocol used by the pooled i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER7_POOLED_2
          A subprotocol used by the pooled i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER7A
          A subprotocol used by the i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER7A_POOLED_1
          A subprotocol used by the pooled i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SQLSERVER7A_POOLED_2
          A subprotocol used by the pooled i-net SQLServer driver.
static String JDBC_SUBPROTOCOL_INET_SYBASE
          The subprotocol used by the i-net Sybase driver.
static String JDBC_SUBPROTOCOL_INET_SYBASE_POOLED_1
          The subprotocol used by the pooled i-net Sybase driver.
static String JDBC_SUBPROTOCOL_INET_SYBASE_POOLED_2
          The subprotocol used by the pooled i-net Sybase driver.
static String JDBC_SUBPROTOCOL_JSQLCONNECT_SQLSERVER
          The subprotocol used by the JNetDirect SQLServer driver.
static String JDBC_SUBPROTOCOL_JTDS_SQLSERVER
          The subprotocol used by the jTDS SQLServer driver.
static String JDBC_SUBPROTOCOL_JTDS_SYBASE
          The subprotocol used by the jTDS Sybase driver.
 
Constructor Summary
PlatformUtils()
          Creates a new instance.
 
Method Summary
 String determineDatabaseType(DataSource dataSource)
          Tries to determine the database type for the given data source.
 String determineDatabaseType(DataSource dataSource, String username, String password)
          Tries to determine the database type for the given data source.
 String determineDatabaseType(String driverName, String jdbcConnectionUrl)
          Tries to determine the database type for the given jdbc driver and connection url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JDBC_DRIVER_DATADIRECT_DB2

public static final String JDBC_DRIVER_DATADIRECT_DB2
The DataDirect Connect DB2 jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_DATADIRECT_SQLSERVER

public static final String JDBC_DRIVER_DATADIRECT_SQLSERVER
The DataDirect Connect SQLServer jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_DATADIRECT_ORACLE

public static final String JDBC_DRIVER_DATADIRECT_ORACLE
The DataDirect Connect Oracle jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_DATADIRECT_SYBASE

public static final String JDBC_DRIVER_DATADIRECT_SYBASE
The DataDirect Connect Sybase jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_INET_DB2

public static final String JDBC_DRIVER_INET_DB2
The i-net DB2 jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_INET_ORACLE

public static final String JDBC_DRIVER_INET_ORACLE
The i-net Oracle jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_INET_SQLSERVER

public static final String JDBC_DRIVER_INET_SQLSERVER
The i-net SQLServer jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_INET_SYBASE

public static final String JDBC_DRIVER_INET_SYBASE
The i-net Sybase jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_INET_POOLED

public static final String JDBC_DRIVER_INET_POOLED
The i-net pooled jdbc driver for SQLServer and Sybase.

See Also:
Constant Field Values

JDBC_DRIVER_JSQLCONNECT_SQLSERVER

public static final String JDBC_DRIVER_JSQLCONNECT_SQLSERVER
The JNetDirect SQLServer jdbc driver.

See Also:
Constant Field Values

JDBC_DRIVER_JTDS

public static final String JDBC_DRIVER_JTDS
The jTDS jdbc driver for SQLServer and Sybase.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_DATADIRECT_DB2

public static final String JDBC_SUBPROTOCOL_DATADIRECT_DB2
The subprotocol used by the DataDirect DB2 driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_DATADIRECT_SQLSERVER

public static final String JDBC_SUBPROTOCOL_DATADIRECT_SQLSERVER
The subprotocol used by the DataDirect SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_DATADIRECT_ORACLE

public static final String JDBC_SUBPROTOCOL_DATADIRECT_ORACLE
The subprotocol used by the DataDirect Oracle driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_DATADIRECT_SYBASE

public static final String JDBC_SUBPROTOCOL_DATADIRECT_SYBASE
The subprotocol used by the DataDirect Sybase driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_DB2

public static final String JDBC_SUBPROTOCOL_INET_DB2
The subprotocol used by the i-net DB2 driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_ORACLE

public static final String JDBC_SUBPROTOCOL_INET_ORACLE
The subprotocol used by the i-net Oracle driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER
A subprotocol used by the i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER6

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER6
A subprotocol used by the i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER7

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7
A subprotocol used by the i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER7A

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7A
A subprotocol used by the i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER_POOLED_1

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER_POOLED_1
A subprotocol used by the pooled i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER6_POOLED_1

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER6_POOLED_1
A subprotocol used by the pooled i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER7_POOLED_1

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7_POOLED_1
A subprotocol used by the pooled i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER7A_POOLED_1

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7A_POOLED_1
A subprotocol used by the pooled i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER_POOLED_2

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER_POOLED_2
A subprotocol used by the pooled i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER6_POOLED_2

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER6_POOLED_2
A subprotocol used by the pooled i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER7_POOLED_2

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7_POOLED_2
A subprotocol used by the pooled i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SQLSERVER7A_POOLED_2

public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7A_POOLED_2
A subprotocol used by the pooled i-net SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SYBASE

public static final String JDBC_SUBPROTOCOL_INET_SYBASE
The subprotocol used by the i-net Sybase driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SYBASE_POOLED_1

public static final String JDBC_SUBPROTOCOL_INET_SYBASE_POOLED_1
The subprotocol used by the pooled i-net Sybase driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_INET_SYBASE_POOLED_2

public static final String JDBC_SUBPROTOCOL_INET_SYBASE_POOLED_2
The subprotocol used by the pooled i-net Sybase driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_JSQLCONNECT_SQLSERVER

public static final String JDBC_SUBPROTOCOL_JSQLCONNECT_SQLSERVER
The subprotocol used by the JNetDirect SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_JTDS_SQLSERVER

public static final String JDBC_SUBPROTOCOL_JTDS_SQLSERVER
The subprotocol used by the jTDS SQLServer driver.

See Also:
Constant Field Values

JDBC_SUBPROTOCOL_JTDS_SYBASE

public static final String JDBC_SUBPROTOCOL_JTDS_SYBASE
The subprotocol used by the jTDS Sybase driver.

See Also:
Constant Field Values
Constructor Detail

PlatformUtils

public PlatformUtils()
Creates a new instance.

Method Detail

determineDatabaseType

public String determineDatabaseType(DataSource dataSource)
                             throws DatabaseOperationException
Tries to determine the database type for the given data source. Note that this will establish a connection to the database.

Parameters:
dataSource - The data source
Returns:
The database type or null if the database type couldn't be determined
Throws:
DatabaseOperationException

determineDatabaseType

public String determineDatabaseType(DataSource dataSource,
                                    String username,
                                    String password)
                             throws DatabaseOperationException
Tries to determine the database type for the given data source. Note that this will establish a connection to the database.

Parameters:
dataSource - The data source
username - The user name to use for connecting to the database
password - The password to use for connecting to the database
Returns:
The database type or null if the database type couldn't be determined
Throws:
DatabaseOperationException

determineDatabaseType

public String determineDatabaseType(String driverName,
                                    String jdbcConnectionUrl)
Tries to determine the database type for the given jdbc driver and connection url.

Parameters:
driverName - The fully qualified name of the JDBC driver
jdbcConnectionUrl - The connection url
Returns:
The database type or null if the database type couldn't be determined


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.