alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Commons DBCP example source code file (README.txt)

This example Commons DBCP source code file (README.txt) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Commons DBCP tags/keywords

dbcp, dbcp, for, if, jdbc, jocl, jocl, look, look, poolingdriver, provides, provides, see, the

The Commons DBCP README.txt source code

===================================================================================

Before running these examples make sure you have registered the database
driver you want to use. If you don't you will get the following error:
"org.apache.commons.dbcp.DbcpException: java.sql.SQLException: No suitable driver"

The DriverManager class will attempt to load the driver classes referenced 
in the "jdbc.drivers" system property. For example you might specify

-Djdbc.drivers=foo.bah.Driver:wombat.sql.Driver:bad.taste.ourDriver

as command line argument to the java VM.

A program can also explicitly load JDBC drivers at any time. For
example, the my.sql.Driver is loaded with the following statement:

 Class.forName("my.sql.Driver");

===================================================================================

ManualPoolingDriverExample.java

 Provides a simple example of how to use the DBCP package with a
 manually configured PoolingDriver.

 Look at the comments with that file for instructions on how to
 build and run it.

ManualPoolingDataSource.java

 Provides a simple example of how to use the DBCP package with a
 manually configured PoolingDataSource.

 Look at the comments with that file for instructions on how to
 build and run it.

JOCLPoolingDriverExample.java
poolingDriverExample.jocl.sample

 Provides an example JOCL configuration and JDBC client that
 shows how to use the DBCP PoolingDriver with an external
 configuration. (JOCL will be replaced by Digester when it
 is available in jakarta-commons.)

 Look at the comments with those files for instructions on how to
 build and run it.

See also the JavaDoc documentation (use "ant doc" to generate it),
especially the package documentation for org.apache.commons.dbcp
for an overview of how it all works.

The test cases (the source files whose names start with "Test")
provide some additional examples.

Other Commons DBCP examples (source code examples)

Here is a short list of links related to this Commons DBCP README.txt source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.