SHARE
TWEET

Untitled

a guest Jun 18th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. serviceRegistration = bundleContext.registerService(IConnector.class.getName(), new Connector(), null);
  2.      
  3. serviceRegistration = bundleContext.registerService(Connector.class.getName(), new Connector(), null);
  4.      
  5. userDBConnectorTracker = new ServiceTracker(context, IConnector.class.getName(), this);
  6.      
  7. userDBConnectorTracker = new ServiceTracker(context, Connector.class.getName(), this);
  8.      
  9. public class HikariCPDataSource {
  10.  
  11.     private static HikariConfig config = new HikariConfig();
  12.     private static HikariDataSource ds;
  13.  
  14.     static {
  15.         config.setJdbcUrl("jdbc:h2:mem:test");
  16.         config.setUsername("user");
  17.         config.setPassword("password");
  18.         config.addDataSourceProperty("cachePrepStmts", "true");
  19.         config.addDataSourceProperty("prepStmtCacheSize", "250");
  20.         config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
  21.         ds = new HikariDataSource(config);
  22.     }
  23.  
  24.     public static Connection getConnection() throws SQLException {
  25.         return ds.getConnection();
  26.     }
  27.  
  28.     private HikariCPDataSource(){}
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top