Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to directly run SQL Script file using JDBC

 
suresh charan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this thread
[ February 06, 2007: Message edited by: Srikanth Basavaraju ]
 
Srikanth Basa
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt if you are able to access the link.

Here is the solution
Runtime.getRuntime().exec( "sqlplus <<username>>/<<password>>@db @<<sql file name>>" );
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic