This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes  Is it possible to directly run SQL Script file using JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark " Is it possible to directly run SQL Script file using JDBC" Watch " Is it possible to directly run SQL Script file using JDBC" New topic
Author

Is it possible to directly run SQL Script file using JDBC

suresh charan
Greenhorn

Joined: Jun 15, 2006
Posts: 8
Hi,

Is there anyway I can run .sql script file(which is present in my
application) directly using JDBC API on to Oracle Database
without manually running the sql file in SQL * Plus tool.Is there any method available in JDBC so that I just give my .sql file as input and it takes care of executing it provided I give information of the database where it should run.
Srikanth Basa
Ranch Hand

Joined: Jun 06, 2005
Posts: 241
Check this thread
[ February 06, 2007: Message edited by: Srikanth Basavaraju ]
Srikanth Basa
Ranch Hand

Joined: Jun 06, 2005
Posts: 241
I doubt if you are able to access the link.

Here is the solution
Runtime.getRuntime().exec( "sqlplus <<username>>/<<password>>@db @<<sql file name>>" );
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to directly run SQL Script file using JDBC
 
Similar Threads
how to create database in ms-sql server using java/jdbc
Directly run SQL Script file using JDBC
running sql script file from java
problem with Database Configuration Script
Run .sql file using JDBC or any java API