Advertisement
Guest User

Untitled

a guest
Oct 26th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4. import javax.swing.*;
  5.  
  6.  
  7.  
  8. public class programma {
  9.  
  10. public static void main(String[] args) throws ClassNotFoundException, SQLException {
  11. Class.forName("org.postgresql.Driver");
  12. String url = "jdbc:postgresql:esercitazione";
  13. String username = "postgres";
  14. String password = "esame";
  15. Connection conn = DriverManager.getConnection(url,username,password);
  16.  
  17. boolean stop = false;
  18. while(!stop){
  19. String choice = JOptionPane.showInputDialog("Inserisci un numero tra 1 e 4");
  20. if(choice != "1" || choice != "2" || choice != "3" || choice != "4")
  21. JOptionPane.showMessageDialog(null, "Inserire un numero tra 1 e 4");
  22. else{
  23. int c = Integer.parseInt(choice);
  24. switch(c){
  25. case 1:
  26.  
  27. }
  28. }
  29. }
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement