Search in sources :

Example 1 with JdbcDatabaseVendor

use of com.newrelic.agent.bridge.datastore.JdbcDatabaseVendor in project newrelic-java-agent by newrelic.

the class DatabaseServiceTest method createConnectionFactory.

private ConnectionFactory createConnectionFactory(final Connection connection) {
    final JdbcDatabaseVendor jdbcDatabaseVendor = new JdbcDatabaseVendor("MySQL", "database", true) {

        @Override
        public DatastoreVendor getDatastoreVendor() {
            return DatastoreVendor.MySQL;
        }
    };
    ConnectionFactory connectionFactory = new ConnectionFactory() {

        @Override
        public Connection getConnection() throws SQLException {
            return connection;
        }

        @Override
        public DatabaseVendor getDatabaseVendor() {
            return jdbcDatabaseVendor;
        }
    };
    return connectionFactory;
}
Also used : ConnectionFactory(com.newrelic.agent.bridge.datastore.ConnectionFactory) JdbcDatabaseVendor(com.newrelic.agent.bridge.datastore.JdbcDatabaseVendor)

Aggregations

ConnectionFactory (com.newrelic.agent.bridge.datastore.ConnectionFactory)1 JdbcDatabaseVendor (com.newrelic.agent.bridge.datastore.JdbcDatabaseVendor)1