background image
<< Connecting to the Database via JDBC | Custom Query Statement >>
<< Connecting to the Database via JDBC | Custom Query Statement >>

JDBC Driver

74
Chapter 3 - Testing Enterprise JavaBeans
JDBC Driver
The JDBC Driver text is the fully qualified class name of the Java JDBC driver class
that was written for the specific DBMS that you would like to connect to. The
following table lists some examples of JDBC Driver text for some common
environments:
JDBC URL
The JDBC URL provides a way of identifying a database to the driver. The standard
syntax for JDBC URLs is as follows:
jdbc:<subprotocol>:<subname>
The three parts of a JDBC URL are broken down as follows:
The following table lists some examples of JDBC URLs for some common
environments:
Environment
JDBC Driver Text
WebSphere/DB2
COM.ibm.db2.jdbc.app.DB2Driver
WebLogic/SQL Server
weblogic.jdbc.mssqlserver4.Driver
WebLogic/CloudScape
COM.cloudscape.core.RmiJdbcDriver
Any ODBC data source
sun.jdbc.odbc.JdbcOdbcDriver
Part of URL
Description
jdbc
The jdbc protocol. The protocol is always jdbc.
subprotocol
Contains the name of the driver or the name of a database connectivity
mechanism, which may be supported by one or more drivers. A prominent
example of a subprotocol name is "odbc", which has been reserved for
URLs that specify ODBC-style data source names.
subname
Used to identify the database. The subname can vary, depending on the
subprotocol, and it can have a subsubname with any internal syntax that
the driver writer chooses.
Environment
JDBC Driver Text
WebSphere/DB2
jdbc:db2:BANKACCT
WebLogic/SQL Server
jdbc:weblogic:mssqlserver4:CQSMV