This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 6e7299e3dc Fix BZ 68436 - don't warn when driverClassName is not set
6e7299e3dc is described below

commit 6e7299e3dc8318ea7c96d16a8a07dff4b45a201b
Author: Raphael <[email protected]>
AuthorDate: Wed Oct 14 10:51:47 2026 +0200

    Fix BZ 68436 - don't warn when driverClassName is not set
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=68436
---
 .../java/org/apache/tomcat/jdbc/pool/PooledConnection.java    | 10 ++++++----
 webapps/docs/changelog.xml                                    | 11 +++++++++++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
index dfbbd121cc..b8bebf5edc 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
@@ -309,13 +309,15 @@ public class PooledConnection implements 
PooledConnectionMBean {
 
         try {
             if (driver==null) {
-                if (log.isDebugEnabled()) {
-                    log.debug("Instantiating driver using class: 
"+poolProperties.getDriverClassName()+" [url="+poolProperties.getUrl()+"]");
-                }
                 if (poolProperties.getDriverClassName()==null) {
                     //rely on DriverManager
-                    log.warn("Not loading a JDBC driver as driverClassName 
property is null.");
+                    if (log.isDebugEnabled()) {
+                        log.debug("No driverClassName is configured so the 
driver will be located by DriverManager.");
+                    }
                 } else {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Instantiating driver using class: 
"+poolProperties.getDriverClassName()+" [url="+poolProperties.getUrl()+"]");
+                    }
                     driver = (java.sql.Driver)
                         ClassLoaderUtil.loadClass(
                             poolProperties.getDriverClassName(),
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9e28b280a3..dcb8f0cd22 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -452,6 +452,17 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="jdbc-pool">
+    <changelog>
+      <fix>
+        <bug>68436</bug>: Reduce the log level from warning to debug for the
+        message logged when <code>driverClassName</code> is not set, as relying
+        on <code>DriverManager</code> to locate the driver is a valid
+        configuration. Pull request <pr>1084</pr> provided by Raphael 
Vullriede.
+        (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <update>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to