SQL select statement with where clause

前端 未结 6 1316
醉话见心
醉话见心 2020-12-30 16:39

how would i write this sql statement without a hard coded value?

resultSet = statement
    .executeQuery(\"select * from myDatabase.myTable where name = \'jo         


        
6条回答
  •  执念已碎
    2020-12-30 17:21

    Put quotes around your name value since it's a string.

    "select * from myDatabase.myTable where name ='" + name + "'"
    

提交回复
热议问题