

JDBC Drivers › Code Generation › How to Configure the Target Environment › DriverManager Method
DriverManager Method
This method is simple to set up. However, it does not allow for two-phase commits, Application Server connection pooling, or participating in Java Transaction Architecture (JTA) transactions. To use the DriverManager approach in Java applications, the following steps must be performed to set up the Application Server machine:
- The JDBC driver location (directory or jar file) must be loadable by the Application Server's Class Loader. This can be through an Application Server setting, copying the drivers to a specific location, or modifying the Classpath. See your Application Server documentation for details.
- The jdbccfg.properties file (installed in the CA Gen directory) must be loadable by the Application Server's Class Loader. This can be through an Application Server setting, copying the drivers to a specific location, or modifying the Classpath. See your Application Server documentation for details. The jdbccfg.properties file must be modified to provide additional configuration information to the runtime.
For each DBMS to be accessed from all applications running under the Application Server, some configuration properties should be added. Each property name is created using the database name, as the CA Gen Model understands it. This name may not be the name of the actual physical database, but is treated more as a logical database name to the application.
Any of the following four tokens in the jdbccfg.properties file may be specified for each logical database (where xxxxx represents the logical database name):
- (Required) xxxxx_driverManager—Classname of the JDBC driver to be used.
- (Required) xxxxx_dataSource—Datasource or URL name of the database to connect to.
- (Optional) xxxxx_userId—User ID to be used for connection.
- (Optional) xxxxx_password—Password to be used for connection.
The following are some examples using a database named GENDB and an Oracle driver:
- GENDB_driverManager—oracle.jdbc.driver.OracleDriver
- GENDB_dataSource—jdbc:oracle:thin:@host:1521:ORCL
- GENDB_userId—scott
- GENDB_password—tiger
Copyright © 2013 CA.
All rights reserved.
 
|
|