How to fix Invalid column index SQLException in Oracle ADF?

The java.sql.SQLException: Invalid column index often occurs in ADF when your ADF View Object(VO) get desynchronized while adding a new column to an existing Entity object(EO). After adding the new Table column to your Entity Object and View Object the following error occur at runtime :

java.sql.SQLException: Invalid column index
     at oracle.jdbc.driver.OracleResultSetImpl.getBytes(
     at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.getBytes(Unknown Source)
     at oracle.jbo.domain.Number$1facClass.createDatum(
     at oracle.jbo.server.OracleSQLBuilderImpl.doLoadFromResultSet(
     at oracle.jbo.server.AttributeDefImpl.loadFromResultSet(
     at oracle.jbo.server.ViewRowImpl.populate(
     at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(
     at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(
     at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(
     at oracle.jbo.server.QueryCollection.populateRow(
     at oracle.jbo.server.QueryCollection.fetch(
     at oracle.jbo.server.QueryCollection.get(
     at oracle.jbo.server.ViewRowSetImpl.getRow(
     at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(

This error usually occurs when your View Object Query didn’t get updated while you added the new Entity Object Attribute. (Usually when you customized the View Object Query in Expert Mode)

To fix it you need to do the following steps :

  • In your Entity Object > Attributes, click on the green + Add Attribute from Table. Add your new Table Column
  • In your View Object > Attributes, click on the green + Add Attributes from Entity Object. Add you new Entity Attribute
  • In your View Object > Query, manually edit your Query to add the new Entity Attribute (YOUR_EO_NAME.YOUR_ATTRIBUTE_NAME)
  • Add your new attribute to your views

The error usually occur when you forget the 3rd step.

2 thoughts on “How to fix Invalid column index SQLException in Oracle ADF?”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top