"select * from tablename where fieldname = ?" is correct one,then u set the value use stmt.setString(1,fieldname)  (here fieldname must be a String which match u db's column's data type)...if u got nothing,check u db's record

解决方案 »

  1.   

    fildname="?"          ??????????try "select * from tablename where fieldname =/'/?/'" and try del"/" one by one , i think /? is important.
      

  2.   

    to bluesmile979:when I use /'/?/', the error message is :
    ====================================
    ORA-00936: missing expression 
    Cause: A required part of a clause or expression has been omitted. For example, a SELECT statement may have been entered without a list of columns or expressions or with an incomplete expression. This message is also issued in cases where a reserved word is misused, as in SELECT TABLE. Action: Check the statement syntax and specify the missing component
    =====================================
    and when I use '/?/' and '/?' the error is same as before: "ORA-01006: bind variable does not exist "what should I do?Thanks
      

  3.   

    "select * from tablename where fieldname = ?";
    stmt.setString(1,fieldname);
      

  4.   

    to yashiro:this method does not work!I get nothing from DB.