Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void changeName(int LånerID, String newName) throws SQLIntegrityConstraintViolationException {
- String query = "UPDATE lånertabel SET Navn='"+newName+"' WHERE LånerID="+LånerID+";";
- try {
- Connection con = DBConnector.getConnection();
- PreparedStatement ps = con.prepareStatement(query);
- ps.executeUpdate();
- System.out.println("Navn ændret");
- } catch (SQLException ex) {
- System.out.println("Fejl i connection til Database");
- ex.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement