public synchronized Connection getConnection()

in src/main/java/com/uber/uberscriptquery/jdbc/JdbcConnectionProvider.java [41:60]


    public synchronized Connection getConnection() {
        if (connection != null) {
            try {
                if (!connection.isClosed()) {
                    return connection;
                }
            } catch (SQLException e) {
                LOG.warn(String.format("Failed to check whether jdbc connection is close: %s", jdbcConnectionString), e);
            }
        }

        SqlUtils.loadJdbcDriverClass(jdbcConnectionString);

        try {
            connection = DriverManager.getConnection(jdbcConnectionString);
            return connection;
        } catch (SQLException e) {
            throw new RuntimeException("Failed to create jdbc connection: " + jdbcConnectionString, e);
        }
    }