I'm trying to insert a variable value in a SELECT statement, "cat", and having a real time of it!
I tried the "preparedstatement" approach, but it returned multiple copies of the result set, ie many repetitiions of the same data were returned, but when i use the "createstatement" approach, it returns the correct number of records!
So now, i'm trying to figure out a way to create the following statement using the "createstatement" approach!
"SELECT CAT_VALUE FROM HLP_CATG_VALUES WHERE CAT_NAME=cat"
A PreparedStatement is the correct way to do this. Your time would be better spent trying to figure out what you were doing incorrectly with that approach rather than resorting to string concatentation.