You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2003/11/10 15:54:33 UTC
cvs commit: jakarta-commons/dbcp/doc ManualPoolingDataSourceExample.java
dirkv 2003/11/10 06:54:33
Modified: dbcp/doc ManualPoolingDataSourceExample.java
Log:
cleanup example
Revision Changes Path
1.5 +8 -6 jakarta-commons/dbcp/doc/ManualPoolingDataSourceExample.java
Index: ManualPoolingDataSourceExample.java
===================================================================
RCS file: /home/cvs/jakarta-commons/dbcp/doc/ManualPoolingDataSourceExample.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ManualPoolingDataSourceExample.java 9 Oct 2003 21:05:29 -0000 1.4
+++ ManualPoolingDataSourceExample.java 10 Nov 2003 14:54:33 -0000 1.5
@@ -67,11 +67,10 @@
//
// Here are the dbcp-specific classes.
-// Note that they are only used in the setupDriver
+// Note that they are only used in the setupDataSource
// method. In normal use, your classes interact
// only with the standard JDBC API
//
-import java.sql.DriverManager;
import org.apache.commons.pool.ObjectPool;
import org.apache.commons.pool.impl.GenericObjectPool;
import org.apache.commons.dbcp.ConnectionFactory;
@@ -131,7 +130,11 @@
// system property.
//
System.out.println("Loading underlying JDBC driver.");
- Class.forName("oracle.jdbc.driver.OracleDriver");
+ try {
+ Class.forName("oracle.jdbc.driver.OracleDriver");
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
System.out.println("Done.");
//
@@ -147,7 +150,6 @@
//
// Now, we can use JDBC DataSource as we normally would.
//
-
Connection conn = null;
Statement stmt = null;
ResultSet rset = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org