I am (successfully) connecting to a database using the following:
java.sql.Connection connect = DriverManager.getConnection( \"jdbc:mysql://localhost/some_
You also can use
public boolean isDbConnected(con Connection) { //final String CHECK_SQL_QUERY = "SELECT 1"; try { if(!con.isClosed() || con!=null){ return true; } } catch (SQLException e) { return false; } return false; }