1: private static final String CONNECT_STRING = "jdbc:ocl:orcl"; 2: 3: public void doPost(HttpServletRequest request, HttpServletResponse response) 4: throws IOException, ServletException { 5: try { 6: request.getSession().invalidate(); 7: String passwd = request.getParameter("passwd" ); 8: 9: // passwd에 대한 검증 10: if (passwd == null || " " .equals(passwd)) return; 11: 12: // 패스워드 조합 규칙을 검사한 후, 위배될 경우 재입력을 요구 13: if (Password.validate(passwd) == false) return; 14: 15: InitialContext ctx = new InitialContext(); 16: DataSource datasource = (DataSource) ctx.lookup(CONNECT_STRING); 17: Connection con = datasource.getConnection(); 18: 19: con.close(); 20: } catch (SQLException e) { 21: System.err.println("..."); 22: } catch (NamingException e) { 23: System.err.println("..."); 24: } 25: }