java.lang.Long
might fit well here, however I think this is an issue in the mssql driver.
Type mapping of NUMERIC values from sql server JDBC driver
-
21-07-2023 - |
سؤال
According to javadoc:
void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC value when it sends it to the database.
I've some mssql stored procedure
, that have in parameter of type NUMERIC(10, 0)
and I try to pass this value as java.math.BigDecimal
in JDBC ... But I got:
com.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type decimal to numeric
I do can found workarounds (ex. change the parameter type to BIGING
and use setLong
from Java)..
But My question is... is this bug in sql server jdbc driver?
المحلول
لا تنتمي إلى StackOverflow