1
我收到錯誤值java.sql.SQLException:ORA-01747:無效user.table.column,TABLE.COLUMN,或列規格
java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification
我的是返回此錯誤代碼部分是這:
public boolean checkAttendance(String userid,String currentdate){
boolean status=false;
List attendanceList=new ArrayList();
Session session = getSessionFactory().openSession();
try {
Transaction tx = session.beginTransaction();
String hql = "select userid from Attendance where userid='"+ userid +"' and date='"+currentdate+"'";
Query query = session.createQuery(hql);
attendanceList = (ArrayList) query.list(); //This Line returning the error
if(attendanceList.size()>0)
{
status=true;
}
tx.commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return status;
}
我試圖使SQL視圖在我的context.xml文件
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
hibernate.show_sql=true;
</value>
</property>
我不能看到SQL得到執行的d我不知道爲什麼會出現這個錯誤,因爲我的表和字段是正確的。請幫忙。我正在使用Oracle 11g
好的,謝謝我會試試這個。任何理想爲什麼我看不到我的命令gettng被執行? – ErrorNotFoundException 2013-05-03 14:44:37
@Stanley我可能沒有讓自己清楚,或者我誤解了你 - 查詢字符串是無效的 - 這就是爲什麼它不被執行 – kostja 2013-05-03 14:47:13
這很好,先生,但我應該能夠看到應用程序試圖查詢的查詢執行以獲取該錯誤,因爲我設置了我的'hibernate.show_sql = true;'對嗎? – ErrorNotFoundException 2013-05-03 14:59:26