boa noite.
estou com uma dúvida, pois estou começando agora com o jsp.
tenho o seguinte código:
<%@ include file="header.jsp" %>
<!--<%@ include file="ServerConfiguration.jsp" %>-->
<body>
<div align="center">
<div id="center">
<h3>Sistema de solicitação de serviço - GES-OBRAS WEB 1.0</h3>
<%@ include file="menu.jsp" %>
<div class="dados">
<form action="index.jsp" method="get">
<table>
<tr>
<td>
<input type="text" id="fone" name="fone" size="50">
<input type="submit" value="busca">
</td>
</tr>
</table>
</form>
<table class="table">
<tr>
<td class="topo" width="10">CÓD</td>
<td class="topo" width="250">NOME</td>
<td class="topo" width="100">TELEFONE</td>
<td class="topo" width="300">RUA</td>
<td class="topo" width="30">Nº</td>
<td class="topo" width="150">BAIRRO</td>
</tr>
<%
String bgColor = "#ffffff",fone=null;
try{
ResultSet rs = conexao.createStatement().executeQuery("SELECT S.id_solicitacao,S.SEL,C.nome_contribuinte,C.fone,R.nome_ruas,S.numero,B.nome_bairros,SE.nome_setores,SIT.nome_situacoes,SIT.id_situacao,S.data_hora,S.servico,S.justificativa"
+" FROM SOLICITACOES S"
+" LEFT JOIN CONTRIBUINTE C ON S.id_contribuinte=C.id_contribuinte"
+" LEFT JOIN SETORES SE ON S.id_setor=SE.id_setor"
+" LEFT JOIN SITUACOES SIT ON S.id_situacao=SIT.id_situacao"
+" LEFT JOIN RUAS R ON S.id_rua=R.id_ruas"
+" LEFT JOIN BAIRROS B ON C.id_bairros=B.id_bairros"
+" WHERE C.fone like '%"+fone+"%' ORDER BY S.ID_SOLICITACAO DESC");
while (rs.next()){
if(bgColor.equals("#ffffff")) {
bgColor = "#f0f0f0";
} else {
bgColor = "#ffffff";
}
%>
<tr>
<td bgcolor="<%=bgColor %>"><%=rs.getString("id_solicitacao")%></td>
<td bgcolor="<%=bgColor %>"><%=rs.getString("nome_contribuinte")%></td>
<td bgcolor="<%=bgColor %>"><%=rs.getString("fone")%></td>
<td bgcolor="<%=bgColor %>"><%=rs.getString("nome_ruas")%></td>
<td bgcolor="<%=bgColor %>"><%=rs.getString("numero")%></td>
<td bgcolor="<%=bgColor %>"><%=rs.getString("nome_bairros")%></td>
<% } %>
</tr>
</table>
<% } catch (SQLException e){
//out.println("Erro no SQL!"+e.getMessage());
//out.println("Digite seu telefone: ex.: 3251-2844");
return;
} finally {
if (conexao!=null){
//con.fecharConexao();
conexao=null;
}
}
%>
</div>
</div>
</div>
</body>
nao estou conseguindo fazer a pesquisa, pois quando eu digito um valor qualquer não acontece nada com o select, nao aparece nada pesquisado…
aguardo alguma ajuda!
obrigado