Thanks Bodie!
At present i am using sun's jdbc
dbc driver.and got the connectivity.now i want to insert a new row using moveToInsertRow () method but the error is ArrayIndexOutOfBound exception.Please help.my code is
import java.sql.*;
public class jump{
public static void main(String[] args)throws SQLException,
ClassNotFoundException{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc
dbc:dsn_sample";
Connection con=DriverManager.getConnection(url,"scott","scott");
System.out.println("Connected to DB");
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs=stmt.executeQuery("SELECT * FROM ball");
System.out.println("Successfully executed the query");
rs.moveToInsertRow();
rs.updateString("name","ram");
rs.updateInt("age",38);
rs.updateString("color","black");
rs.insertRow();
rs.moveToCurrentRow();
String s,s1;
while (rs.next()) {
s=rs.getString("name");
int i=rs.getInt("age");
s1=rs.getString("color");
System.out.println("ROW="+s +" "+i+ " "+s1);
}
rs.close();
stmt.close();
con.close();
}
}