This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new fe0b1e8731 Fix BZ 68436 - don't warn when driverClassName is not set
fe0b1e8731 is described below
commit fe0b1e8731479b8f31249c3434a99f33cc84f5ae
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 | 6 ++++++
2 files changed, 12 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 4967d6c696..1bce6d72cd 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 5ccf78ff48..c64098d9d0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -740,6 +740,12 @@
<subsection name="jdbc-pool">
<changelog>
<!-- Entries for backport and removal before 12.0.0-M1 below this line
-->
+ <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.
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]