This patch logs the exception from DriverManager.getConnection().  The
current code assumes (why?) that it should never happen.

For example, it may happen if there are incorrect security privileges, and
the user is not running with PHOENIX_SECURE=false.

I am resubmitting this patch because it wasn't included in the most recent
CVS update of the file, and CVS reported merge conflicts.

And I am re-re-submitting because I just discovered that if CVS says it has
trouble merging, it pays to delete the file, checkout again, and THEN
reapply the patch.  This time I have a nice clean patch with just the right
change.  :-)

        --- Noel
Index: JdbcDataSource.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-james/src/java/org/apache/james/util/mordred/JdbcDataSource.java,v
retrieving revision 1.8
diff -u -r1.8 JdbcDataSource.java
--- JdbcDataSource.java 20 Jun 2002 22:04:14 -0000      1.8
+++ JdbcDataSource.java 20 Jun 2002 23:08:51 -0000
@@ -417,7 +417,12 @@
             pool.addElement(entry);
             return entry;
         } catch(SQLException sqle) {
-            //Shouldn't ever happen, but it did, just return null.
+            // Exception from DriverManager.getConnection() - log it, and return null
+            StringWriter sout = new StringWriter();
+            PrintWriter pout = new PrintWriter(sout, true);
+            pout.println("Error creating connection: ");
+            sqle.printStackTrace(pout);
+            getLogger().error(sout.toString());
             return null;
         } finally {
             synchronized(this) {

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to