File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Connecting with SQL 2000 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connecting with SQL 2000" Watch "Connecting with SQL 2000" New topic

Connecting with SQL 2000

Devavrat Bagayat

Joined: Jun 24, 2001
Posts: 25
I want to connect to SQL 2000 database, I tried it with -
Connection conn=DriverManager.getConnection("jdbc dbc:A");
Statement stmt=conn1.createStatement();
but its not working.
Does anyone have the code to connect java to SQL 2000, the might be 4-5 line code ?
Patrick Mugabe
Ranch Hand

Joined: Jan 08, 2002
Posts: 132
Try this:
Connection con;
//establish the connection with the data source
String url = "jdbc dbc:MyDataSource";
con = DriverManager.getConnection(url, "loginName" ,"password");
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 672
>> String url = "jdbc dbc:MyDataSource";

How to code "MyDataSource"?


We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
I agree. Here's the link:
subject: Connecting with SQL 2000
It's not a secret anymore!