hi!
i am started to connect jdbc driver with my java program..
i am using proper systax in my java program for connecting jdbc driver but i face the problem like this:
[Microsoft][ODBC Driver Manager] Invalid cursor stat..
this my java code:
try {
Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ;
Connection conn = DriverManager.g etConnection"jd bc:odbc:sample" ,"kaleeswaran", "kalees");
Statement stat = conn.createStat ement();
ResultSet res = stat.executeQue ry("Select * from customers");
ResultSetMetaDa ta d=res.getMetaDa ta();
int co=d.getColumnC ount();
while(res.next( ));
{
for(int i=1;i<=co;i++)
{
System.out.prin tln(res.getObje ct(i)+" ");
System.out.prin tln();
}
conn.close();
}
i hope i am getting immediate reply,
thank you,
i am started to connect jdbc driver with my java program..
i am using proper systax in my java program for connecting jdbc driver but i face the problem like this:
[Microsoft][ODBC Driver Manager] Invalid cursor stat..
this my java code:
try {
Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ;
Connection conn = DriverManager.g etConnection"jd bc:odbc:sample" ,"kaleeswaran", "kalees");
Statement stat = conn.createStat ement();
ResultSet res = stat.executeQue ry("Select * from customers");
ResultSetMetaDa ta d=res.getMetaDa ta();
int co=d.getColumnC ount();
while(res.next( ));
{
for(int i=1;i<=co;i++)
{
System.out.prin tln(res.getObje ct(i)+" ");
System.out.prin tln();
}
conn.close();
}
i hope i am getting immediate reply,
thank you,
Comment