import java.sql.*;
public class today{
public static void main(String\u005B\u005D args){
try{
String st="select * from author;";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:DSN","sa","");
Statement stmt=con.createStatement();
stmt.executeUpdate("use pubs");
ResultSet rs=stmt.executeQuery(st);
String st1=rs.getString(0);
System.out.print(st1);
}
catch(Exception e){
System.out.println(e);
}
}
}
Hey ranchar in the above code i am getting the exception as
Invalide object name 'Author'. But why all ready there is a table author in pubs. what is the cause of this exception. I think DSN is not connecting with the pubs database.
Regard
Arun