• Post Reply Bookmark Topic Watch Topic
  • New Topic

use multiple driver classes in tomcat xml file  RSS feed

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm new to tomcat and i want to use multiple drivers in server.xml.

I 'm using tomcat5.5.
I'm migrating code to use datasource using tomcat.
How can i use it?

<Resource
name="testDB"
type="javax.sql.DataSource"
password="pwd"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver:net.x.y.xxxxDriver"
-----
Thanks In advance
>
 
sushi sri
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i feel we can't do this.

If any body have solution, please do post it.

Thanks
sushi
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What prevents you from putting multiple <Resource> elements into the file?
 
sushi sri
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm getting this error
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver,net.sf.log4jdbc.DriverSpy'
when i add another class like below
<Resource
name="abcd"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver;net.sf.log4jdbc.DriverSpy"
password="pwd"
maxIdle="30"
maxWait="10000"
username="usr"
url="jdbc:sqlserver://1.2.3.4:1433"
maxActive="100"/>
 
Bartender
Posts: 19204
85
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't normally specify a "driver class", you define a database connection pool. And unless you intend to use the same pool in all webapps, you shouldn't define it in server.xml, you should define it in an application's Context definition.
 
sushi sri
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my project i'm using same pool for all webapps only.
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!