Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resultset for insert into MSSQLServer database

Status
Not open for further replies.

georgizas

Programmer
Sep 13, 2001
15
GR
Hi friends
I try to use a resultset in order to inser a row to a sqlserver database table (my connection based on JDBC ODBC driver) from a JSP page but i take an interval server error:
at sun.jdbc.odbc.JdbcOdbcResultSet.bindCol(JdbcOdbcResultSet.java:4506)
at sun.jdbc.odbc.JdbcOdbcResultSet.insertRow(JdbcOdbcResultSet.java:3962)
My code is:
Statement Stmt = Conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
String SQL="SELECT TOP 1 * FROM com_book_series";
ResultSet RS = Stmt.executeQuery(SQL);
RS.moveToInsertRow();
Integer age=new Integer(upload.getParameter("age"));
int age_id=age.intValue();
RS.updateInt("id");
RS.updateNull("series_name");
RS.updateInt("age_id",age_id);
RS.updateNull("image_type");
RS.updateNull("num_of_pages");
RS.updateNull("dimensions");
RS.updateNull("age_range");
RS.updateNull("series_descr");
RS.insertRow();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top