We plan to release the update version of java connector in next two weeks.
If you want to try the dhtmlxGantt with java, you can download the beta version of java connector ( jar is attached to the post )
To have a working Gantt, please follow the tutorial
docs.dhtmlx.com/gantt/desktop__how_to_start.html
In steps 6 and 7, use “/data” as url for data loading and data saving.
And instead of data.php - you need to create a servlet file with code, similar to next
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 = "JSONDataServlet", urlPatterns = {"/data"})
public class JsonGanttDataServlet extends ThreadSafeConnectorServlet{
@Override
protected void configure(HttpServletRequest req, HttpServletResponse res) {
Connection conn=null;
try {
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection("jdbc:mysql://192.168.3.251/sampleDB", "sampleDB", "sampleDB");
} catch (Throwable e) {
e.printStackTrace();
}
JSONGanttConnector gantt = new JSONGanttConnector(conn, DBType.MySQL);
gantt.servlet(req, res);
gantt.mix("open", "1");
//gantt.enable_order("sortorder");
gantt.render_links("gantt_links", "id", "source,target,type");
gantt.render_table("gantt_tasks", "id", "start_date,duration,text,progress,parent");
}
}
As you can see it creates and inits a JSONGanttConnector, similar to the php code in the tutorial.
connector.java.beta.zip (302 KB)