5 Replies Latest reply on May 13, 2010 10:13 PM by jschellSomeoneStoleMyAlias

    Error in row error

    656336

      The stack trace is:

      java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Error in row at sun.jdbc.odbc.JdbcOdbcResultSet.setPos(JdbcOdbcResultSet.java:5271) at sun.jdbc.odbc.JdbcOdbcResultSet.insertRow(JdbcOdbcResultSet.java:4131) at org.apache.jsp.signup_005finsert_jsp._jspService(signup_005finsert_jsp.java:101) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:619)

      I don't know why i got this error... i checked if i enter valid data into columns.. YES. i checked for Zero length allowed and Required.. it's OK. i checked for FK-s related to other tables.. there is no problem. It's about a jsp page, the code is:

      <jsp:useBean id="DB" scope="page" class="INCLUDES.DBConnection" /> <jsp:setProperty name="DB" property="*" /> <% String user_name = request.getParameter("user_name");     System.out.print(user_name); ResultSet objRs = null; String statement = ""; try { statement = "select * from x_master_elearning_user where user_name='" + user_name + "'"; DB.setStatement(statement); objRs = (ResultSet) DB.resultUpdate(); if (objRs.next()) { response.sendRedirect("signup.jsp?result=User name already exists"); } else { objRs.updateString("user_name", user_name); System.out.println(user_name); objRs.updateString("pass_word", request.getParameter("pass_word")); System.out.println(request.getParameter("pass_word")); objRs.updateString("First_name", request.getParameter("trainee_name")); objRs.updateString("Designation", request.getParameter("designation")); objRs.updateString("email", request.getParameter("email")); //objRs.updateInt("is_validated", 0); //objRs.updateString("validation_code", "xxxx"); objRs.updateString("city", request.getParameter("city")); objRs.updateString("country", request.getParameter("country")); objRs.insertRow(); response.sendRedirect("course_list_index2.jsp?result=Succesfully regsitered.Please, Login to access other features."); } } catch (Exception e) { out.print("error occured " + e); }

      Those parameters came from another page..

      And the connection class is:

      package INCLUDES; import java.io.Serializable; import java.sql.*; import java.io.*; public class DBConnection { String strStatement = ""; ResultSet rs = null; Connection conn = null; String sDBQ = "C://ELEARNING_DATASOURCE.mdb"; public void setStatement(String statement) { this.strStatement = statement; } public ResultSet result() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + sDBQ + ";DriverID=22;READONLY=false"; conn = DriverManager.getConnection( database ,"",""); Statement stat = conn.createStatement(); rs = stat.executeQuery(strStatement); } catch (Exception e) { e.printStackTrace(); } return rs; } public ResultSet resultUpdate() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + sDBQ + ";DriverID=22;READONLY=false"; conn = DriverManager.getConnection( database ,"",""); Statement stat = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); rs = stat.executeQuery(strStatement); } catch (Exception e) { e.printStackTrace(); } return rs; } public int insert() { int count = 0; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + sDBQ + ";DriverID=22;READONLY=false"; conn = DriverManager.getConnection( database ,"",""); Statement stat = conn.createStatement(); count = stat.executeUpdate(strStatement); } catch (Exception e) { e.printStackTrace(); } return count; } public void closeConn() { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } } }

      What i'm doing wrong? i wanna be able to insert/update rows in that database... but i cannot, i got 'Error in row'.

      Please help

      Thanks!

      Edited by: Talkabout on May 13, 2010 11:17 AM