Advertisement
reage

Untitled

Dec 11th, 2017
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. if (checkDriver("com.mysql.jdbc.Driver"))
  2.             System.out.println(" ... OK");
  3.         else
  4.             System.exit(1);
  5.         Connection con = getConnection("jdbc:mysql://", "localhost", 3306, "root", "");
  6.         Statement st = createStatement(con);
  7.        
  8.         // próba wybrania bazy
  9.         if (executeUpdate(st, "USE lab_java;") == 0)
  10.             System.out.println("Baza wybrana");
  11.         else
  12.             System.out.println("Baza nie istnieje!");
  13.         String sql = "SELECT * FROM questions";
  14.         ResultSet result = executeQuery(st,sql);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement