%@ page contentType="text/html;charset=euc-kr"%> <%@ page import="java.util.*"%> <%@ page import="java.sql.*"%> <%@ page import="bbsComm.*"%> <% Statement st = null; ResultSet rs = null; String sql = null; Connection conn = null; WebCommon WebComm = new WebCommon(); //String [] sa_temp = new String[] { "","","","","","","","","","","","","","","","","","","","","","","","","","","","",""} ; String personNum = request.getParameter("personNum") == null ? "" : request.getParameter("personNum"); String Name = WebComm.uni2Ksc (request.getParameter("Name") == null ? "" : request.getParameter("Name") ); int i =0; Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); Properties prop = new Properties(); prop.put("user", "ksd"); prop.put("password", "ksd"); prop.put("databasename", "ksd"); conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433", prop); st = conn.createStatement(); if (!(personNum.equals("") &&Name.equals("") )) { try { //½ÇÁ¦ µ¥ÀÌÅÍ °¡Á®¿À±â sql = "select ÁֹιøÈ£ , ¼º¸í from admin_helpUser where ÁֹιøÈ£ = '"+personNum+"' and ¼º¸í='"+Name+"' "; rs = st.executeQuery(sql); if (!rs.next()) { out.print("") ; } else { sql = " delete FROM admin_helpuser where ÁֹιøÈ£ = '"+personNum+"' and ¼º¸í='"+Name+"' "; i = st.executeUpdate(sql); } if(rs!=null) rs.close(); if(st!=null) st.close(); if(conn!=null) conn.close(); } catch(SQLException e) { if(rs!=null) rs.close(); if(st!=null) st.close(); //if(conn!=null) connMgr.freeConnection("scott", conn); if(conn!=null) conn.close(); out.println("SQLException : "+e.toString()); } catch(Exception e) { conn.rollback(); if(rs!=null) rs.close(); if(st!=null) st.close(); //if(conn!=null) connMgr.freeConnection("scott", conn); if(conn!=null) conn.close(); System.out.println("Exception : "+e.toString()); } finally { if(rs!=null) rs.close(); if(st!=null) st.close(); if(conn!=null) conn.close(); } } %>
<%if (personNum.equals("") &&Name.equals("") ) {%> <% }else if (i>0) {%> <%}%>