I need to parse the value of a database column that generally contains integers, based on the result Set generated from a JDBC call. However, one particular row of the column has two integers in it (ie, “48, 103”). What will be the return value of resultSet.getInt() on that column?
Share
It will throw an exception.
I think you are taking the wrong approach here. The
getXXX()is supposed to match the data type of the table. Is the data type on the table listed as VARCHAR? If that case you should use getString() to get the data and then parse it with the String.spilt(“,”) if the,exists (you can use String.indexOf() to verify is the comma is there or not).