prepareStatement Problemas

2 respostas
R

:?:open_mouth: código abaixo não executa tentei de modificar de varias formas não consegui fazer funcionar será que algué pode me ajudar :?:
PreparedStatement stmt = this.connect.prepareStatement(“SELECT * FROM produtos WHERE Txtpartnumber = ? and Motivo = ?”);

stmt.setString(1, fields.Txtpartnumber.getText());	     
     stmt.setString(2, (String) fields.JbMotivo.getSelectedItem());
     ResultSet rse = stmt.executeQuery();

Urgente???

2 Respostas

Igor_Novaes

Se esse JbMotivo é um JComboBox faça assim:

stmt.setString(1, fields.Txtpartnumber.getText());
stmt.setString(2, JbMotivo.getSelectedItem().toString());
ResultSet rse = stmt.executeQuery();
R

Valeu funcionou
Muito Obrigado

Criado 14 de junho de 2008
Ultima resposta 15 de jun. de 2008
Respostas 2
Participantes 2