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); ...
Get Java™ Performance and Scalability, Volume 1: Server-Side Programming Techniques now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.