File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes sql target in ANT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "sql target in ANT" Watch "sql target in ANT" New topic

sql target in ANT

Sri Rangan
Ranch Hand

Joined: Dec 08, 2001
Posts: 160
I am trying to run hypersonic database update via ant. My build.xml snippet looks as below

my some_script.sql has "shutdown" as the last command. It works fine if I don't have the "shutdown" command in my script file. If I have it, build throws "java.sql.Exception The database shutdown in statement[commit]"
Any ideas?
Greg Charles

Joined: Oct 01, 2001
Posts: 2968

I'm not very familiar with the SQL shutdown statement, but it seems clear what is happening. By shutting down the database you invalidate the JDBC connection. (You understand the Ant task is implemented by JDBC, right?) The connection naturally complains about that. However, as long as shutdown is the last statment, I think you can safely ignore that message.
However, I'm not sure how to make Ant ignore it. You could try setting oneror=continue in the sql task, and see if that helps. (I had to spell error wrong for this post to work.)
Sri Rangan
Ranch Hand

Joined: Dec 08, 2001
Posts: 160
I tried and it does not help. I am issuing the shutdown as the last command on my sript file and it is the last target in my build file.
But it would be nice to avoid the error message on the console. Though shutdown is completed, build process says "FAILED"
I agree. Here's the link:
subject: sql target in ANT
It's not a secret anymore!