/** * Attempts to establish a connection with the database. * @return a {@code Connection} instance, or null if unable to connect * @throws java.sql.SQLException if a database access error occurs */ @Override public synchronized Connection getConnection() throws SQLException { if (pool == null) createConnectionPool(); // Get connection from pool. return getLoginTimeout() > 0 ? pool.getConnection(1000L * getLoginTimeout()) : pool.getConnection(); }