Hi ,
I am trying to retrieve the data from MSSQL database using the dhtmlxScheduler.I did take a look at the sample code
scheduler.init(‘scheduler_here’,new Date(2009,10,1),“month”);
scheduler.setLoadMode(“month”)
scheduler.load(“php/events.php”);
var dp = new dataProcessor(“php/events.php”);
dp.init(scheduler);
But this doesnt point to where iam reading the data dynamically.
I am using JSP and not PHP
To establish a database connection i looked the code
$res=mssql_connect(’.\MSSQLSERVER’,"","",false);
mssql_select_db(“sampleDB”);
$gridConn = new GridConnector($res,“MsSQL”);
How do i change this to a Java code ?
Do i have to use the following line ?
scheduler.load(“codebase/connector/db_mssql.php”);
Can i call a servlet which makes a DB connection and renders the xml data? I even tried that
import java.sql.Connection;
import com.dhtmlx.connector.ConnectorServlet;
import com.dhtmlx.connector.SchedulerConnector;
// TODO: Auto-generated Javadoc
/**
-
The Class SchedulerBasicConnector.
*/
public class Scheduler_Database_EventsConnector extends ConnectorServlet {/* (non-Javadoc)
-
@see com.dhtmlx.connector.ConnectorServlet#configure()
*/
@Override
protected void configure() {
Connection conn= ( new DataBaseConnection()).getConnection();SchedulerConnector c = new SchedulerConnector(conn);
c.render_table(“events_rec”,“event_id”,“start_date,end_date,text,rec_type,event_pid,event_length”,"","");
}
-
}
I am callling this servlet from a JSP and there is also a Servlet -mapping corresponding to this in web.xml of the root application. i tried calling scheduler.load(“servlet name”) ; but no luck
The events_rec is created and there is a entry for a corresponding startdate and enddate .When i run this using this code i do not get any error on the server side But looks like it was not able to generate the appropriate xml and there fore throws LOAD XML Error some time STACK OVER FLOW line 11
What do i need to do in events.PHP on a JSP side? Do i need to use this to dynamically load the data from the database ? Any help is appreciated
Thanks in Advance