• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

exception when I use moveTo InsertRow

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic