This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
 
jQuery in Action, 3rd edition