Mapping java.long to oracle.Number(14)

x.509 picture x.509 · Oct 3, 2011 · Viewed 19.5k times · Source

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.

  • would Types.BIGINT work?
  • Or shall i use something else?

P.S: I can't afford to change the datatype within java class and within DB.

Answer

Mike picture Mike · Oct 3, 2011

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.

SQL and JDBC datatypes