Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes Microsoft JDBC Driver Connection Problem 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 "Microsoft JDBC Driver Connection Problem" Watch "Microsoft JDBC Driver Connection Problem" New topic
Author

Microsoft JDBC Driver Connection Problem

ravitadakamalla
Greenhorn

Joined: Sep 27, 2001
Posts: 4
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

Joined: Dec 12, 2001
Posts: 23
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


------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Microsoft JDBC Driver Connection Problem
 
Similar Threads
jdbc:odbc password definition
SQL Exception Connection is busy with results for another hstmt.
CachedRowSet
Sun jdbc odbc bridge error
Use MS SQL Server 2000 JDBC driver with WSAD 4.0