7 Replies Latest reply on Aug 25, 2003 11:32 AM by Wellington Pinheiro

    Strange Problems with Timestamp

    Wellington Pinheiro Newbie

      Hello, we have an application that works with CMP and Oracle 9i.

      We have a table defined as:

      Table: USER

      USER_NAME VARCHAR2(10)
      PASSWORD RAW(40)
      LAST_CHANGE DATE

      The Entity Bean User is something like that (consider its respective set's):

      public String getUserName();
      public byte[] getPassword();
      public java.sql.Date getLastChange();

      Everything was working fine but we had to change the method getLastChange to work with java.sql.Timestamp (we also need the time in this field) and after this change, when we save the field PASSWORD the data is saved with the 3 last bytes changed!!!!

      For example, if we do:

      user.setLastChange(new bytew[] {-126, 13, 78, -23, -8} );

      the sequence is saved as:

      25, 123, -5, -23, -8 ...something like that!! It's not exactly what it saves....it's just an example!!!

      Does anybody know what's happening here??
      Thanks.