데이터 수정하기
public static void main(String[] args) throws ClassNotFoundException, SQLException {
String title = "TEST3";
String writerId = "test";
String content = "HAHAHAHAHAHA";
int id = 255;
String url = "jdbc:oracle:thin:@localhost:1521/xepdb1";
String sql = "UPDATE NOTICE " // NOTICE와 SET 사이 빈공백이 없으면 에러
+ "SET"
+ " TITLE=?,"
+ " CONTENT=?"
+ "WHERE ID=?";
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection(url, "test", "1111");
PreparedStatement st = con.prepareStatement(sql);
st.setString(1, title);
st.setString(2, content);
st.setInt(3, id);
int result = st.executeUpdate();
System.out.println(result);
st.close();
con.close();
}