MySQL Forums
Forum List  »  Newbie

SET NULL as table update
Posted by: Ruben Doesburg
Date: November 25, 2013 11:50AM

hello, i have a question about setting a field to NULL using java, my code looks like this

if (sub[0].equals("unban")) { 
            try { 
                PreparedStatement p = DatabaseConnection.getConnection().prepareStatement("UPDATE accounts SET `banned` = 0, `tempban` = ... WHERE id = " + character.getAccIdByName(sub[1])); 
                p.executeUpdate(); 
                p.close(); 
            } catch (Exception e) { 
                player.message("Failed to unban " + sub[1]); 
                return true; 
            } 
            player.message("Unbanned " + sub[1]); 
        }

so what i want is the piece of code to set tempban to NULL
is this possible trough java?

ty in advance



Edited 1 time(s). Last edit at 11/25/2013 11:51AM by Ruben Doesburg.

Options: ReplyQuote


Subject
Written By
Posted
SET NULL as table update
November 25, 2013 11:50AM
November 25, 2013 11:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.