private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        String d = jTextField2.getText();
        String id = jTextField1.getText();
        String tgl1 = String.valueOf(jTable1.getValueAt(0, 4));
        int no = 1;
        int pers = 0;
        
        try {
            for(int i=0;i<dtm.getRowCount();i++) {
                try {
                    k.st = k.con.createStatement();
                    //String tampil = "SELECT * FROM datapengembalian WHERE id_smartcard = '" +id+ "';";
                    String tampil = "SELECT * FROM datapengembalian;";
                    k.rs = k.st.executeQuery(tampil);
                    while(k.rs.next()) {
                        no = Integer.parseInt(k.rs.getString("no_trans"));
                        no++;
                    }
                } catch(Exception e) {
                    JOptionPane.showMessageDialog(rootPane, "Error: " + e);
                }
            
                k.st = k.con.createStatement();
                String tambah = "INSERT INTO datapengembalian VALUES('" +no+ "','" +id+ "','" +tgl1+ "','" +tanggal1+ "','" +d+ "');";
                k.st.executeUpdate(tambah);
                JOptionPane.showMessageDialog(rootPane, "Data Berhasil Ditambahkan");
            }
            
            try {
                k.st = k.con.createStatement();
                String u = "UPDATE peminjaman SET status = 'Kembali' WHERE id_smartcard = '" +id+ "';";
                k.st.executeUpdate(u);
                JOptionPane.showMessageDialog(rootPane, "Data Berhasil Diupdate");
            } catch(Exception e) {
                JOptionPane.showMessageDialog(rootPane, "Error: " +e);
            }
            
            for(int l=0;l<dtm.getRowCount();l++) {
                try {
                    k.st = k.con.createStatement();
                    String t = "SELECT * FROM databuku WHERE id_buku = '" +String.valueOf(jTable1.getValueAt(l, 0)) + "';";
                    k.rs = k.st.executeQuery(t);
                    if(k.rs.next()) {
                        pers = Integer.parseInt(k.rs.getString("persediaan"));
                    }
                } catch(Exception e) {
                    JOptionPane.showMessageDialog(rootPane, "Error: " +e);
                }
                
                pers++;
                
                try {
                    k.st = k.con.createStatement();
                    String u1 = "UPDATE databuku SET persediaan = '" +pers+ "' WHERE id_buku = '" +String.valueOf(jTable1.getValueAt(l, 0))+ "';";
                    k.st.executeUpdate(u1);
                    JOptionPane.showMessageDialog(rootPane, "Data Berhasil Diupdate");
                } catch(Exception e) {
                    JOptionPane.showMessageDialog(rootPane, "Error: " +e);
                }
            }
            
            jTextField1.setText("");
            jButton2.setEnabled(false);
            jDateChooser1.setDate(null);
            jTextField2.setText("");
            jButton1.setEnabled(true);
            jButton3.setEnabled(false);
            HapusTabel();
        } catch(Exception e) {
            JOptionPane.showMessageDialog(rootPane, "Error: " +e);
        }
    }//GEN-LAST:event_jButton3ActionPerformed