Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- Connection lig = DriverManager.getConnection("jdbc:mysql://localhost/fppd", "root", "");
- PreparedStatement stmt = lig.prepareStatement(
- "SELECT Data, Local, NumeroProva, Rio FROM `calendario` WHERE NumeroProva = ? AND Escalao = ? ");
- stmt.setInt(1, Integer.parseInt(txtProcurarNumero.getText()));
- stmt.setString(2, txtescalao.getText());
- ResultSet res = stmt.executeQuery();
- while (res.next()) {
- txtnumeroprova.setText(res.getString("NumeroProva"));
- txtdata.setText(res.getString("Data"));
- txtlocal.setText(res.getString("Local"));
- txtrio.setText(res.getString("Rio"));
- JOptionPane.showMessageDialog(frame, "Prova encontrada");
- }
- res.close();
- } catch (SQLException e1) {
- JOptionPane.showMessageDialog(frame, e1.getLocalizedMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement