java.sql.SQLException:ORA-00928:缺少SELECT关键字

java.sql.SQLException:ORA-00928:缺少SELECT关键字,java,jdbc,Java,Jdbc,我在Java中执行SQL查询时遇到上述异常 statement2.executeUpdate("INSERT INTO visit_header" + "VALUES('"+visitnumber+"','"+date+"','"+cookie+"','"+ip+"')"); 我想知道它出了什么问题。您忘记在访问头和值之间留出空间: statement2.executeUpdate("INSERT INTO visit_header" + " VALUES ('"+visitnumb

我在Java中执行SQL查询时遇到上述异常

statement2.executeUpdate("INSERT INTO visit_header" 
    + "VALUES('"+visitnumber+"','"+date+"','"+cookie+"','"+ip+"')");

我想知道它出了什么问题。

您忘记在访问头和值之间留出空间:

statement2.executeUpdate("INSERT INTO visit_header" + " VALUES ('"+visitnumber+"','"+date+"','"+cookie+"','"+ip+"')");

根据初始外观,您的sql查询中有一个问题:

statement2.executeUpdate("INSERT INTO visit_header" + "VALUES 
应该是

statement2.executeUpdate("INSERT INTO visit_header " + "VALUES  //Note space after header
visit_头和值之间没有空格,因此您的查询如下:

INSERT INTO visit_headerVALUES 

这是错误的。

谢谢。它现在正在工作,但现在我得到了java.sql.SQLException下面的异常:ORA-01950:表空间'EXAMPLE'@user2314206上没有特权,您可以使用sql plus登录到EXAMPLE表吗?用户真的有访问该表空间的权限吗?好的。我已经给了特权。我得到了它。非常感谢。