Cannot use a LIKE query in a JDBC PreparedStatement?

前端 未结 7 1793
生来不讨喜
生来不讨喜 2020-12-01 06:11

The query code and query:

ps = conn.prepareStatement(\"select instance_id, ? from eam_measurement where resource_id in (select RESOURCE_ID from eam_res_grp_r         


        
7条回答
  •  無奈伤痛
    2020-12-01 06:43

    PreparedStatement ps = con.prepareStatement(
        "select columname from tablename where LOWER(columnname) LIKE LOWER('"+var+"%')");  
    

    Here var is the variable in which value that is to be searched is stored...

提交回复
热议问题