rogelgarcia 18 de mar. de 2010
É java para web cara…
faicoxim: Poste aqui como tá o seu JSP… ou Servlet… que tenha o link para excluir…
faicoxim 18 de mar. de 2010
<%
try
{
Class.forName("org.postgresql.Driver") ;
Connection con = DriverManager.getConnection(" jdbc : postgresql :// localhost / aula "," admin "," 1234 ");
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
if (request.getParameter(" acao ") != null)
{
st.executeUpdate(" delete from login where log_codigo = "+ request.getParameter(" codigo " ));
}
Pessoal olha só o código,
rogelgarcia 18 de mar. de 2010
faicoxim:
<%
try
{
Class.forName("org.postgresql.Driver") ;
Connection con = DriverManager.getConnection(" jdbc : postgresql :// localhost / aula "," admin "," 1234 ");
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
if (request.getParameter(" acao ") != null)
{
st.executeUpdate(" delete from login where log_codigo = "+ request.getParameter(" codigo " ));
}
Pessoal olha só o código,
Isso deve estar dentro de um servlet certo??
Existe algum link para esse servlet.. poste o código que tem o link...
faicoxim 18 de mar. de 2010
<td><div align= "center" ><a href= "usuario.jsp?acao=excluir&codigo= <%= rs . getString ( "log_codigo" ) %> " ><img src= "imagens/delete.gif" width= "24" height= "24" /></a></div></td>
<%
try
{
Class.forName("org.postgresql.Driver") ;
Connection con = DriverManager.getConnection(" jdbc : postgresql :// localhost / aula "," admin "," 1234 ");
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
if (request.getParameter(" acao ") != null)
{
st.executeUpdate(" delete from login where log_codigo = "+ request.getParameter(" codigo " ));
}
rogelgarcia 18 de mar. de 2010
isso…
onde tem isso
href="usuario.jsp?acao=excluir&codigo= <%= rs . getString ( "log_codigo" ) %> "
vc pode usar um javascript… mais ou menos assim:
href="javascript:if(confirm('Deseja realmente excluir esse registro?')){window.location = 'usuario.jsp?acao=excluir&codigo= <%= rs . getString ( "log_codigo" ) %> ';}"
Se nao der certo… é pq o location levou para um path invalido… complete a path com as informacoes necessárias (olha na barra de endereços do browser pra onde foi… que vc consegue arrumar)