Search code examples
javasybase

Corresponding java datatype for Numeric(9,2) in sybase


I want to insert a Numeric(9,2)value through SP in Sybase which is being invoked through Java. What data type should I use in java side.


Solution

  • When you have to write an application to use data stored on database I suggest you to search for the default data type mapping of the jdbc driver you have to use (it depends on target database).

    In your situation you could check this data type mapping http://jtds.sourceforge.net/typemap.html. For numeric the default is BigDecimal. In my experience BigDecimal saves some headaches.