Guest User

Untitled

a guest
Aug 25th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. public class ImdbSuche {
  4.  
  5. public static void main(String[] args) throws SQLException, ClassNotFoundException {
  6. String database = "";
  7. String server = "";
  8. String port = "";
  9. String user = "";
  10. String password = "";
  11. String keyword = "";
  12.  
  13. int i;
  14. for(i=0; i<args.length/2; i++) {
  15. if(args[i*2].equals("-d")) database = args[i*2+1];
  16. else if (args[i*2].equals("-s")) server = args[i*2+1];
  17. else if (args[i*2].equals("-p")) port = args[i*2+1];
  18. else if (args[i*2].equals("-u")) user = args[i*2+1];
  19. else if (args[i*2].equals("-pw")) password = args[i*2+1];
  20. else if (args[i*2].equals("-k")) keyword = args[i*2+1];
  21. }
  22.  
  23. Connection connection = DriverManager.getConnection("jdbc:db2://" + server + ":" + port + "/" + database, user, password);
  24.  
  25. System.out.println("MOVIES");
  26.  
  27. }
  28. }
Add Comment
Please, Sign In to add comment