*
The moose likes JDBC and the fly likes Find difficulty in connecting to sqlserver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Find difficulty in connecting to sqlserver" Watch "Find difficulty in connecting to sqlserver" New topic
Author

Find difficulty in connecting to sqlserver

rejieve alexander
Greenhorn

Joined: Dec 10, 2000
Posts: 22
Hi,
I'm kind of new to jdbc. And i'm facing a problem while making a connection with the sql server ie: to give a proper url.
When trying with ms-access i gave it as Connection con = DriverManger.getConnection("jdbcdbc:servData");where 'servData' is the dsn,and it works... but the same for the sqlserver it doesn't.Please help me in finding out the correct url for the sqlserver.. it's urgetn..
Thank you



[This message has been edited by rejieve alexander (edited October 18, 2001).]
kim jungil
Greenhorn

Joined: Sep 27, 2001
Posts: 27
did you configure your dsn? and when you create the connection the dsn is correct?
rejieve alexander
Greenhorn

Joined: Dec 10, 2000
Posts: 22
Hi kim,
This is my code
String url = "jdbc dbc:servData";
Connection con;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(url);
/*
where 'servData' is the dsn created for the sql server.
But the connection just isn't taking place..

*/
 
Don't get me started about those stupid light bulbs.
 
subject: Find difficulty in connecting to sqlserver
 
Similar Threads
J2ee application and JNDI in a Servlet
problem in connecting sql 2005
NoSuchEntityException with change of jdbc driver
JDBC Drivers
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing.