• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

weird executeUpdate error?

 
kelvin cheung
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is exception ,you are getting
 
kelvin cheung
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have public synonyms set up for your tables?
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi shailesh,
yes, the same database and with same username and password of course.
so weird?

kelvin.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sheilest,
Thank you for your help.
You were right. A problem with a connection of the database.

Regards,
Kelvin.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic