• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception when I use moveTo InsertRow

 
leire_etxeberria
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I�m working with an Access bd and
the driver "sun.jdbc.odbc.JdbcOdbcDriver"
and when I try to insert a row using
result.moveToInsertRow() gives an
exception:
java.lang.ArrayIndexOutOfBoundsException

I have not problems with others things of
JDBC 2.0 API.
I don't know if it's a problem of the
access bd that doesn't let do that,
how can I know if it's posible to
use moveToInsertRow with Access.
Thanks and Sorry, my English is very bad.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be helpful to post the offending code (the statement, and resultset lifespan). It may help shed a little more light on the problem.
Jamie
 
leire_etxeberria
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc dbc:alumnos");
stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
result = stmt.executeQuery("select * from alumnos");

...

result.moveToInsertRow(); //Here it gives the exeption
result.updateInt("IDAL",Integer.valueOf(txtIdal.getText()).intValue());
result.updateString("NOMBRE",txtNombre.getText() );
result.updateString("PRIMER_APELLIDO",txtApel1.getText() );
result.updateString("SEGUNDO_APELLIDO",txtApel2.getText() );
result.insertRow();
result.moveToCurrentRow();
...
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic