[jboss-user] [Datasource Configuration] - driver-class ignored?

Hubert Lyczek do-not-reply at jboss.com
Mon Aug 8 12:48:05 EDT 2011

Hubert Lyczek [http://community.jboss.org/people/lysy78] created the discussion

"driver-class ignored?"

To view the discussion, visit: http://community.jboss.org/message/619933#619933


My environment is:
1. Java: jdk1.6.0_23
2. AS: jboss-6.0.0.Final
3. Database: MySQL 5.1

In order to connect to database it is needed to configure data source.
I created file mysql-ds.xml, and everything was ok. 

But lately decided to use third party driver (different from original: com.mysql.jdbc.Driver), so I changed xml element driver-class. But nothing expected happened. So i decided to get the original environment and change value of driver-class element to something completely stupid: foo.bar.bla.bla.NotExistingDriver. And do you know what? - my data source was still ok. I didn't believe that. 

Then I removed mysql connector jar, and i received exception:

> java.lang.ClassNotFoundException: foo.bar.bla.bla.NotExistingDriver

Jboss did not find this class, becouse this class did and still does not exist. But after adding mysql connector jar to lib directory again, everything was ok again. Did it mean that this class was found in mysql connector jar? Strange.

This is my mysql-ds.xml:

          <new-connection-sql>select * from test</new-connection-sql>
          <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
          <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
          <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

So... the question is: 

Is the element driver-class ignored by jboss?

Could anyone explain it to me, please?

Thanks in advance

Reply to this message by going to Community

Start a new discussion in Datasource Configuration at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110808/5ffe2d2c/attachment.html 

More information about the jboss-user mailing list