java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
JDBC插入数据的时候报错,复制语句到oracle能执行成功,实在找不到哪里错了,下面是控制台打印的拼打sql语句和报错,开始时间:2014-10-1922:39:30结...
JDBC插入数据的时候报错,复制语句到oracle能执行成功,实在找不到哪里错了,下面是控制台打印的拼打sql语句和报错,
开始时间: 2014-10-19 22:39:30
结束时间: 2014-10-19 23:39:30
查询语句为: insert into metting values(4,'201',1,to_date('2014-10-19 22:39:30','yyyy-mm-dd HH:mi:ss'),to_date( '2014-10-19 23:39:30','yyyy-mm-dd HH:mi:ss'));
java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1000)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1814)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1779)
at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:277)
at meeting.AddMeeting.add(AddMeeting.java:37)
at meeting.Test01.main(Test01.java:8) 展开
开始时间: 2014-10-19 22:39:30
结束时间: 2014-10-19 23:39:30
查询语句为: insert into metting values(4,'201',1,to_date('2014-10-19 22:39:30','yyyy-mm-dd HH:mi:ss'),to_date( '2014-10-19 23:39:30','yyyy-mm-dd HH:mi:ss'));
java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1000)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1814)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1779)
at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:277)
at meeting.AddMeeting.add(AddMeeting.java:37)
at meeting.Test01.main(Test01.java:8) 展开
2个回答
展开全部
to_date函数不要用引号引起来,否则就是字符类型,不是日期类型了。
insert into metting values(4,'201',1,to_date(2014-10-19 22:39:30,yyyy-mm-dd HH:mi:ss),to_date( 2014-10-19 23:39:30,yyyy-mm-dd HH:mi:ss));
insert into metting values(4,'201',1,to_date(2014-10-19 22:39:30,yyyy-mm-dd HH:mi:ss),to_date( 2014-10-19 23:39:30,yyyy-mm-dd HH:mi:ss));
追问
查询语句为: insert into metting values(4,'201',1,to_date(2014-10-20 20:37:45,yyyy-mm-dd HH:mi:ss),to_date( 2014-10-20 21:37:45,yyyy-mm-dd HH:mi:ss));java.sql.SQLSyntaxErrorException: ORA-00907: 缺失右括号
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |