Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Running Oracle scripts through JDBC?

Re: Running Oracle scripts through JDBC?

From: D.Y. <dyou98_at_aol.com>
Date: 6 May 2002 20:15:35 -0700
Message-ID: <f369a0eb.0205061915.6808b1fe@posting.google.com>


laredotornado_at_zipmail.com (D. Alvarado) wrote in message news:<9fe1f2ad.0205061233.16507d62_at_posting.google.com>...
> When I fire up SQL*Plus, it is straightforward to execute an oracle
> script by simply typing:
>
> sqlplus>start myscript.sql
>
> I was wondering if, given a java.io.File object, JDBC can run a script
> in Oracle. Obviously, it is possible to execute simple jdbc/sql
> statements such as "create table" and "select" or even call stored
> procedures. But I would like to imitate the functionality of running
> the script from the sqlplus command line (as above). Is it possible?
> How?
>
> Thanks in advance, Dave

No. What you are looking for is functionality only available in tools like sqlplus. JDBC processes SQL statements one at a time. The best you can do, if you want to run multiple statements at the same time, is to convert all you SQLs into a PL/SQL block. You can do this if you are only running insert, update and delete. Received on Mon May 06 2002 - 22:15:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US