java.sql.SQLException: ORA-00928: 缺失 SELECT 关键字
myeclipse6.5报的异常:java.sql.SQLException:ORA-00928:缺失SELECT关键字atoracle.jdbc.dbaccess.DB...
myeclipse 6.5报的异常:
java.sql.SQLException: ORA-00928: 缺失 SELECT 关键字
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at StuLogic.addInfo(StuLogic.java:22)
at Start.main(Start.java:17)
程序可能出现错误的代码:String sql="insert into stuinfo vlaues(?,?,?,?,to_date(?,'yyyy-mm-dd'))";
pstm=cnn.prepareStatement(sql);
pstm.setInt(1,sdb.getSno());
pstm.setString(2,sdb.getSname());
pstm.setInt(3, sdb.getSage());
pstm.setString(4, sdb.getAddr());
pstm.setString(5, sdb.getSjion());
int length=pstm.executeUpdate(); 展开
java.sql.SQLException: ORA-00928: 缺失 SELECT 关键字
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at StuLogic.addInfo(StuLogic.java:22)
at Start.main(Start.java:17)
程序可能出现错误的代码:String sql="insert into stuinfo vlaues(?,?,?,?,to_date(?,'yyyy-mm-dd'))";
pstm=cnn.prepareStatement(sql);
pstm.setInt(1,sdb.getSno());
pstm.setString(2,sdb.getSname());
pstm.setInt(3, sdb.getSage());
pstm.setString(4, sdb.getAddr());
pstm.setString(5, sdb.getSjion());
int length=pstm.executeUpdate(); 展开
4个回答
展开全部
sql拼写有误
仔细检查组装sql的代码部分
仔细检查组装sql的代码部分
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
从insert语句代码向上查找,应该在select 语句附近
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询