Search code examples
javasqloracle-databasejstl

How to use oracle like operator in JSTL?


Following code I used

<sql:query dataSource="jdbc/crawl" var="rs">
    select * from vsites where site like %?%
    <sql:param value="${param.key}"/>
</sql:query>

But it throws exception

My url is: http://localhost/c/2.jsp?key=math

thanks


Solution

  • Change your query like this:

     select * from vsites where site like '%' || ? || '%'