[Idrs-commit] CVS: Idrs/dev/net/sourceforge/idrs/jdbc JDBCPool.java,1.3,1.4
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:27
|
Update of /cvsroot/idrs/Idrs/dev/net/sourceforge/idrs/jdbc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/net/sourceforge/idrs/jdbc Modified Files: JDBCPool.java Log Message: Added log4j support. cleaned up the logs Index: JDBCPool.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/net/sourceforge/idrs/jdbc/JDBCPool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JDBCPool.java 3 Dec 2000 17:42:23 -0000 1.3 --- JDBCPool.java 30 Aug 2004 00:56:09 -0000 1.4 *************** *** 28,31 **** --- 28,34 ---- import java.util.*; import java.io.*; + + import org.apache.log4j.Logger; + import net.sourceforge.idrs.utils.pool.*; //import JDBCInfo; *************** *** 35,39 **** */ public class JDBCPool extends ObjectPool { ! protected JDBCInfo info; /*removed Marc Boorshtein - 8/31/00 --- 38,42 ---- */ public class JDBCPool extends ObjectPool { ! static Logger logger = Logger.getLogger(JDBCPool.class.getName()); protected JDBCInfo info; /*removed Marc Boorshtein - 8/31/00 *************** *** 79,86 **** protected void logHeader() throws Exception { if (this.info == null) { ! System.out.println("No INFO!"); } ! if (out == null) ! out = System.out; out.println("Starting Poolman, IDRS Version"); out.println("dbDriver = " + this.info.getDrivername()); --- 82,89 ---- protected void logHeader() throws Exception { if (this.info == null) { ! logger.error("No configuration information"); } ! asd ! out.println("Starting Poolman, IDRS Version"); out.println("dbDriver = " + this.info.getDrivername()); *************** *** 132,136 **** java.util.Date now = new java.util.Date(System.currentTimeMillis()); ! out.println(now.toString() + " Opening connection " + count + " " + con.toString()); /* OLD CODE Class.forName(info.getDrivername()).newInstance(); --- 135,139 ---- java.util.Date now = new java.util.Date(System.currentTimeMillis()); ! if (logger.isDebugEnabled) logger.debug(now.toString() + " Opening connection " + count + " " + con.toString()); /* OLD CODE Class.forName(info.getDrivername()).newInstance(); *************** *** 148,153 **** } catch (ClassNotFoundException cnfex) { ! out.println("Looks like the driver was not found..."); ! out.println("Be sure it is in your CLASSPATH and listed properly in the properties file."); } catch (SQLException sqlex) { --- 151,156 ---- } catch (ClassNotFoundException cnfex) { ! logger.error("Looks like the driver was not found..."); ! logger.error("Be sure it is in your CLASSPATH and listed properly in the properties file."); } catch (SQLException sqlex) { *************** *** 156,171 **** info.getUrl() + ". Please check your username, password " + "and other connectivity info.");*/ ! out.println(sqlex); } catch(RuntimeException e) { ! out.println(e); //e.printStackTrace(); } catch(Exception e) { ! out.println(e); ! //e.printStackTrace(); } catch(Throwable t) { ! out.println(t); //t.printStackTrace(); } --- 159,173 ---- info.getUrl() + ". Please check your username, password " + "and other connectivity info.");*/ ! logger.error("Error in creating the connection",sqlex); } catch(RuntimeException e) { ! logger.error("Error in creating the connection",e); //e.printStackTrace(); } catch(Exception e) { ! logger.error("Error in creating the connection",e); } catch(Throwable t) { ! logger.error("Error in creating the connection",t); //t.printStackTrace(); } |