%
/*==============================================================================================
* Project Title : ÇѸ¶À½¿¬¼ö¿ø
* File Name : main.jsp
* Include :
* Used DB Table : notice
* Used Class :
* Description : ¸ÞÀÎ
* Programmer : °ÁÖ¿ë
* First Write : 2010.05.10
* Last Update :
==============================================================================================*/
%>
<%@ page contentType="text/html;charset=euc-kr" %>
<%@ include file="/include/in_Import.jsp" %>
<%@ include file="/include/in_Function.jsp" %>
<%@ include file="/include/incMobileCheck.jsp" %>
<%
int PageAuth = 1;
String menuId = request.getParameter("menuId");
if(menuId == null || menuId.equals("")) menuId = "00";
%>
<%!
static {
try {
new kr.co.slight.jinhae.pool.JDCConnectionDriver("org.postgresql.Driver","jdbc:postgresql:hanmaum","postgres","");
} catch(Exception e) {
System.out.println("
JDCConnectionDriver Error : " + e.toString());
}
}
%>
<%
Connection conn = null;
Statement stmt = null;
ResultSet rs1 = null;
ResultSet rs2 = null;
try {
StringBuffer query1 = new StringBuffer();
StringBuffer query2 = new StringBuffer();
query1.append("select * from notice where state = '1' order by no desc limit 5 offset 0 ");
query2.append("select * from notice where state = '2' order by no desc limit 5 offset 0 ");
conn = DriverManager.getConnection("jdbc:jdc:jdcpool");
stmt = conn.createStatement();
rs1 = stmt.executeQuery(query1.toString());
%>
<%@ page contentType="text/html;charset=euc-kr" %>
<% if("M".equals(chkMobile)) { %>
 |
<% } else { %>
|
<% } %>
|
|
|
|
|
<%
if (rs1 != null) {
int no = 0;
String subject = "";
String regdate = "";
while (rs1.next()) {
no = rs1.getInt("no");
subject = rs1.getString("subject");
regdate = rs1.getString("reg_dt").toString().substring(0, 10);
subject = cutoffString(subject, 30);
%>
|
<%= subject %>
|
<%= regdate %> |
<%
}
} else {
%>
µî·ÏµÈ °Ô½Ã¹°ÀÌ ¾ø½À´Ï´Ù. |
<%
}
//System.out.println("1");
rs1.close();
rs2 = stmt.executeQuery(query2.toString());
%>
|
|
|
|
|
|
|
|
<%
if (rs2 != null) {
int no = 0;
String subject = "";
String regdate = "";
while (rs2.next()) {
no = rs2.getInt("no");
subject = rs2.getString("subject");
regdate = rs2.getString("reg_dt").toString().substring(0, 10);
subject = cutoffString(subject, 30);
%>
|
<%= subject %>
|
<%= regdate %> |
<%
}
} else {
%>
µî·ÏµÈ °Ô½Ã¹°ÀÌ ¾ø½À´Ï´Ù. |
<%
}
%>
|
|
|
<%@ include file="/hanmaum/bottom1.jsp" %>
<%
if ( rs1 != null ) rs1.close();
if ( rs2 != null ) rs2.close();
if ( stmt != null ) stmt.close();
if ( conn != null ) conn.close();
} catch (Exception e) {
if ( rs1 != null ) rs1.close();
if ( rs2 != null ) rs2.close();
if ( stmt != null ) stmt.close();
if ( conn != null ) conn.close();
// ¿¡·¯ÆäÀÌÁö·Î À̵¿............
out.println("JSP >> Exception in /hanmaum/main.jsp : " + e.toString());
}
%>