Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql target in ANT

 
Sri Rangan
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic