250x250
Notice
Recent Posts
Recent Comments
Link
반응형
개발세발
[day 04][MySQL] JDBC (정리중) 본문
728x90
반응형
SMALL
Statement st = conn.createStatement();
행의 갯수 int 리턴 <-st.executeUpdate ("insert / update / delete ");
테이블구조 ResultSet 리턴 <-st.executeQuery ("select..");
ResultSet rs = st.executeQuery ("select employee_id, first_name, salary from emp_copy"); next() ---> 행 이동 동작. 이동행 데이터없으면 false / 데이터있으면 true
while( rs.next()) { int id = rs.getInt(1); == rs.getInt("employee_id")
rs.getString(2) == rs.getString("first_name") rs.getDouble(3) == rs.getDouble("salary")
rs.getString(4)==>error }
728x90
반응형
'코딩공부 > MySQL' 카테고리의 다른 글
[day 05] JDBC, 과제(정리중) (0) | 2022.01.25 |
---|---|
[JDBC/JAVA/MySQL] DTO, DAO, Main / 도서 입력 테이블 추가,조회 (0) | 2022.01.25 |
[MySQL] DDL, DQL, DML (0) | 2022.01.24 |
[day 02][MySQL] ch.04~06 데이터베이스 모델링 , select문 (0) | 2022.01.16 |
[MySQL] MySQL 설치, DBMS개요 (0) | 2022.01.16 |