JDBC `decimal(28,2)` becomes `java.sql.Types.DOUBLE`

2.1k Views Asked by At

There is a decimal(28, 2) column in the database. JDBC getColumnType returns java.sql.Types.DOUBLE for that column. Any ideas why this happens and how to avoid this?

For decimal(38, 19) it returns java.sql.Types.DECIMAL as expected.

The driver is jtds. Works under Java 1.6. DBMS is MS SQL.

1

There are 1 best solutions below

1
On

Thats correct behaviour. What would you expect it to be? If you want integer types your column should be an INT