Daniel Morton wrote:
> Hello All...
>
> I was just wondering, why does Derby throw an
> SQLException when it shuts down, ie:
>
> DriverManager.getConnection("jdbc:derby:;shutdown=true");
A clean shutdown always throws SQL exception XJ015. While disconcerting,
it's harmless. Here's the explanation from [1]:
> The issue is that standard JDBC getConnection() method calls (either
> DriverManager or DataSource) are used to push the shutdown request to
> Derby. A successful return from these methods would require a Connection
> object to be returned. It seemed strange to return a connection object
> to a database or system that was no longer active, what state would the
> Connection be in, closed? So the decision was made to throw an
> exception, which I think matches spirit of the JDBC spec. (Null as a
> return is not supported by the spec).
>
> The use of the standard JDBC mechanisms to push the shutdown request
> means that the request can be passed to Derby by any networked JDBC
> driver (e.g. DB2 universal driver, RmiJDBC, Weblogic's old Tengah
> driver) as well as embedded.
>
> Any alternate solutions are welcome!
I hope this helps.
regards,
-jean
[1]
http://mail-archives.apache.org/mod_mbox/db-derby-dev/200409.mbox/[EMAIL
PROTECTED]