<%@ include file="conn2.jsp" %> Todays Thought - Eshq.in
THOUGHT OF THE DAY
<%! String thought="" ; String dte="" ; String servdate=""; %> <% try{ Date today_ind = new Date(); int date=today_ind.getDate(); int month= today_ind.getMonth()+1; int year=today_ind.getYear(); if(date<10) servdate="0"+date+"-"; else servdate = date+"-"; if(month<10) servdate=servdate+"0"+month+"-"; else servdate=servdate+month+"-"; if(year>=100) { year+=1900; servdate=servdate+year ; } Connection con = null; DatabaseConnection dbcon = new DatabaseConnection(); con = dbcon.getConnection(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("Select * from thought order by id desc limit 1"); while(rs.next()){ thought = rs.getString("thought"); dte = rs.getString("date"); } }catch(Exception e){ out.println(e.getMessage()); } %>



<%=thought%>



<%=dte%>