I'm trying to use the prepareStatement function. The code is below. After it executes, it returns me a bunch of string 'vlicense' instead of the the values. When the code finishing the statement.setString(), the statement becomes "select 'vlicense' from Vehicle". However, it needs to be "select vlicense from Vehicle" without the quotation mark. Can anyone tell me what's the problem? Thanks a lot.
statement = oConnection.prepareStatement("select ? from Vehicle");
String tempString = "vlicense";
statement.setString(1, tempString); resultSet = statement.executeQuery();