我尝试使用下面的JDBC语句从Java中插入一些值到Oracle DB:错误而JDBC预处理语句
String SQL_PREP_INSERT = "INSERT INTO ABC.TEST (LOG_ID, SESSION_ID,USER_ID) VALUES"
+ " (ABC.logid_seq.nextval, ?, ?)";
stmt = con.prepareStatement(SQL_PREP_INSERT);
stmt.setString(1, sessionId);
stmt.setString(2, userid);
stmt.execute();
stmt.close();
的顺序如下创建:
create sequence ABC.logid_seq
minvalue 1 maxvalue 9999999999999999999999
increment by 10 start with 10 cache 20 noorder nocycle ;
我我得到以下错误,
java.sql.SQLException: ORA-00942: table or view does not exist
但是,当我尝试手动插入到表中,它的成功FUL。
insert into ABC.test(LOG_ID,SESSION_ID,USER_ID) values
(VZPPTL.logid_seq.nextval,'test_session', '001');
什么问题?
http://stackoverflow.com/questions/6561650/getting-an-exception-ora-00942-table-or-view-does-not-exist-when-inserting-in – 2012-04-25 09:39:17
抱歉..如何接受答案? – 2012-04-25 09:58:14
谢谢..我接受以前的问题.. – 2012-04-25 10:13:29