2012-04-24 6 views
-1

나는 다음과 같은 오류가 무엇입니까 다음 SQL 쿼리를 실행하고 있습니다 :은 java.sql.SQLException : ORA-01747

내 SQL 쿼리 구문이 올바른지
java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification 

String strQuery = "UPDATE themed_night SET theme_night_name = ?, theme_night_date = TO_DATE(?, 'dd-MM-yy'), theme_night_description = ?, WHERE theme_id = ?"; 
     PreparedStatement stmt = conn.prepareStatement(strQuery);//prepare the SQL Query 
     stmt.setString(1, title); 
     stmt.setString(2, output); 
     stmt.setString(3, details); 
     stmt.setString(4, themeID); 

인가를? 열을 두 번 확인하고 올바른 이름을 입력했습니다.

답변

3

성명서에 쉼표가 있습니다. 올바른 문 (나는 그것에 대해 잘 모르겠어요하지만) 당신이 볼 didnt는 작은 따옴표로 일부 값을 둘러싸

+0

woops을해야 할 수도 있습니다, 또한

String strQuery = "UPDATE themed_night SET theme_night_name = ?, theme_night_date = TO_DATE(?, 'dd-MM-yy'), theme_night_description = ? WHERE theme_id = ?"; 

해야한다. 긴 날 이었어. -_- – user667430

+0

걱정 마라! 우리 모두에게 일어납니다 –

+0

나는 똑같은 실수를 저질 렀습니다. +1해도 – Anas

관련 문제