how do i detect the datatype of a variable
i need to detect the datatype of value read from a text file and insert it into a DB.
But before doing so, i hav eto be able to tell which datatype it is so i can use the right set method.
i need to detect the datatype of value read from a text file and insert it into a DB.
But before doing so, i hav eto be able to tell which datatype it is so i can use the right set method.
You can always use setString() regardless of datatype, plus, anything you read in from a text file is a string until you parse it as something else.
~Tim
You can't, really. Not definitively. Think about it: what type is the following
37
Could be an integer. Could be a byte. Could be a string, Who knows? You can make rough guesses, like 20.48 is probably a float or a double, but it might also be pounds sterling, or who knows what else