Tomcat 5.0.28 and MS-SQL Databases

W

WJ

I realize this is a question better suited for comp.lang.java.databases.
I posted this there and received no response. I also bought a Tomcat
book but have not been able to find the answer in there either.

I am connecting Tomcat 5 to an MS-SQL database. Everything works fine.
But in order to get the pooling to work, I have to create a SQL user
and set my app's database to that user's default database. This is fine
if I only need to connect to one database.

But I'd like to use that login to connect to two databases.


In Weblogic, I am able to define the database in the Connection
Pool string, e.g. database@machinename:1433.


So I can have the same username connect to multiple databases by
defining the target database in the app server's connection pool.
Is there a way to do this in Tomcat 5?


When I configure my Data Source, I use
jdbc:microsoft:sqlserver://localhost:1433 for the
Data Source URL. There does not appear to be a place
to define the database name from the Servlet Container side.


I use com.microsoft.jdbc.sqlserver.SQLServerDriver for the JDBC Driver
Class.
 
C

Chris Smith

WJ said:
In Weblogic, I am able to define the database in the Connection
Pool string, e.g. database@machinename:1433.


So I can have the same username connect to multiple databases by
defining the target database in the app server's connection pool.
Is there a way to do this in Tomcat 5?

This has nothing to do with Tomcat. You need to look in the
documentation for your JDBC driver. A quick web search turns this up:

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top