retrieve info from dbase using JSP - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

retrieve info from dbase using JSP

tyapsingtyapsing Posts: 1Member
i need to display the event from dbase to jsp calender, but the event for current date can't be display unless it is placed at the top of the dbase list. i'm currently using mysql, jdk1.3.1 and tomcat 4.0. The program is written in javascript and saved as .jsp. please help. The complete calendarcan be mail to those interested to help further. Thanks.

ResultSet RS= stmt.executeQuery("select date_format(date,'%M'),date_format(date,'%d'),event,category from cal");
.
.
calendar += "";
calendar += "";
if(startday > 0) {
for(empty = 0; empty < startday; empty++) {
calendar += "";
}
}
for(i = startday; i <= endday; i++) {
if( (i % 7) == 0) {
calendar += "</tr>";
}

//keep highlight info on the current month and day
if( (i - (startday - 1)) == dt && currentmonth == mo && currentyear == year) {
calendar += "";
calendar += "
";
calendar += "" + count + "";

<%

if(RS.next()){

month=RS.getString("date_format(date,'%M')");
date=RS.getString("date_format(date,'%d')");
ev=RS.getString("event");
cat=RS.getString("category");
%>
var col;
if ((months[mo]=="<%=month%>")&&(count=="<%=date%>")) {

calendar += "";
calendar += "";
calendar += "<%=ev%>";
calendar += "
";


}
<%
}
%>

calendar += "";

} else {

calendar += "";
calendar += "" + count + "";

<%

while(RS.next()){

month=RS.getString("date_format(date,'%M')");
date=RS.getString("date_format(date,'%d')");
ev=RS.getString("event");
cat=RS.getString("category");
%>
var col;
if ((months[mo]=="<%=month%>")&&(count=="<%=date%>")){

calendar += "";
calendar += "";
calendar += "<%=ev%>";
calendar += "";
calendar += "";
}

<%
}
%>

calendar += "
";
}
count++;
}

calendar += "";
calendar += "";
Sign In or Register to comment.