Skip to content

Instantly share code, notes, and snippets.

@lebesnec
Created February 10, 2009 15:18
Show Gist options
  • Save lebesnec/61419 to your computer and use it in GitHub Desktop.
Save lebesnec/61419 to your computer and use it in GitHub Desktop.
public void shutdown() {
try {
connection.close();
DriverManager.getConnection(PROTOCOL + ";shutdown=true");
} catch (SQLException se) {
// an exception is thrown even if the database is closed correctly,
// so we have to check the current state to see if something failed
if (!"XJ015".equals(se.getSQLState()))
se.printStacktrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment