Cannot Insert Data using Java Connector

Good Day! I’m currently developing a Scheduling Module, and the loading of data works very well! However, I cannot add activity or insert new activity to the database!



How to Start with dhtmlxGantt


import java.sql.Connection;
import java.sql.DriverManager;

import com.dhtmlx.connector.*;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(name = “JSONDataServlets”, urlPatterns = {"/data1"})
public class JsonGanttDataServlet extends ThreadSafeConnectorServlet{
protected void configure(HttpServletRequest req, HttpServletResponse res) {
Connection conn=null;
try {
Class.forName (“com.mysql.jdbc.Driver”).newInstance ();
conn = DriverManager.getConnection(“jdbc:mysql://”, “devweb”, “qwerty”);
} catch (Throwable e) {

  JSONGanttConnector gantt = new JSONGanttConnector(conn, DBType.MySQL);
  gantt.servlet(req, res);
  gantt.render_links("gantt_links", "id", "source,target,type");
  gantt.render_table("gantt_tasks", "id", "start_date,duration,text,progress,parent");


Note: if I update an activity, it works! But I cannot add an activity

okay! I already solved my own problem! You just have to make sortorder, parent and duration to not null in the database :slight_smile: