Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Execute .sql files using Oracle Stored procedures
Another way you can do it is to open up an SSH session to the Oracle
server machine, then issue the command "sqlplus username/password
@<filename_or_URL>".
The .sql file on your client machine has to be accessible from the server machine either by NFS in which case you would specify a path to sqlplus, or by FTP or HTTP in which case you would specify a URL to sqlplus. The fact that sqlplus supports FTP and HTTP makes this approach quite convenient.
Also, Sourceforge has a project called sshtools which provides a Java API for SSH.
HTH, Dave
Jitin wrote:
> Hi all,
>
> I am using Oracle 9i.
> I have a '.sql' file which has 'Create table' statments.
> I want to create the database tables using this .sql file in my java
> program, But the machine on which my java program is running does not
> have oracle client installed so i cannot use sqlplus utility.
> Since I can freely make use of JDBC calls, i read the .sql file, parse
> the statements one by one and execute the statements using
> statement.executeUpdate() but this is very slow and not desired.
>
> Is there any other way to execute the .sql file ?
> Does oracle provides any built in stored procedure which may take the
> path of my .sql file and execute it ?
>
> Thanx in advance
Received on Wed Oct 01 2003 - 15:07:48 CDT