개발세발

[day 04][MySQL] JDBC (정리중) 본문

코딩공부/MySQL

[day 04][MySQL] JDBC (정리중)

뉼👩🏻‍💻 2022. 1. 24. 01:26
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
반응형