Question

I'm getting the following error :

Exception in thread "main" java.sql.SQLException:
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
    at oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:3224)  

and this is pointing to the following line of Code :

ResultSet resultSet = getConnection().createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT ).executeQuery(Request.getEtat());  

This is mostly because of some unsupported feature in my environment, so what is the problem exactly with my snippet of code ?
Thank you very much for help.

Was it helpful?

Solution

ResultSet.HOLD_CURSORS_OVER_COMMIT is only supported with Oracle 10g 10.2.0 and higher with the Oracle JDBC driver 10.2.0 or higher. See http://docs.oracle.com/cd/E11882_01/java.112/e16548/overvw.htm#JJDBC28045 :

Feature | Server-Side Internal | JDBC OCI | JDBC Thin
...
JDBC 3.0 Holdable Cursors | 10.2.0 | 10.2.0 | 10.2.0

As you indicate you are using Oracle 9i, the feature doesn't work and an exception is thrown. And as the exception is SQLException and not SQLFeatureNotSupportedException, I assume you are using an old driver as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top