Having searched unsuccessfully for days, I thought I would ask.
I am retrieving a value from a table, whose columns are all varchar. How do we go about identifying the type of value. For e.g.
accountnumber may have values such as 123456
, 123456:78910
...
try(ResultSet rs = stmt.executeQuery("select * from table")){
if(rs.next()){
//Cannot use anything other than 'getString'
String var = rs.getString("accountnumber");
//Determine if var is an Integer
System.out.println(var instanceof Integer) //returns false because 'var' is of type String.
}
}
...
Any pointers are much appreciated.