JavaResources--provide free tutorial ebook source fpr you
Join  |  Add Resource  |  Forum  |  About Us  |  Contact Us  |  Policies    
 

 

<% int fi=3; CategoryFactory cfy=new CategoryFactory(); ArrayList lists=cfy.getItemsCount(1); Iterator it=lists.iterator(); while(it.hasNext()) { if(fi%3==0) { out.print(" "); } Category cg=(Category)it.next(); out.print(" "); fi++; } %>
Free Ebooks>> Category
"); out.print(""+cg.getItem()+"("+cg.getFlag()+")"); out.print("
<% Format formatter = new SimpleDateFormat("MM/dd/yyyy"); Connection con=DbUtil.getCon(); BusinessObjFactory f=new BusinessObjFactory(){ public Object getBusinessObj(ResultSet rs)throws PagingException{ Vector v=new Vector(); try{ v.add(rs.getString("id")); v.add(rs.getString("item")); v.add(rs.getString("caption")); v.add(rs.getString("count")); v.add(rs.getString("whenmade")); } catch(SQLException ex){ ex.printStackTrace(); throw new PagingException(ex.getMessage()); } return v; } }; out.println("
"); Page p=Page.getPage("select count(a.id) from content a join category b on a.category_id=b.id where b.flag=1 ","select a.id,a.count,a.caption,a.content,a.whenmade,b.item from content a join category b on a.category_id=b.id where b.flag=1 order by a.whenmade desc",con,f,35,request); out.println(p.getPagingHTMLCode("form1")); Iterator itr=p.getData().iterator(); int count=0; out.print(""); %> <% while(itr.hasNext()){ Vector v=(Vector)itr.next(); if(count%2==0) { out.print(""); } else { out.print(""); } count++; out.print("
Category Caption Visits Updated
"+(String)v.elementAt(1)); out.print(""+""+(String)v.elementAt(2)+""); out.print(""+(String)v.elementAt(3)); java.util.Date date=new java.util.Date(Long.parseLong((String)v.elementAt(4))); String s = formatter.format(date); out.print(""+s); } out.println("
"); out.println(p.getPagingHTMLCode("form1")); out.println("
"); con.close(); %>

Copyright @ 2004- 2006  JavaResources. All rights reserved Grupo Publispain