I am getting java.sql.SQLException: ORA-01410: invalid ROWID for some of the rows.

Here is my query.

"select OP.PLU_LONG PROD_ID," +
                          "OP.NEW_PRICE PRICE," +
                          "OP.REG_PRICE REGPRICE," +
                          "OP.QUANTITY_LIMIT QUANTITY_LIMIT," +
                          "OP.ON_AD_DATE AD_START_DATE,"+
                          "OP.OF_AD_DATE AD_END_DATE " +
                          "from ABC OP";
        try {
            conn = DriverManager.getConnection(dbUrl,dbUser,dbPw);
            stmt = conn.createStatement();
            rset = stmt.executeQuery(sqlSTGOP);
            // System.out.println("Entering while block");
            while (rset.next()) {
                String price = rset.getString("PRICE");
                String reg_price = rset.getString("REGPRICE");
                String prod_id = rset.getString("PROD_ID");
                int quantity_limit = rset.getInt("QUANTITY_LIMIT");
                Date ad_start_date = rset.getDate("AD_START_DATE");
                Date ad_end_date = rset.getDate("AD_END_DATE");
        } catch (SQLException sqe) {
            logger.error("**** SQLException occured while getting Special Price and Quantity Limit:"+sqe);
            error2 = sqe.toString();
            System.out.println("Problem in creating result set" + error2);
        } catch (Exception e) {
            logger.error("**** Exception occured while getting Special Price and Quantity Limit:"+e);
            error2 = e.toString();
            System.out.println("Problem in creating result set" + error2);

The error happened here only. When we restart the process, it goes away. It happens once in a while. When we get the values from resultset, then it throws an invalid rowid sqlexception.

  • sqlSTGOP is a string constant refering to above select query.
  • driver: oracle.jdbc.driver.OracleDriver
  • jdbc:oracle:thin:@a.b.c.d:1521:db
  • java version: jdk1.6
  • version of jdbc: ojdbc14_g.jar
  • dbUrl is the url of database which has this ABC table
  • dbPw is the password of that database
  • oracle: Oracle Database 10g Enterprise Edition Release

There is no PK or index on this table.

Is someone deleting rows?

There is one process which runs before this process which removes and loads the data under table ABC and when it finishes, then this process runs after that. That is why we are unable to find out, why this error is coming even the earlier process finishes its task before starting of this process.

No other process, procedure, trigger, package is using this table ABC.


go to


and download


Remove the class.forname and put the jars above on your classpath. Loose the ojdbc14.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.