Conn
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","SCOTT","TIGER");
Statement
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM table");
- executeUpdate(); // 실패일 때 0 한행 추가나 삭제, 수정은 1, 그 이상은 2이상의 숫자 반환
PreparedStatement
PreparedStatement pstmt = conn.prepareStatement("SELECT * FROM ?");
pstmt.setString(1,"table");
ResultSet rs = pstmt.excuteQuery();
ResultSet
if (rs.next()) }
String s = rs.getString("*");
}