Estou com o seguinte código:
String sql3 = "Select * from cliente where id=1";
stmt.executeUpdate(sql3);
Ele não dá certo…
tentei com “where id==1” e tambén não deu…
Ajuda ae plx
vlw
Estou com o seguinte código:
String sql3 = "Select * from cliente where id=1";
stmt.executeUpdate(sql3);
Ele não dá certo…
tentei com “where id==1” e tambén não deu…
Ajuda ae plx
vlw
ja tentou usar ResultSet?
Não…
mas tipo, eu executei vários outros comandos sql do tipo:
String sql = "INSERT INTO cliente (Nome, endereço, telefone, celular, email) VALUES('" + Inome + "','" + Iendereco + "','" + Itelefone + "','" + Icelular + "','" + Iemail + "')";
stmt.executeUpdate(sql);
e dá certo…
então deve ser algo na sintaxe disso mesmo…
String sql3 = "Select * from cliente where id=1";
stmt.executeUpdate(sql3);
vlw
ResultSet rs =null;
try {
String sql3 = "Select * from cliente where id=1";
rs = stmt.executeQuery(sql3);
while (rs.next()) {
// implemente seu código
}
}
então, resultset tu usa para pegar dados do banco, tenta algo do tipo
String retorno;
ResultSet rs = stmt.executeQuery("SELECT COLUNA FROM TABELA");
while (rs.next())
{
retorno = rs.getString("COLUNA");
}
pedroroxd , Antes de postar uma duvida pq vc n da uma lida na API da Sun Disponivel ?