Advertisement
Guest User

Untitled

a guest
May 22nd, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. package dogShowUI;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. import utility.ScannerWrapper;
  8.  
  9. public class ApplicationIU {
  10.  
  11. public static Connection conn;
  12.  
  13. static {
  14. try {
  15. Class.forName("com.mysql.jdbc.Driver");
  16. conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/dogshow", "root", "LaRochelle007");
  17. } catch (ClassNotFoundException e) {
  18. e.printStackTrace();
  19. } catch (SQLException e) {
  20. e.printStackTrace();
  21. }
  22. }
  23.  
  24. public static void mainManu () {
  25. System.out.println("Dog Show / Main Menu:");
  26. System.out.println("(1) Owners");
  27. System.out.println("(2) Dogs");
  28. System.out.println("Insert 0 for exit.");
  29. }
  30.  
  31. public static void main (String [] args) {
  32. int option = -1;
  33. while (option != 0) {
  34. mainManu();
  35.  
  36. System.out.println("Insert your option: ");
  37. option = ScannerWrapper.inputNumber();
  38.  
  39. switch (option) {
  40. case 1:
  41. OwnerUI.ownerManual();
  42. break;
  43. case 2:
  44. DogUI.godManual();
  45. break;
  46. default:
  47. System.out.println("Wrong input!");
  48. break;
  49. }
  50. }
  51. }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement