|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.metadata.JdbcMetadataUtils
public class JdbcMetadataUtils
This class provides some utility functions to OJB for working with JDBC metadata.
Field Summary | |
---|---|
static String |
DRIVER_DB2
The standard DB2 jdbc driver |
static String |
DRIVER_DB2_INET
The i-net DB2 jdbc driver |
static String |
DRIVER_FIREBIRD
The standard Firebird jdbc driver |
static String |
DRIVER_HSQLDB
The standard Hsqldb jdbc driver |
static String |
DRIVER_INET_POOLED
The i-net pooled jdbc driver for SQLServer and Sybase |
static String |
DRIVER_INFORMIX
The standard Informix jdbc driver |
static String |
DRIVER_JTDS
The jTDS jdbc driver for SQLServer and Sybase |
static String |
DRIVER_MAXDB
The standard MaxDB jdbc driver |
static String |
DRIVER_MCKOI
The standard McKoi jdbc driver |
static String |
DRIVER_MSSQLSERVER
The standard SQLServer jdbc driver |
static String |
DRIVER_MSSQLSERVER_INET
The i-net SQLServer jdbc driver |
static String |
DRIVER_MSSQLSERVER_JSQLCONNECT
The JNetDirect SQLServer jdbc driver |
static String |
DRIVER_MYSQL
The standard MySQL jdbc driver |
static String |
DRIVER_MYSQL_OLD
The old MySQL jdbc driver |
static String |
DRIVER_ORACLE
The standard Oracle jdbc driver |
static String |
DRIVER_ORACLE_INET
The i-net Oracle jdbc driver |
static String |
DRIVER_POSTGRESQL
The standard PostgreSQL jdbc driver |
static String |
DRIVER_SAPDB
The standard Sapdb jdbc driver |
static String |
DRIVER_SYBASE
The standard Sybase jdbc driver |
static String |
DRIVER_SYBASE_INET
The i-net Sybase jdbc driver |
static String |
DRIVER_SYBASE_OLD
The old Sybase jdbc driver |
private HashMap |
jdbcDriverToPlatform
Maps the jdbc driver name to a OJB platform name |
private HashMap |
jdbcSubProtocolToPlatform
Maps the sub-protocl part of a jdbc connection url to a OJB platform name |
static String |
PLATFORM_DB2
Identifier for the DB2 platform |
static String |
PLATFORM_FIREBIRD
Identifier for the Firebird platform |
static String |
PLATFORM_HSQLDB
Identifier for the Hsqldb platform |
static String |
PLATFORM_INFORMIX
Identifier for the Informix platform |
static String |
PLATFORM_MAXDB
Identifier for the MaxDB platform |
static String |
PLATFORM_MCKOI
Identifier for the McKoi platform |
static String |
PLATFORM_MSACCESS
Identifier for the MsAccess platform |
static String |
PLATFORM_MSSQLSERVER
Identifier for the Microsoft SQL Server platform |
static String |
PLATFORM_MYSQL
Identifier for the MySQL platform |
static String |
PLATFORM_ORACLE
Identifier for the generic Oracle platform |
static String |
PLATFORM_ORACLE9I
Identifier for the Oracle9i platform |
static String |
PLATFORM_POSTGRESQL
Identifier for the PostgresSQL platform |
static String |
PLATFORM_SYBASE
Identifier for the generic Sybase platform |
static String |
PLATFORM_SYBASEASA
Identifier for the Sybase ASA platform |
static String |
PLATFORM_SYBASEASE
Identifier for the Sybase ASE platform |
static String |
PLATFORM_WLORACLE9I
Identifier for the Oracle9i for WebLogic platform |
static String |
PROPERTY_DBALIAS
The name of the property returned by the #splitConnectionUrl(String) method
that contains the database alias (the actual database url) |
static String |
PROPERTY_PROTOCOL
The name of the property returned by the #splitConnectionUrl(String) method
that contains the protocol |
static String |
PROPERTY_SUBPROTOCOL
The name of the property returned by the #splitConnectionUrl(String) method
that contains the sub protocol |
static String |
SUBPROTOCOL_DB2
The subprotocol used by the standard DB2 driver |
static String |
SUBPROTOCOL_DB2_INET
The subprotocol used by the i-net DB2 driver |
static String |
SUBPROTOCOL_FIREBIRD
The subprotocol used by the standard Firebird driver |
static String |
SUBPROTOCOL_HSQLDB
The subprotocol used by the standard Hsqldb driver |
static String |
SUBPROTOCOL_INFORMIX
The subprotocol used by the standard Informix driver |
static String |
SUBPROTOCOL_MAXDB
The subprotocol used by the standard MaxDB driver |
static String |
SUBPROTOCOL_MCKOI
The subprotocol used by the standard McKoi driver |
static String |
SUBPROTOCOL_MSSQLSERVER
The subprotocol used by the standard SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER_INET
A subprotocol used by the i-net SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER_INET_POOLED
A subprotocol used by the pooled i-net SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER_JSQLCONNECT
The subprotocol used by the JNetDirect SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER_JTDS
The subprotocol used by the jTDS SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER6_INET
A subprotocol used by the i-net SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER6_INET_POOLED
A subprotocol used by the pooled i-net SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER7_INET
A subprotocol used by the i-net SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER7_INET_POOLED
A subprotocol used by the pooled i-net SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER7A_INET
A subprotocol used by the i-net SQLServer driver |
static String |
SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED
A subprotocol used by the pooled i-net SQLServer driver |
static String |
SUBPROTOCOL_MYSQL
The subprotocol used by the standard MySQL driver |
static String |
SUBPROTOCOL_ORACLE
The subprotocol used by the standard Oracle driver |
static String |
SUBPROTOCOL_ORACLE_INET
The subprotocol used by the i-net Oracle driver |
static String |
SUBPROTOCOL_POSTGRESQL
The subprotocol used by the standard PostgreSQL driver |
static String |
SUBPROTOCOL_SAPDB
The subprotocol used by the standard Sapdb driver |
static String |
SUBPROTOCOL_SYBASE
The subprotocol used by the standard Sybase driver |
static String |
SUBPROTOCOL_SYBASE_INET
The subprotocol used by the i-net Sybase driver |
static String |
SUBPROTOCOL_SYBASE_INET_POOLED
The subprotocol used by the pooled i-net Sybase driver |
static String |
SUBPROTOCOL_SYBASE_JTDS
The subprotocol used by the jTDS Sybase driver |
Constructor Summary | |
---|---|
JdbcMetadataUtils()
Creates a new JdbcMetadataUtils object. |
Method Summary | |
---|---|
void |
fillJCDFromDataSource(JdbcConnectionDescriptor jcd,
DataSource dataSource,
String username,
String password)
Fills parameters of the given JdbcConnectionDescriptor with metadata
extracted from the given datasource. |
String |
findPlatformFor(String jdbcSubProtocol,
String jdbcDriver)
Derives the OJB platform to use for a database that is connected via a url using the specified subprotocol, and where the specified jdbc driver is used. |
HashMap |
parseConnectionUrl(String jdbcConnectionUrl)
Splits the given jdbc connection url into its components and puts them into a hash map using the PROPERTY_ constants. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_PROTOCOL
#splitConnectionUrl(String)
method
that contains the protocol
public static final String PROPERTY_SUBPROTOCOL
#splitConnectionUrl(String)
method
that contains the sub protocol
public static final String PROPERTY_DBALIAS
#splitConnectionUrl(String)
method
that contains the database alias (the actual database url)
public static final String PLATFORM_DB2
public static final String PLATFORM_FIREBIRD
public static final String PLATFORM_HSQLDB
public static final String PLATFORM_INFORMIX
public static final String PLATFORM_MAXDB
public static final String PLATFORM_MCKOI
public static final String PLATFORM_MSACCESS
public static final String PLATFORM_MSSQLSERVER
public static final String PLATFORM_MYSQL
public static final String PLATFORM_ORACLE
public static final String PLATFORM_ORACLE9I
public static final String PLATFORM_POSTGRESQL
public static final String PLATFORM_SYBASE
public static final String PLATFORM_SYBASEASA
public static final String PLATFORM_SYBASEASE
public static final String PLATFORM_WLORACLE9I
public static final String DRIVER_DB2
public static final String DRIVER_DB2_INET
public static final String DRIVER_FIREBIRD
public static final String DRIVER_HSQLDB
public static final String DRIVER_INET_POOLED
public static final String DRIVER_INFORMIX
public static final String DRIVER_JTDS
public static final String DRIVER_MAXDB
public static final String DRIVER_MCKOI
public static final String DRIVER_MSSQLSERVER
public static final String DRIVER_MSSQLSERVER_INET
public static final String DRIVER_MSSQLSERVER_JSQLCONNECT
public static final String DRIVER_MYSQL
public static final String DRIVER_MYSQL_OLD
public static final String DRIVER_ORACLE
public static final String DRIVER_ORACLE_INET
public static final String DRIVER_POSTGRESQL
public static final String DRIVER_SAPDB
public static final String DRIVER_SYBASE
public static final String DRIVER_SYBASE_OLD
public static final String DRIVER_SYBASE_INET
public static final String SUBPROTOCOL_DB2
public static final String SUBPROTOCOL_DB2_INET
public static final String SUBPROTOCOL_FIREBIRD
public static final String SUBPROTOCOL_HSQLDB
public static final String SUBPROTOCOL_INFORMIX
public static final String SUBPROTOCOL_MAXDB
public static final String SUBPROTOCOL_MCKOI
public static final String SUBPROTOCOL_MSSQLSERVER
public static final String SUBPROTOCOL_MSSQLSERVER_INET
public static final String SUBPROTOCOL_MSSQLSERVER6_INET
public static final String SUBPROTOCOL_MSSQLSERVER7_INET
public static final String SUBPROTOCOL_MSSQLSERVER7A_INET
public static final String SUBPROTOCOL_MSSQLSERVER_INET_POOLED
public static final String SUBPROTOCOL_MSSQLSERVER6_INET_POOLED
public static final String SUBPROTOCOL_MSSQLSERVER7_INET_POOLED
public static final String SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED
public static final String SUBPROTOCOL_MSSQLSERVER_JSQLCONNECT
public static final String SUBPROTOCOL_MSSQLSERVER_JTDS
public static final String SUBPROTOCOL_MYSQL
public static final String SUBPROTOCOL_ORACLE
public static final String SUBPROTOCOL_ORACLE_INET
public static final String SUBPROTOCOL_POSTGRESQL
public static final String SUBPROTOCOL_SAPDB
public static final String SUBPROTOCOL_SYBASE
public static final String SUBPROTOCOL_SYBASE_INET
public static final String SUBPROTOCOL_SYBASE_INET_POOLED
public static final String SUBPROTOCOL_SYBASE_JTDS
private HashMap jdbcSubProtocolToPlatform
private HashMap jdbcDriverToPlatform
Constructor Detail |
---|
public JdbcMetadataUtils()
JdbcMetadataUtils
object.
Method Detail |
---|
public void fillJCDFromDataSource(JdbcConnectionDescriptor jcd, DataSource dataSource, String username, String password) throws MetadataException
JdbcConnectionDescriptor
with metadata
extracted from the given datasource.
jcd
- The jdbc connection descriptor to filldataSource
- The data sourceusername
- The username required to establish a connection via the data source
Can be empty if the data source does not require it or if one
is specified in the jdbc connection descriptorpassword
- The username required to establish a connection via the data source
Can be empty if the data source or username does not require it or if one
is specified in the jdbc connection descriptor
MetadataException
public HashMap parseConnectionUrl(String jdbcConnectionUrl)
PROPERTY_
constants.
jdbcConnectionUrl
- The connection url
public String findPlatformFor(String jdbcSubProtocol, String jdbcDriver)
jdbcSubProtocol
- The JDBC subprotocol used to connect to the databasejdbcDriver
- The JDBC driver used to connect to the database
null
if no platform could be found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |