JDBC ODBC to ms access problem
Hi , everyone out there , this is preeti , i have problem with jdbc odbc to access ms access i have tried the program with creating DSN name and a table in the access if you see my program below you may get some idea what mistakes i made
import java.sql.*;
class Kokku{
public static void main(String[]args){
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String dataSourceName="ashwin";
String dbURL="jdbc:odbc:"+dataSourceName;
Connection con =DriverManager.getConnection(dbURL,"","");
Statement s = con.createStatement();
s.execute("select column_1 from bd1");
if(rs!=null)
while(rs.next())
{
System.out.println("Data from column_1 :"+rs.getString(1));
}
s.close();
con.close();
}
catch(Exception e ){
System.out.println("ERROR :"+err);
}
}
i have wasted a lot of time for this one can any one help me out
thanks for the pain
preeti
|