A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
Run .sql file using JDBC or any java API
Joined: Apr 09, 2007
Sep 12, 2008 03:35:00
This is Venkat. I am currently developing a installer. This intaller has a task of running initial database scripts (.sql file) on a database server.
Is there any way that i can run
or any other API's.
The intital scripts include,
1) user creation script.
2) create tables for above created user.
Please help me as soon as possible.
Thanks in advance,
Joined: Apr 14, 2004
Sep 12, 2008 03:42:00
Java has an IO API you can use to access the file - see the java.io package. Once you have the contents of the file its easy to run them via JDBC or Hibernate.
Joined: Jan 26, 2007
Sep 15, 2008 11:55:00
You can read the file one sql statement at the time and execute it through the JDBC.
for oracle the single line sqls like select, inser etc are terminated by ';'
and PL SQL blocks by '/' so you can use these separators to distinguish the sql sattements
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Run .sql file using JDBC or any java API
Directly run SQL Script file using JDBC
Need a help regarding .....
running sql script file from java
Is it possible to directly run SQL Script file using JDBC
Need to run db scripts using java
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013