Hi,
i am trying to connect the grid with with my database using the connector and dataprocessor,
i include the connector.jar file and the grid retrieves the data from the database but the changes made in the grid are not updated in the database.
please help me
my code as below
DatabaseConn.java servlet
import com.dhtmlx.connector.ConnectorServlet;
import com.dhtmlx.connector.GridConnector;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
- Servlet implementation class DatabaseConn
/
public class DatabaseConn extends ConnectorServlet implements Servlet {
private static final long serialVersionUID = 1L;
public GridConnector conn;
public Connection connection=null;
/* -
@see ConnectorServlet#ConnectorServlet()
*/
public DatabaseConn() {
super();
}
@Override
protected void configure() {
try {
Class.forName (“org.h2.Driver”).newInstance ();
connection = DriverManager.getConnection(“jdbc:h2:~/test”, “sa”, “”);
} catch (Throwable e) {
e.printStackTrace();
}
conn = new GridConnector(connection);
conn.enable_log(“./log.txt”,true);
conn.render_table(“test”, “ID”, “ID,NAME”);
}
}
connect.jsp
Insert title here