I have db column whose datatype is Number (15) and i have the corresponding field in java classes as long. The question is how would i map it using java.sql.Types.
P.S: I can't afford to change the datatype within java class and within DB.
The LONG datatype stores variable-length character strings containing up to two gigabytes, but with many restrictions. This datatype is provided for backward compatibility with existing applications; in general, new applications should use CLOB and NCLOB datatypes to store large amounts of character data.
INTEGER has a lower bound of -2,147,483,648 and an upper bound of 2,147,483,647.
Blob is the mapping for the SQL BLOB (binary large object) type; java. sql. Clob is the mapping for the SQL CLOB (character large object) type. BLOB and CLOB objects are collectively referred to as LOBs (large objects).
From this link it says that java.sql.Types.BIGINT
should be used for long
in Java to Number
in SQL (Oracle).
Attaching screenshot of the table in case the link ever dies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With