aspose file tools*
The moose likes Java in General and the fly likes Running .sql File in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Running .sql File in java" Watch "Running .sql File in java" New topic
Author

Running .sql File in java

Amit Lonkar
Greenhorn

Joined: Dec 12, 2001
Posts: 25
Hi all
I have to run a a ".sql" file through java. Can anyone tell how it can be done.
Regards
Amit Lonkar
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
Hi,
i guess ".sql" file you are talking contains set of sql statements. Hence you can write the stored procedure in the back end and execute the same using java.
-arun


Sharing is learning
Amit Lonkar
Greenhorn

Joined: Dec 12, 2001
Posts: 25
Hi
I am using Mysql. So stored procedures might not be possible.
One way i found out is, I need the command
mysql --execute="c:/test.sql" to be execute. I put this in a batch file, and ran the batch file using Runtime class.
Reagrds
Amit Lonkar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running .sql File in java