<%@ page contentType="text/html;charset=euc-kr" %> <%@ page import="java.sql.*" %> <% String galtype = request.getParameter("galtype"); String galseason = request.getParameter("galseason"); String passkey = request.getParameter("passkey"); String spage = request.getParameter("spage"); String sNo = request.getParameter("no"); int no = 0; if(!sNo.equals("") && sNo != null) { no = Integer.parseInt(sNo); } System.out.println("no : "+ no); int totalCnt = 0; PreparedStatement ps = null; ResultSet rs = null; Connection conn = null; try { // Ŭ·¡½º ·Îµå Class.forName("org.postgresql.Driver"); conn = DriverManager.getConnection("jdbc:postgresql:hanmaum", "postgres", ""); } catch(Exception e) {} try { String query = ""; query = "select count(*) from gallery where type = ? and state = '1' and no = ? and passwd = ?"; ps = conn.prepareStatement(query); ps.setString(1, galtype); ps.setInt(2, no); ps.setString(3, passkey); rs = ps.executeQuery (); while ( rs.next() ) { totalCnt = rs.getInt(1); } rs.close(); if ( totalCnt > 0) { %> <% } else { %> <% } } catch (Exception e) { out.println("JSP >> Slight Exception in scggracehill/Cs/qa_pw_ok.jsp : " + e.toString()); %> <% } finally { if ( rs != null ) rs.close(); if ( ps != null ) ps.close(); if ( conn != null ) conn.close(); } %>