I’ve been working on this for hours but couldn’t get loading data through connector to work - I am using Java and Microsoft SQL Server.
On client side, I simply do: mainGrid.load(“grid.data”); “grid.data” points to my connector servlet - I have verified that the servlet does get called.
Following is my definition of connector servlet, not that different from the document’s sample. I was able to verify that database connection is established (through commons logging). Also, I have “connector.js” included in my jsp. In the connector log file, the error message is:
Error during data selecting
Invalid SQL: SELECT id,email,first_name,last_name FROM customers
The requested operation is not supported on forward only result sets.
Seems that’s a harmless query - is there a way for me to indicate that I want scrollable result sets? Or it’s probably some other method that can help? Thanks!
package springapp.service;
import java.sql.Connection;
import java.sql.DriverManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.dhtmlx.connector.*;
public class CustomersConnector extends ConnectorServlet {
protected final Log logger = LogFactory.getLog(getClass());
@Override
protected void configure() {
//obtain DB connection
Connection conn=null;
try {
Class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance ();
//DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
conn = DriverManager.getConnection("jdbc:sqlserver://localhost\\SQLEXPRESS;databaseName=HibernateDev;","sa","1234");
logger.info("Got here - the connector is connected to the database !!!!!!!!");
} catch (Throwable e) {
e.printStackTrace();
}
logger.info("Got here inside the CustomersConnector servlet!!!!!!!!");
//Initialize connector
GridConnector gc = new GridConnector(conn);
gc.enable_log("gridconn.log", false);
//configure used table and fields
gc.render_table("customers", "id", "first_name,last_name,email");
}
}