Results 1 to 6 of 6
- 05-02-2012, 10:31 AM #1
Member
- Join Date
- Jan 2010
- Location
- Russia
- Posts
- 9
- Rep Power
- 0
- 05-02-2012, 04:22 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
- 05-02-2012, 04:31 PM #3
Member
- Join Date
- Jan 2010
- Location
- Russia
- Posts
- 9
- Rep Power
- 0
Re: A way to execute multiple queries from an SQL script file?
As far as I know, you cannot put multiple queries into one Statement. I could execute them one by one, but in order to do so I have to parse my SQL file. But it is too complex a task since my file contains creation of pl/sql functions. I simply don't know how to break it into individual queries without writing a complex SQL parser.
- 05-02-2012, 05:08 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: A way to execute multiple queries from an SQL script file?
Why not simply hand the sql file to the database directly?
Most DBs have a front end for doing bulk SQL.Please do not ask for code as refusal often offends.
- 05-03-2012, 10:06 AM #5
Member
- Join Date
- Jan 2010
- Location
- Russia
- Posts
- 9
- Rep Power
- 0
Re: A way to execute multiple queries from an SQL script file?
For some unknown reason I can't communicate with psql process. I start the process, and nothing happens. I can't read its output and I can't pass the data to it. So I thought that using some library would be the right way to do the thing.
- 05-03-2012, 10:37 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: A way to execute multiple queries from an SQL script file?
This sort of thing is almost invariably better done using whatever tools the DB provides you with.
Not knowing your database I can't say what tool, but if you need to call it via Java then you'll want to use Runtime.exec(), but beware of the pitfalls and ensure you read up on how it works.Please do not ask for code as refusal often offends.
Similar Threads
-
Execute sql script from java
By nikosdi in forum JDBCReplies: 0Last Post: 06-10-2011, 01:52 PM -
Multiple queries - is it smart to enable this
By flyfisherman in forum JDBCReplies: 8Last Post: 04-23-2010, 06:13 PM -
jar file won't execute.
By Splat in forum New To JavaReplies: 5Last Post: 10-22-2009, 05:26 AM -
Multiple Queries using batch Updates
By swati.jyoti in forum JDBCReplies: 3Last Post: 05-12-2009, 10:40 AM -
how do i run EXECUTE DBMS_MVIEW.REFRESH script from within java
By alexh in forum JDBCReplies: 0Last Post: 07-11-2007, 01:22 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks