|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
See:
Description
| Class Summary | |
| Client | |
| DynamicDataSourceHelper | This class demonstrates dymamic creation, using and deletion of DataSource via Weblogic management API. |
This example shows how to dynamically create, use, and delete a data source using the WebLogic management API.
The example code in DynamicDataSourceHelper.java shows how to:
NOTE: This example relies on the source files in the examples.jdbc.pool.dynamic example. If you modify the source files in the examples.jdbc.pool.dynamic example, this example may not run.
| Additional Resources for examples.jdbc.datasource.dynamic | |
| build.xml | The Java Ant build script, which assembles and deploys required client applications for this example. |
The following sections describe how to build and run the example.
Before you run this example, you need:
NOTE: This example uses the demo database as shipped with WebLogic Server 7.0. It uses examples as the username and password to connect to the database. If you modify the database, you may need to change the username and password hard-coded in the build.xml file.
ant
Buildfile: build.xml
compile:
compile:
[echo] Compiling Dynamic Connection Pool Example
[javac] Compiling 2 source files to D:\bea\weblogic700\samples\server\stage\examples\clientclasses
all:
[echo] Compiling Dynamic DataSource Example
[javac] Compiling 2 source files to D:\bea\weblogic700\samples\server\stage\examples\clientclasses
all:
BUILD SUCCESSFUL
ant run
You can modify run target in build.xml to fit your environment and server configuration.
When you run the example, you should see the following output in the command shell:
Buildfile: build.xml
run:
[java] Creating Connection Pool...
[java] Looping through all connection pools...
[java] oraclePool
[java] demoXAPool
[java] OracleXAPool1
[java] mssqlserverPool
[java] OracleXAPool2
[java] demoPool
[java] Creating Connection Pool: dynamicDemoPool2
[java] Starting up connection pool.
[java]
[java]
[java] Creating Data Source...
[java] Starting up DataSource
[java] Getting Connection...
[java] Deleting Data Source...
BUILD SUCCESSFUL
Total time: 7 seconds
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||