File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Java API for executing sql scripts (mysql / oracle) ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Java API for executing sql scripts (mysql / oracle) ?" Watch "Java API for executing sql scripts (mysql / oracle) ?" New topic
Author

Java API for executing sql scripts (mysql / oracle) ?

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,

Would anyone happen to know if there's a java API for executing entire ".sql" files (containing several different SQL commands), on a remote database server ?

It's enough if the API works with MySQL and/or Oracle.


Just to demonstrate what i'm looking for:
Suppose you've created sql file "c:/test.sql" with several script lines:
-- test.sql:
insert into TABLE1 values(3,3);
insert into TABLE1 values(5,5);
create table TABLE2 (name VARCHER) ENGINE innoDB; -- MYSQL specific

Then the java API should look something like:
// Dummy java code:
String driver="com.mysql.jdbc.Driver";
String url= "jdbc:mysql://localhost:3306/myDb";
SomeAPI.executeScriptFile( "c:/test.sql", driver, url);

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java API for executing sql scripts (mysql / oracle) ?