James, I've done quite a bit of work with Java, including JDBC. Java data conversion normally works quite well. One caution in Java, though. Examine the following syntax: if (myString == "hello") This does not work. This only compares the addresses of myString and the literal constant that contains the word "hello". This was my most common mistake when I was learning Java. Instead, you must use the following: if (myString.equals("hello")) The second problem is that the conversion classes often return data with blank padding. If your field is ten characters long, you might need to compare as follows: if (myString.equals("hello*****")) (Replace the asterisks with blanks.) The other option, provided you are not worried about leading blanks, is to use the trim() method. trim() removes both leading and trailing blanks: if (myString.trim().equals("hello")) Again, be careful, because this will match any of the following fields: hello*****[*]hello****[*]*hello***[*]**hello**[*]***hello*[*]****hello (Again, where the asterisks represent blanks). If none of these work for you, please post your code and let us know what you're doing.

Reply With Quote