Results 1 to 1 of 1
  1. #1
    Join Date
    Dec 2003
    Posts
    1

    Question Unanswered: Storing hashed passwords

    Hi,
    I am trying to store an MD5 hashed password in a table and I am getting an SQLexception. I am using a prepared statement and it seems that it is not implementing the escape characters.
    Can someone please help me.

    Thank you

    here is my code:
    String queryInfo = "INSERT INTO EBZ_USERINFO " + "(USERID,USERNAME,PASSWORD,SALT) " +
    "values (?,?,?,?)";

    preparedStatement = connection.prepareStatement(queryInfo, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);

    try{
    preparedStatement.setInt(1, userID);
    preparedStatement.setString(2,user.getUserName());
    preparedStatement.setString(3,password);
    preparedStatement.setString(4,salt);
    preparedStatement.executeUpdate();
    } catch (Exception ex){
    connection.rollback();
    ex.printStackTrace();
    }
    Last edited by jeronjava; 12-17-03 at 04:26.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •