Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes executing PL/SQL through JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "executing PL/SQL through JDBC" Watch "executing PL/SQL through JDBC" New topic
Author

executing PL/SQL through JDBC

Grigory Ptashko
Greenhorn

Joined: Feb 21, 2003
Posts: 9
Hello.
I have a question regarding PL/SQL and JDBC.
I have a file which is about 500 kb in its size with PL/SQL procedures, declarations, etc.
How can I execute it through JDBC?
The problem is that I have to write an installer for an app which uses db Oracle, and while installing I have to create a scheme in Oracle.
First I thought about executing SQLPlus on that file from the Java VM, but I was told to do this through JDBC.
Is there any way ?
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1131

Hi Grigory,
I executed the below java code on a Windows XP computer using J2SE SDK 1.4.1_02 and Oracle (thin) JDBC driver (file: ojdbc14.jar) against an Oracle 8i (8.1.7.4) database running on SUN [sparc] Solaris 7

Note that file "plsql000.txt" is a plain text file that I put in the same directory as my compiled java code -- the "JdbcTest.class" file. This is the contents of file "plsql000.txt"

Note that the "plsql000.txt" file has a trailing blank line (but I don't know if that's important or not).
Hopefully this will help you.
Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: executing PL/SQL through JDBC