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.

[201 byte] By [deepeea] at [2007-11-27 11:04:21]
# 1

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

SomeoneElsea at 2007-7-29 12:57:51 > top of Java-index,Java Essentials,Java Programming...
# 2

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

georgemca at 2007-7-29 12:57:51 > top of Java-index,Java Essentials,Java Programming...