[Logo]
Forums Register Login
Connecting with SQL 2000
I want to connect to SQL 2000 database, I tried it with -
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
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 ?
Try this:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
//establish the connection with the data source
String url = "jdbc dbc:MyDataSource";
con = DriverManager.getConnection(url, "loginName" ,"password");
>> String url = "jdbc dbc:MyDataSource";

How to code "MyDataSource"?

Thanks.
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA


This thread has been viewed 794 times.

All times above are in ranch (not your local) time.
The current ranch time is
Aug 19, 2018 21:46:31.