Java – get exception ora-00942: table or view does not exist – when inserting an existing table

When trying to insert a batch of rows into an existing table, I am getting the following exception

I can confirm that the table exists in dB. I can use Oracle to insert data into the table. SQL developers, but when I try to insert rows using Preparedstatement in Java, there is no error in its thrown table

Please find the error of stack trace below

java.sql.sqlException: ORA-00942: table or view does not exist

    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:1889)
    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 quotecopy.DbConnection.insertIntoDestinationDb(DbConnection.java:591)
    at quotecopy.QuoteCopier.main(QuoteCopier.java:72)

Can anyone suggest the reason for this mistake?

Update: problem solving

There is no problem with my database connection properties or my table or view names The solution of the problem is very strange One of the columns I'm trying to insert is CLOB type Because I have encountered a lot of trouble in processing CLOB data in Oracle DB before, I try to replace CLOB setter with a temporary string setter, and execute the same code for any problem, and all lines are inserted correctly!

Replaced

Why is there an error in the error table or view? It is an error in inserting CLOB data Can anyone explain

Thank you very much for your reply and comments

Solution

Oracle will also report this error if the table exists, but you do not have any permissions So if you're sure the table is there, check it out

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>