Is it possible to cast a String to an Integer? I initially defined a variable as an int but received a CastClassException error when trying to sort the object.
If I define the element of the class as String, I do not receive the error however the values are not sorted as I expect (i.e. 0,1,12,13,14,3,4,5....)
I retrieve the value from the resultset as a string but need to change it to an Integer when adding the element to the class, also causing me to change the class definition to Integer instead of String.
I was using the getInt to retrieve the value from the recordSet but changed it to the getString. I did not see a method called getInteger.
Therefore, is my only option to make this work casting from String to Integer and can that be done?
If I define the element of the class as String, I do not receive the error however the values are not sorted as I expect (i.e. 0,1,12,13,14,3,4,5....)
I retrieve the value from the resultset as a string but need to change it to an Integer when adding the element to the class, also causing me to change the class definition to Integer instead of String.
I was using the getInt to retrieve the value from the recordSet but changed it to the getString. I did not see a method called getInteger.
Therefore, is my only option to make this work casting from String to Integer and can that be done?