<%@ page import="java.util.Calendar" %> <%@ page import="com.aha.data.db.OracleBean"%> <%@ page import="java.sql.*" %> <%@ page import="java.util.*" %> <%@ page import="java.io.*" %> <%@ page import="java.text.*" %> <%@ include file="/include/inc-meta.html"%> <%@ include file="/scripts/javascript.js"%> <%! private static String getDate(String start_date) { SimpleDateFormat sql_date = new SimpleDateFormat("dd-MMM-yyyy"); String str_op = "<"; //if start date is null then look for the startdate else look for the previous date if(start_date == null){ str_op += "="; start_date = sql_date.format(new java.util.Date()); } String _sql = "Select max(startdate) from Article where domain='AHANEWS' and upper(pagetitle) like 'AHA NEWS:%' "+ " and startdate "+str_op+" '"+start_date+"' order by startdate desc NULLS LAST"; OracleBean oraBean = null; ResultSet rs = null; String prev_date = ""; try{ oraBean = new OracleBean(); oraBean.setSQL(_sql); rs = oraBean.execute(); if(rs.next()){ java.util.Date dt = rs.getDate(1); prev_date = sql_date.format(dt); } } catch(Exception e){ e.printStackTrace(); }finally{ try{ if(rs != null){ rs.close(); } } catch(Exception e1){ e1.printStackTrace(); } if(oraBean != null){ oraBean.close(); } } return prev_date; } %> <% SimpleDateFormat sdf_date = new SimpleDateFormat("MMMMMMMMM dd, yyyy"); SimpleDateFormat sql_date = new SimpleDateFormat("dd-MMM-yyyy"); String action = request.getParameter("Action"); String start_date = ""; String prev_date = ""; if(action == null){ start_date = getDate(null); } else { start_date = action; } prev_date = this.getDate(start_date); String gdate=sdf_date.format(sql_date.parse(start_date, new ParsePosition(0))); %>
<%@ include file="/inc-ahanews/channels/search-widget.htm"%>
<%@ include file="/include/inc-top.html"%>
<%@ include file="/include/inc-left-nav.html"%>

<% String dcrpath = ""; String domain = ""; String headline = ""; String byline = ""; Clob subheading = null; int month = 0; java.sql.Date startdate = null; OracleBean oraBean =null; OracleBean oraBean1 =null; ResultSet rs = null; ResultSet rs1 = null; String sql=""; String[] hl_1=new String[2]; try { oraBean = new OracleBean(); sql = "Select * from Article where domain='AHANEWS' and upper(pagetitle) like 'AHA NEWS:%' and startdate = "+ " '"+start_date+"' order by headline"; oraBean.setSQL(sql); //out.println(sql); rs = oraBean.execute(); boolean flag = true; while(rs.next()){ dcrpath = rs.getString("dcrpath"); domain = rs.getString("domain"); headline = rs.getString("headline"); subheading = rs.getClob("subheading"); byline = rs.getString("byline"); startdate = rs.getDate("startdate"); //mainTxt = rs.getClob("maintext"); hl_1 = com.aha.util.DepartmentUtility.getDepartment(headline); String hl_dept =hl_1[0]; String hl_head =hl_1[1]; %> <% } } catch(Exception e) { e.printStackTrace(); out.println("
Error: "+e.toString()); //System.out.println("Testing the SQL"); }finally{ try{ if(rs != null) rs.close(); if(oraBean != null) oraBean.close(); }catch(Exception ie){ } } %>
<%=gdate%> issue of AHA News Bi-Weekly
<%=hl_dept%>
<%=hl_head%>

 

Previous Issues
<%=prev_date%> 

 
<%@ include file="/include/inc-foot.html"%>