Advertisement
Guest User

Untitled

a guest
Apr 13th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import JDBC.JDBCOperations;
  2.  
  3. import java.sql.Connection;
  4.  
  5. public class Main {
  6.  
  7. public static void main(String argv[]) {
  8. if (argv.length != 3) {
  9. System.out.println("Invalid arguments!");
  10. } else {
  11. String url = argv[0];
  12. String user = argv[1];
  13. String password = argv[2];
  14.  
  15. Connection connection = JDBCOperations.createConnection(url, user, password);
  16.  
  17. if (connection == null) {
  18. System.out.println("Invalid Url, Username or Password!");
  19. } else {
  20. JDBCOperations.dropTables(connection);
  21. JDBCOperations.createTables(connection);
  22. JDBCOperations.fillTables(connection);
  23. JDBCOperations.executeOperations(connection);
  24. JDBCOperations.closeConnection(connection);
  25. }
  26. }
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement