O'Reilly logo

Java™ Performance and Scalability, Volume 1: Server-Side Programming Techniques by Dov Bulka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Caching JDBC Connections

CacheDriver.java

 package COM.ibm.jdbc.cache; import java.lang.*; import java.sql.*; import java.util.*; import java.io.*; public class CacheDriver implements java.sql.Driver { private static CacheDriver ourDriver; private Properties p; static { ourDriver = new CacheDriver(); /*BEGIN REMOVE THIS CODE AND INITIALIZE CONFIG VARIABLES IF YOU WANT*/ try { ourDriver.init(); } catch (IOException e) { if (null!=DriverManager.getLogStream()) { DriverManager.println("Error Reading CacheDriver + "properties: "+e); e.printStackTrace(DriverManager.getLogStream()); } System.err.println("Error Reading CacheDriver properties: "+e); e.printStackTrace(System.err); } /*END REMOVE*/ try { java.sql.DriverManager.registerDriver(ourDriver); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required