aspose file tools*
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 Java 8 in Action this week in the Java 8 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
Use MS SQL Server 2000 JDBC driver with WSAD 4.0
CachedRowSet
jdbc:odbc password definition
Sun jdbc odbc bridge error
SQL Exception Connection is busy with results for another hstmt.