1 2 Previous Next 19 Replies Latest reply: May 20, 2008 6:26 AM by 807601 Go to original post RSS
      • 15. Re: how to save long type variable in Access database
        807601
        public long getAddDateInMillis(){
                  return addDate.getTimeInMillis();
             }



        i think ur making mistake somewhere else.
        and also create database table only one time.
        • 16. Re: how to save long type variable in Access database
          807601
          You're right, I will create table somewere else.

          But I've tried to do something like that:
          long var = 1211292642734L; 
          PreparedStatement ins = connection.prepareStatement("INSERT INTO linktable VALUES("+var+")");
          ins.execute();
          And there is still message: "Data type mismatch in criteria expression.".

          So perhaps LONG type in Access isn't the same as long type in Java -- if yes: have you any idea how to save long type variable in database?
          • 17. Re: how to save long type variable in Access database
            DarrylBurke
            So perhaps LONG type in Access isn't the same as long type in Java
            The LONG data type in Access is equivalent to INTEGER4, 4 bytes: Java int (there is also a INTEGER2, equivalent to java char).

            A brief search did not reveal any data type corresponding to Java long.
            if yes: have you any idea how to save long type variable in database?
            See #1.

            db
            • 18. Re: how to save long type variable in Access database
              807601
              long var = 1211292642734L;
              PreparedStatement ins = connection.prepareStatement("INSERT INTO linktable VALUES("+var+")");
              ins.execute();

              Look ur var datatype is correct but i think ms access LongInteger datatype doesnot support such a long value,

              Long integer value range in ms access is -2,147,483,648 to 2147483647 (its only 4 byte long)
              Double is 8 byte long in msacess.
              Byte, 0 <-> 255 (no fractions) 1 byte
              Decimal -10^28 -1 <-> 10^28 -1 12 bytes
              Integer ?32,768 <-> 32,767 (no fractions) 2 bytes
              Single NegNumbers -3.402823E38 <-> ?1.401298E?45 4 bytes
              Single PosNumbers 1.401298E?45 <-> 3.402823E38 4 bytes

              i hope it will help you..
              • 19. Re: how to save long type variable in Access database
                807601
                Of course that's the reason! Thank you very much for your help :).

                greetings :)
                1 2 Previous Next