Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- serviceRegistration = bundleContext.registerService(IConnector.class.getName(), new Connector(), null);
- serviceRegistration = bundleContext.registerService(Connector.class.getName(), new Connector(), null);
- userDBConnectorTracker = new ServiceTracker(context, IConnector.class.getName(), this);
- userDBConnectorTracker = new ServiceTracker(context, Connector.class.getName(), this);
- public class HikariCPDataSource {
- private static HikariConfig config = new HikariConfig();
- private static HikariDataSource ds;
- static {
- config.setJdbcUrl("jdbc:h2:mem:test");
- config.setUsername("user");
- config.setPassword("password");
- config.addDataSourceProperty("cachePrepStmts", "true");
- config.addDataSourceProperty("prepStmtCacheSize", "250");
- config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
- ds = new HikariDataSource(config);
- }
- public static Connection getConnection() throws SQLException {
- return ds.getConnection();
- }
- private HikariCPDataSource(){}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement