El conjunto de resultados no está abierto. Verifique que la confirmación automática esté desactivada. Apache Debry

Estoy usando apache derby para mi base de datos. Puedo realizar inserciones en la base de datos. Lo siguiente es el extracto del código que intenta mostrar el contenido de mi única tabla 'MAINTAB'. La instancia de java.sql.Connection es 'dbconn'.

    ResultSet word;

    Statement query;

    String getData="SELECT THEWORD FROM MAINTAB";
    try{
        System.out.println(dbconn.getAutoCommit());
        query = dbconn.createStatement();
        word = query.executeQuery(getData);
        query.close();

        dbconn.setAutoCommit(false);
        System.out.println(dbconn.getAutoCommit());

        for(;word.next();)
            System.out.println(word.getString(1));

    }catch(Throwable e){
        System.out.println("Table fetch failed or result data failed");}

Y el siguiente es el resultado.

org.apache.derby.jdbc.EmbeddedDriver loaded.
Database testDB connected
true
false
Table fetch failed or result data failed

---SQLException Caught---

SQLState:   XCL16
Severity: 20000
Message:  ResultSet not open. Operation 'getString' not permitted. Verify that autocommit is OFF.
java.sql.SQLException: ResultSet not open. Operation 'getString' not permitted. Verify that autocommit is OFF.
    at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedResultSet.getString(Unknown Source)
Closed connection
    at test.ShowData.main(ShowData.java:30)
Caused by: java.sql.SQLException: ResultSet not open. Operation 'getString' not permitted. Verify that autocommit is OFF.
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(



Unknown Source)
    ... 9 more
Database shut down normally

Cuando, por primera vez, solicitó verificar si AUTOCOMMIT está APAGADO, descubrí en la documentación de Derby que AUTOCOMMIT está ENCENDIDO de manera predeterminada en cualquier conexión. Entonces, lo apagué usando dbconn.setAutoCommit (false). Aún así, se arroja el error.

El resultado antes del error explica que el conjunto de resultados se obtuvo sin ningún error. Además, tenga en cuenta que se produce el mismo error incluso si no configuro AutoCommit en falso. En el medio, estoy ejecutando derby en eclipse.

Respuestas a la pregunta(2)

Su respuesta a la pregunta