how to store BigInteger values in oracle database

后端 未结 4 1277

I have connected Java program to Oracle database using JDBC. I want to store BigInteger values(512 bits) in the database. What should be the type of the column?

4条回答
  •  爱一瞬间的悲伤
    2021-01-13 12:46

    you can try this way:

     oracle.sql.NUMBER numberValue = new oracle.sql.NUMBER(bigIntegerValue);
     cs.setObject(id, numberValue, OracleTypes.NUMBER);
    

    where bigIntegerValue is an instance of java.math.BigInteger, it works for me

提交回复
热议问题