wood burning stoves 2.0*
The moose likes Servlets and the fly likes how to connect servlet with mssql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to connect servlet with mssql" Watch "how to connect servlet with mssql" New topic

how to connect servlet with mssql

ray bond
Ranch Hand

Joined: Oct 11, 2000
Posts: 111
hello there ,
I have serverlet jdbc application , which communicates with mysql database , now I have to use mssql instead of mysql , my servelets will be on "serverapplication" and mssql database is running on
"serversql" , it means to entirely different pysical server systems ,
before that mysql and servlets were on same server "serverapplication" , and below is how i did,
-- Class.forName("org.gjt.mm.mysql.Driver");
-- DriverManager.getConnection("jdbc:mysql://localhost/mydb");
now can anybody guide me that how can i access mssql database which is on different server , and what should i write ,
for "Class.forName(...." and for "DriverMgr.getCon(....",
waiting for urgent reply
prashant sreenivasan

Joined: Nov 19, 2000
Posts: 6
Use the Code
Connection con = DriverManager.getConnection("jdbc dbc:your_dsn");

This will solve ur problem
[This message has been edited by prashant sreenivasan (edited April 24, 2001).]
David Freels
Ranch Hand

Joined: Feb 01, 2001
Posts: 102
See my reply here:
Sun Certified Programmer for the Java2 Platform
wood burning stoves
subject: how to connect servlet with mssql
Similar Threads
connection string
Synchronize two databases (MS SQL 2005)
HELP - MultiDatabase using JBOSS
how to connect with mssql
I need some guidens for a project