• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

weird executeUpdate error?

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is exception ,you are getting
 
kelvin cheung
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

??
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have public synonyms set up for your tables?
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sheilest,
Thank you for your help.
You were right. A problem with a connection of the database.

Regards,
Kelvin.
 
reply
    Bookmark Topic Watch Topic
  • New Topic