Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Microsoft JDBC Driver Connection Problem

 
ravitadakamalla
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Microsoft JDBC Driver for connecting to SQL Server database. My connection always goes to Default database set in the SQL Server for the current user ('sa'). Can anyone please suggest me how to use a DSN with Microsoft JDBC Driver for connecting to SQL Server.
Thanks
RaviTadakamalla
 
Hrithik Roshan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ravitadakamalla:
Hi,
I am using Microsoft JDBC Driver for connecting to SQL Server database. My connection always goes to Default database set in the SQL Server for the current user ('sa'). Can anyone please suggest me how to use a DSN with Microsoft JDBC Driver for connecting to SQL Server.
Thanks
RaviTadakamalla

hi,
basically it depends on the which Driver u are trying to use
and which dsn u r tyin to connect!
double check++;
use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
and create a dsn using the default MS ODBC
name it for example as Northwind;
then ur code is like
DriverManager.getConnection("jdbcdbc:Northwind", user, password ");
hope this works!!!
watch my new movie K3G
Thanx


------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic