0
<%
    com.BeanPaket.kontrolBean kontrol = new kontrolBean();
    String epostavalue = kontrol.getEposta();
%>

<sql:query var="kutuphane" dataSource="${dataSource}">
    SELECT * FROM kutuphane.odunc_kitaplar WHERE eposta = ?

</sql:query>

如何将我在 <% %> 标记中识别的值放入 sql 查询中以从数据库中获取列表?

4

1 回答 1

0

尝试这个:

<sql:query var="kutuphane" dataSource="${dataSource}">
SELECT * FROM kutuphane.odunc_kitaplar WHERE eposta = ?
   <sql:param value="${epostavalue}" />
</sql:query>
于 2013-03-25T22:21:37.857 回答