Search in sources :

Example 1 with GenericJdbcConnectionFactory

use of com.amazonaws.athena.connectors.jdbc.connection.GenericJdbcConnectionFactory in project aws-athena-query-federation by awslabs.

the class JdbcTableUtils method getDbConnection.

/**
 * Gets a JDBC DB connection.
 * @return Connection object.
 * @param databaseConnectionInfo
 */
protected Connection getDbConnection(DatabaseConnectionInfo databaseConnectionInfo) {
    DatabaseConnectionConfig connectionConfig = getDbConfig();
    JdbcConnectionFactory connectionFactory = new GenericJdbcConnectionFactory(connectionConfig, properties, databaseConnectionInfo);
    return connectionFactory.getConnection(null);
}
Also used : GenericJdbcConnectionFactory(com.amazonaws.athena.connectors.jdbc.connection.GenericJdbcConnectionFactory) JdbcConnectionFactory(com.amazonaws.athena.connectors.jdbc.connection.JdbcConnectionFactory) DatabaseConnectionConfig(com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig) GenericJdbcConnectionFactory(com.amazonaws.athena.connectors.jdbc.connection.GenericJdbcConnectionFactory)

Aggregations

DatabaseConnectionConfig (com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig)1 GenericJdbcConnectionFactory (com.amazonaws.athena.connectors.jdbc.connection.GenericJdbcConnectionFactory)1 JdbcConnectionFactory (com.amazonaws.athena.connectors.jdbc.connection.JdbcConnectionFactory)1