aspose file tools
The moose likes JDBC and the fly likes weird executeUpdate error? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "weird executeUpdate error?" Watch "weird executeUpdate error?" New topic
Author

weird executeUpdate error?

kelvin cheung
Ranch Hand

Joined: Mar 27, 2004
Posts: 120
i have an method that generates a SQL statement and send it to
the database with the method executeUpdate.

i have copied and pasted the SQL line that was generated with this program,
into Oracle. and it gives me no error.

but in this program, it throws an exception.


i have checked the output of "System.out.println( sqlSetning );" pasted into oracle with success.

how comes?
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1076

what is exception ,you are getting


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
kelvin cheung
Ranch Hand

Joined: Mar 27, 2004
Posts: 120
hi,

i get an SQLException :
"ORA-00942: table or view does not exist" .

but I have tested the SQL statement in Oracle and it works fine.

??
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Do you have public synonyms set up for your tables?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
I am not to familiar with oracle, but are you connecting to the correct database and do you have read/write privileges?
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1076

are you sure you are connected to right database?? Just a thought can you please verify.

thanks
[ January 21, 2005: Message edited by: Shailesh Chandra ]
kelvin cheung
Ranch Hand

Joined: Mar 27, 2004
Posts: 120
hi shailesh,
yes, the same database and with same username and password of course.
so weird?

kelvin.
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1076

try to execute a select query on same table revert if you get same error?

try one more thing remove schema name from table chekha.student and try with student only.

however schma name does not give error but try this as well.
kelvin cheung
Ranch Hand

Joined: Mar 27, 2004
Posts: 120
hi Shailesh ,
just tried that too.

how comes?!
i tried to insert the SQL line within the program. it fails.
then i copy the SQL line which was generated by the program. it worked.
this is so weird!
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1076

did select statment execute ....??
I copied your program and execute my insert query !! no problem ...

either problem is with database connection or it is some other database related issue.
Can you paste your program of making connection !!!

thanks
[ January 21, 2005: Message edited by: Shailesh Chandra ]
kelvin cheung
Ranch Hand

Joined: Mar 27, 2004
Posts: 120
Sheilest,
Thank you for your help.
You were right. A problem with a connection of the database.

Regards,
Kelvin.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: weird executeUpdate error?
 
Similar Threads
Null data issue
STRUTS 2 "package com.opensymphony.xwork2" does not exist
Null pointer exception in con.createStatement();
jdbc problem
Problem in inserting record to Oracle Database.