I am facing an issue very randomly.
I have a table with column type Number. In my java class where i insert values into this table, I am using setBigDecimal function to bind the value.
I dont face the issue always, but at times, I am getting the below exception:
[XHUB-108] A SQLException occurred while doing a database operation ( myfunction())[java.sql.SQLException:1461:ORA-01461: can bind a LONG value only for insert into a LONG column.
I got this issue inserting a value - 493414 into the column. Where as, I was able to insert values way bigger than this into the table.
Should i use setNUMBER function to insert the values and avoid the issue?
Is this a bug in setBigDecimal funciton?
Kamal, if your DB column is defined as Number you can't just set it as BigDecimal. You have to convert the BigDecimal to a Number either when you pass it into the statement, or inside the statement you call on the DB.