Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. public class RepositoryCheck {
  2. final static String DB_HOST = "localhost";
  3. final static int DB_PORT = 3308;
  4. public static final String DB_USER = "root";
  5. public static final String DB_PASS = "root";
  6. public static final String DB_NAME = "wallet_wms";
  7.  
  8. public static void main(String[] args) {
  9. ConfigurationImpl conf = new ConfigurationImpl("", DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME, 300, 5, "");
  10. ExecutorService keepAliveCheckPool = new CommonExecutorService("my-exec-service", 5);
  11. SQLConnectionProvider connections = new SQLConnectionProviderOnlyFirst(conf, keepAliveCheckPool);
  12.  
  13. ComponentsServer maintainerService = new ComponentsServer(new RayIdGenerator20Base64());
  14.  
  15. BasicDataSourceSQLOperator basicDataSourceSQLOperator = new BasicDataSourceSQLOperator(
  16. connections,
  17. new ResultSetBeanBuilder(),
  18. 5,
  19. maintainerService);
  20.  
  21.  
  22. WalletRepository walletRepository = new MySQLWalletRepository(basicDataSourceSQLOperator);
  23.  
  24.  
  25. Wallet wallet = walletRepository.create(
  26. Context.EMPTY,
  27. WalletType.INDIVIDUAL,
  28. 1);
  29.  
  30. System.out.println("Created wallet with id = " + wallet.getId());
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement