• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Find difficulty in connecting to sqlserver

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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("jdbc:odbc: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).]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you configure your dsn? and when you create the connection the dsn is correct?
 
rejieve alexander
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..

*/
 
reply
    Bookmark Topic Watch Topic
  • New Topic