This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Is it possible to directly run SQL Script file using JDBC
 
Similar Threads
Directly run SQL Script file using JDBC
problem with Database Configuration Script
running sql script file from java
Run .sql file using JDBC or any java API
how to create database in ms-sql server using java/jdbc