Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create Java source with Oracle jdbc fails...

 
Dmitry Danilov
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm trying to execute the following command against Oracle 10g through jdbc's Statement.executeUpdate():

but jdbc driver fails with the following exception:

I then started playing around with the java source code in the command string and discovered that the problem is possibly caused by the curly braces in the code. If I remove the curly braces, I then get an exception from Oracle which says that it was expecting one of the following:
"extends" ...
"implements" ...
or "{" ...
but encountered end of file.

So it's really starting to look like the jdbc driver cannot parse curly braces while Oracle is expecting to see them.
Does anybody know what was wrong in what I did, and if it was - what is the correct way to CREATE JAVA SOURCE with Oracle JDBC?
I was using the Oracle 10g thin driver (ojdbc14_g.jar).

Thank you.
[ June 23, 2006: Message edited by: Bear Bibeault ]
 
Dmitry Danilov
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YES!
I have found a workaround! The jdbc driver treats curly braces as escape symbols, so they have to be escaped. Having not found a way to escape them, I simply called Statement.setEscapeProcessing(false) and the whole thing worked.

Stil wondering if there is a more elegant solution out there...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic