I ran across this on Google, and I know this thread is a little old, but I figured I would post a reply anyway in case anyone else runs into this.
Basically, this is a weird quirk of Derby in that it actually throws an exception when the shutdown is successful. Code 08006 actually means the database was successfully shutdown. Here's the relevant quote from the Derby documentation:
"A successful shutdown always results in an SQLException to indicate that Derby has shut down and that there is no other exception."
"The XJ015 error (successful shutdown of the Derby engine) and the 08006 error (successful shutdown of a single database) are the only exceptions thrown by Derby that might indicate that an operation succeeded. All other exceptions indicate that an operation failed. You should check the log file to be certain."
Yeah, I know it's odd, and it throws a lot of people because the behavior is so unexpected. But rest assured that according to the Derby developer's guide, this is normal and actually indicates the database was shutdown successfully.
I just wanted to thank you for your post on shutting down the derby server. I was getting the exception while shutting down the server and couldn't find the reason for it . Then I saw your message . Once again thank you very much for your post.