hello there , I have two systems server(winnt) and desktop(win98), MS SQL database is on server and it has "Bookmark " database , I have created
jdbc application to get rows from that database , on my desktop system I have configured ODBC datasource
and connected "bookmarkdb" data source with "Bookmark" database on server and also tested connection , it is OK ,
but when I run my jdbc application on my desktop system , on console window it just print out "jdbc.odbc.JdbcOdbcDriver" and nothing else , code of application is below , please can somebody tell me what should I do so I can get this application working and it prints qurery results , is there any thing wrong with driver ,I have tried same process with MS access database as well , but still on console it prints "jdbc.odbc.JdbcOdbcDriver" , do I have to use other driver for MS SQL , if so then which driver, thank you
import java.sql.*;
import java.io.*;
public class db
{
public static void main(
String args[])
{
String username;
String password;
String name;
String email;
try{
Class.forName("jdbc.odbc.JdbcOdbcDriver").newInstance();
Connection con = DriverManager.getConnection("jdbc.odbc.bookmarkdb","","");
System.out.println("got connection");
Statement stmt = con.createStatement();
ResultSet rst = stmt.executeQuery("SELECT * FROM information");
while(rst.next())
{
username = rst.getString(1);
System.out.println(username);
password = rst.getString(2);
System.out.println(password);
name = rst.getString(3);
System.out.println(name);
email = rst.getString(4);
System.out.println(email);
}
con.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
[This message has been edited by ray bond (edited December 21, 2000).]