I keep getting the following exception
com.dhtmlx.connector.ConnectorOperationException: Invalid SQL:
Invalid operation for forward only resultset : first
at com.dhtmlx.connector.DBDataWrapper.query(DBDataWrapper.java:364)
at com.dhtmlx.connector.DBDataWrapper.select(DBDataWrapper.java:214)
at com.dhtmlx.connector.BaseConnector.render(BaseConnector.java:308)
In the DBDataWrapper class we have
protected Statement getStatement() throws SQLException{
return this.get_connection().createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
}
which creates a forward only cursor. but in the query it calls r.first() which in my understanding is not valid for a forward only resultset type.
copied all contents(java files) of “java\sources” in project directory as part of java files.
made changes in file “com.dhtmlx.connector.DBDataWrapper” java file.
changes shown below:
protected Statement getStatement() throws SQLException{
//return this.get_connection().createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
return this.get_connection().createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
}
5. after that, compiled all sources again along with java files of dhtmlx connector java files.
After this I deployed sample shown in dhtmlx documentations and were successfully able to run the code.