JSP - Oracle 연결
2020. 7. 24. 16:54ㆍ개발공부/JSP
728x90
#072420
#Oracle SQL - Eclipse 연동
1) DB 연결 계정, 패스워드, url 설정
2) JDBC 커넥터 드라이버 호출
- Datatype: Class / Method: forname / Parameter: oracle.jdbc.driver.OracleDriver
3) DB 연결 객체 생성
- Datatype: Connection / Method: DriverManager.getConnection
4) SQL문 선언
- Datatype: String
5) DB 실행 객체 생성
- Datatype: PrepareStatement / Reference: Connection's Instance
/ Method: prepareStatement / Parameter:sql
6) DB Table 채우기
- Reference: Instance of PrepareStatement / Method: setString
7) Exception 오류
- ClassNotFoundException 외 오류는 Expcetion로 변경해 잡아준다.
8) SQL문 실행
- INSERT, UPDATE, DELETE: Method : executeUpdate
- SELECT: Method: executeQuery
* Instance란?
- An Object and Instance are the same thing.
'개발공부 > JSP' 카테고리의 다른 글
JSP - Connection pool & DAO (0) | 2020.08.04 |
---|---|
JSP - application & include (0) | 2020.08.02 |
JSP - Java 문법 연동(List) (0) | 2020.07.15 |
JSP - HTML, Eclipse(JSP) (0) | 2020.07.14 |
JSP - Orientation, HTML (0) | 2020.07.13 |