Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try{
- String sql = "Select descripcion,precio from detalle_factura_compra where factura="+Integer.parseInt(txtFactura.getText());
- PreparedStatement ps = con.conexion().prepareStatement(sql);
- try (ResultSet res = ps.executeQuery()) {
- Object datos[]= new Object[2];
- while(res.next()){
- for (int i = 0;i<2;i++){
- datos[i]= res.getObject(i+1);
- }
- modeloTabla.addRow(datos);
- }
- }
- } catch (SQLException ex) {
- Logger.getLogger(Consulta_Cliente.class.getName()).log(Level.SEVERE, null, ex);
- ex.printStackTrace();
- }
Add Comment
Please, Sign In to add comment