Here you can find the source of internalShutdown(String connectionString, int expectedErrorCode, String expectedSQLState)
private static void internalShutdown(String connectionString, int expectedErrorCode, String expectedSQLState) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.DriverManager; import java.sql.SQLException; public class Main { private static void internalShutdown(String connectionString, int expectedErrorCode, String expectedSQLState) throws SQLException { try {//w w w. ja v a 2s . c o m DriverManager.getConnection(connectionString); } catch (SQLException ex) { boolean successfullShutdown = expectedErrorCode == ex.getErrorCode() && expectedSQLState.equals(ex.getSQLState()); if (!successfullShutdown) { throw ex; } } } }