Web/JSP
오류 #1 - ora-00911 문자가 부적합합니다
언덕너머에
2015. 2. 26. 16:16
sql문 오류로서 보통 DML문 마지막에 ';'이 존재하면 발생합니다.
아래 소스를 참고하세요.
public void insertProduct(ProductVO pVo) {
String sql = "insert into product(code, name) values(product_seq.nextval, ?);";
// 위 sql문에서 마지막 ';'때문에 발생하는 에러입니다.
Connection conn = null;
PreparedStatement pstmt = null;
try {
conn = DBManager.getConnection();
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, pVo.getName());
pstmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
} finally {
DBManager.close(conn, pstmt);
}
}