문제

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?

도움이 되었습니까?

해결책

java.lang.Long might fit well here, however I think this is an issue in the mssql driver.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top