Forward only resultset and Oracle

Hello,

I doing a simple query using the connector

@Override
protected void configure() {
//obtain DB connection
Connection conn=null;
try {
Class.forName (“oracle.jdbc.OracleDriver”).newInstance ();
conn = DriverManager.getConnection(“jdbc:oracle:thin:@111.101.254.101:1521:j”,“xxx”,“xxx”);
} catch (Throwable e) {
e.printStackTrace();
}
OptionsConnector oc = new OptionsConnector(conn);
oc.render_table(“people”, “PERSON_ID_CD”, “PERSON_ID_CD(value), PERSON_LAST_NM(label)”);

	SchedulerConnector sched = new SchedulerConnector(conn);
	sched.set_options("COMMENTS_TX_CLASS_ID_CD", oc);
	sched.render_table("CALENDAR_EVENT", "CAL_EVENT_ID_CD", "CAL_EVENT_S_DT,CAL_EVENT_E_DT,COMMENTS_TX_CLASS_ID_CD");

}

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)

Any ideas why?

Thanks

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.

Am I doing something wrong?

Hi all,

i also faced same issue.I resolved same as explained below:

  1. Downloaded “dhtmlxConnector_java_v10b_110725.zip” file
  2. extracted all contents.
  3. copied all contents(java files) of “java\sources” in project directory as part of java files.
  4. 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.

Hello everyone,
I’m having the same problem. I’m using a MSSQL-Server JDBC-driver. Is this a bug or how can we work arround this issue?

Best regards Phil

… and I’m using the dhtmlxconnector.jar for java…

thanks for your reply

Try to use the updated jar file

dhtmlx.com/x/download/regula … va_dvl.zip

Above issue was fixed in it.

Hi all,
Thank you vishalmestri, it works!