<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> TwiHotels : Twihotels on Twitter <%@ include file="connectionDB.jsp" %> <%@ include file="header.jsp" %> <% ResultSet rs = null; Statement st = null; String sql = ""; try { int total = 0; sql = "select count(Id) as cid from protweets"; st = con.createStatement(); rs = st.executeQuery(sql); if(rs.next()) total = rs.getInt("cid"); total = total-10; %> <% sql = "select Tweet, URL from protweets order by Id desc limit 0,10"; st = con.createStatement(); rs = st.executeQuery(sql); %>
  Home  
<% String bgcolor = "#FFFFFF"; int count = 0, i = 1; out.println(""); String tweet = "", user = ""; while(rs.next()){ tweet = rs.getString("Tweet"); user = tweet.substring(0,tweet.indexOf(":")); tweet = tweet.substring(tweet.indexOf(":")); out.println(""); } %>
Twihotels on Twitter
"+user+""+tweet+"
<% } catch(Exception ex) { System.out.println("Error in protweets "+ex); } finally{ if(rs!=null) rs.close(); if(con!=null) con.close(); } %> <%@ include file="footer.jsp" %>