Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 84444 invoked from network); 25 May 2004 07:31:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 May 2004 07:31:17 -0000 Received: (qmail 74863 invoked by uid 500); 25 May 2004 07:31:53 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 74604 invoked by uid 500); 25 May 2004 07:31:51 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 77135 invoked by uid 500); 23 May 2004 16:36:54 -0000 X-Qmail-Scanner-Mail-From: brianm@apache.org via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(209.237.227.194):. Processed in 0.033515 secs) Date: 23 May 2004 16:36:53 -0000 Message-ID: <20040523163653.25099.qmail@minotaur.apache.org> From: brianm@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer ConnectionFactoryDBCPImpl.java X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N brianm 2004/05/23 09:36:53 Modified: src/java/org/apache/ojb/broker/accesslayer ConnectionFactoryDBCPImpl.java Log: Better error reporting and exception handling patch submitted by Robert Sfeir Submitted by: Robert Sfeir Revision Changes Path 1.10 +14 -4 db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java Index: ConnectionFactoryDBCPImpl.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ConnectionFactoryDBCPImpl.java 4 Apr 2004 23:53:30 -0000 1.9 +++ ConnectionFactoryDBCPImpl.java 23 May 2004 16:36:53 -0000 1.10 @@ -94,17 +94,27 @@ /** * Override this method to setup your own pool */ - protected DataSource setupPool(JdbcConnectionDescriptor jcd) throws Exception + protected DataSource setupPool(JdbcConnectionDescriptor jcd) { log.info("Create new DBCP connection pool:" + jcd); + try { ClassHelper.newInstance(jcd.getDriver()); } - catch (Exception e) + catch (InstantiationException e) { - log.error("Could not instantiate jdbc driver", e); + log.fatal("Unable to instantiate the driver class: " + jcd.getDriver() + " in ConnectionFactoryDBCImpl!" , e); } + catch (IllegalAccessException e) + { + log.fatal("IllegalAccessException while instantiating the driver class: " + jcd.getDriver() + " in ConnectionFactoryDBCImpl!" , e); + } + catch (ClassNotFoundException e) + { + log.fatal("Could not find the driver class : " + jcd.getDriver() + " in ConnectionFactoryDBCImpl!" , e); + } + // get the configuration for the connection pool GenericObjectPool.Config conf = jcd.getConnectionPoolDescriptor().getObjectPoolConfig(); --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org