aspose file tools*
The moose likes JDBC and the fly likes Create Java source with Oracle jdbc fails... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Create Java source with Oracle jdbc fails..." Watch "Create Java source with Oracle jdbc fails..." New topic
Author

Create Java source with Oracle jdbc fails...

Dmitry Danilov
Ranch Hand

Joined: Jan 27, 2004
Posts: 38
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

Joined: Jan 27, 2004
Posts: 38
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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create Java source with Oracle jdbc fails...