我有一条错误提示“ORA-00933:SQL 命令未正确结束”
rs = st.executeQuery("select * from msg_new_to_bde t where t.ACTION = 804 and t.seq > ? order by t.seq desc" + sequenceID);
you are concatenating sequenceID
to you query. its not a valid query.
I think your query should be something like below:
rs = st.executeQuery("select * from msg_new_to_bde t
where t.ACTION = 804 and t.seq > ? order by t.seq desc");
PreparedStatement.setInt(1,sequenceID );// setting the column using preparedStatement
Try this:
rs = st.executeQuery("select * from msg_new_to_bde t where t.ACTION = 804 and t.seq > " + sequenceID + " order by t.seq desc");
尝试将 sequenceID 作为参数传递给准备好的语句。
String query="select * from msg_new_to_bde t where t.ACTION = 804 and t.seq > ? order by t.seq desc";
// int(your datatype) input parameterized.
PreparedStatement st = con.prepareStatement(query);
st.setInt(1, sequenceID);
rs = st.executeQuery();