Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public boolean isUniekeNaam(String spelNaam) {
  2.  
  3.  
  4.  
  5. try (Connection conn = DriverManager.getConnection(Connectie.JDBC_URL)) {
  6. PreparedStatement query = conn.prepareStatement("Select naam From Spel");
  7. try (ResultSet rs = query.executeQuery()) {
  8. while (rs.next()) {
  9. spelNaam = rs.getString("naam");
  10.  
  11.  
  12.  
  13. }
  14. }
  15.  
  16. conn.close();
  17. } catch (SQLException ex) {
  18. throw new IllegalArgumentException("A unique name is required");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement