%@ page import="com.aha.data.db.pooling.*" %> <%@ page import="java.util.*" %> <%@ page import="java.sql.*" %> <%@ page import="eventcalendar.*" %> <%@ page import="java.text.SimpleDateFormat"%> <% java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MMMM dd, yyyy"); Vector eventList = new Vector(); String[] begin_dates = new String[5]; String sql = "SELECT * FROM (SELECT * FROM eventcalendar WHERE (UPPER(title) LIKE '%HUMAN RESOURCE%' OR UPPER(shortdesc) LIKE '%HUMAN RESOURCE%' OR UPPER(keyword) LIKE '%HUMAN RESOURCE%' OR UPPER(title) LIKE '%WORKFORCE%' OR UPPER(shortdesc) LIKE '%WORKFORCE%' OR UPPER(keyword) LIKE '%WORKFORCE%' OR UPPER(title) LIKE '%RETENTION%' OR UPPER(shortdesc) LIKE '%RETENTION%' OR UPPER(keyword) LIKE '%RETENTION%' OR UPPER(title) LIKE '%NURS%' OR UPPER(shortdesc) LIKE '%NURS%' OR UPPER(keyword) LIKE '%NURS%' OR UPPER(title) LIKE '%STAFFING%' OR UPPER(shortdesc) LIKE '%STAFFING%' OR UPPER(keyword) LIKE '%STAFFING%' OR UPPER(title) LIKE '%EMPLOY%' OR UPPER(shortdesc) LIKE '%EMPLOY%' OR UPPER(keyword) LIKE '%EMPLOY%' OR UPPER(title) LIKE '%WORK ENVIRONMENT%' OR UPPER(shortdesc) LIKE '%WORK ENVIRONMENT%' OR UPPER(keyword) LIKE '%WORK ENVIRONMENT%' OR UPPER(title) LIKE '%TECHS%' OR UPPER(shortdesc) LIKE '%TECHS%' OR UPPER(keyword) LIKE '%TECHS%' OR UPPER(title) LIKE '%TRAINING%' OR UPPER(shortdesc) LIKE '%TRAINING%' OR UPPER(keyword) LIKE '%TRAINING%' OR UPPER(title) LIKE '%SALARY%' OR UPPER(shortdesc) LIKE '%SALARY%' OR UPPER(keyword) LIKE '%SALARY%' OR UPPER(title) LIKE '%WAGE%' OR UPPER(shortdesc) LIKE '%WAGE%' OR UPPER(keyword) LIKE '%WAGE%' OR UPPER(title) LIKE '%LABOR%' OR UPPER(shortdesc) LIKE '%LABOR%' OR UPPER(keyword) LIKE '%LABOR%' OR UPPER(title) LIKE '%UNION%' OR UPPER(shortdesc) LIKE '%UNION%' OR UPPER(keyword) LIKE '%UNION%') AND startdate >= SYSDATE ORDER BY startdate) WHERE ROWNUM <= 5"; Connection con = null; ResultSet rs = null; PreparedStatement pstmt = null; try{ con = PoolManager.getInstance().getConnection("hospitalconnect"); pstmt = con.prepareStatement(sql); int i=1; int beginIndex=0; rs = pstmt.executeQuery(); while(rs.next()) { EventBean eb = new EventBean(); eb.setDomain(rs.getString("DOMAIN")); eb.setPath(rs.getString("PATH")); eb.setTitle(rs.getString("TITLE")); eb.setTopic(rs.getString("TOPIC")); eb.setCity(rs.getString("CITY")); begin_dates[beginIndex++] = sdf.format(rs.getDate("STARTDATE")); eb.setStartDate(sdf.format(rs.getDate("STARTDATE"))); eb.setStopDate(sdf.format(rs.getDate("STOPDATE"))); eb.setHosts(rs.getString("HOSTS")); eb.setShortDesc(rs.getString("SHORTDESC")); eventList.addElement(eb); } } catch(Exception e){ e.printStackTrace(); } finally{ try{ if(rs != null) rs.close(); if(pstmt != null) pstmt.close(); }catch(Throwable t) {} if(con != null) PoolManager.getInstance().freeConnection("hospitalconnect", con); } %> <%! private String modifyTitle(String title){ if(title.indexOf("Calendar of Events:") >= 0){ title = title.substring(19); } else if(title.indexOf("Calendar:") >= 0){ title = title.substring(title.indexOf(":")+1); } return title; } %>
![]() | |||||||||
|