Web(국비)/DB연결8 DB연결2 Memberinsert002.jps(자바 코드만 기입하는 곳) insert String sql = String.format("INSERT INTO TBL_MEMBER(SID,NAME,TEL) VALUES(MEMBERSEQ.NEXTVAL, '%s','%s')",uName,uTel); //○ DB 액션 처리 ->insert //작업객체 Statement stmt=conn.createStatement(); //적용된 행의 갯수 반환 int result=0; result=stmt.executeUpdate(sql); if(resultsendRedirect() 메소드 이용 response.sendRedirect("Err002.jsp"); } else { //등록된 경우라면 //URL변경 안내 ->sendRedire.. 2019. 10. 25. DB연결 DBConn.java package com.util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DBConn { private static Connection dbConn; public static Connection getConnection() throws ClassNotFoundException, SQLException { if (dbConn == null) { String url = "jdbc:oracle:thin:@localhost:1521:xe"; String user = "scott"; String pwd = "tiger"; Class.forName("or.. 2019. 10. 25. 이전 1 2 다음