bernadlosini 0 Newbie Poster

These are my three functions explaining sql functions update and delete functions .can any body help me to write the buttonactionperformedfunction?

public boolean editBus(int  busid,String name,int seats) {
    boolean bEdited = false;
    try {

        updatebus.clearParameters();
        updatebus.setString(1, name);
        updatebus.setInt(2,seats);

        updatebus.executeUpdate();
        bEdited = true;
    } catch(SQLException sqle) {
        sqle.printStackTrace();
    }
    return bEdited;
}

here update button function

private void  editActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }

my delete function

public boolean deletebus(int id) {
    boolean bDeleted = false;
    try {
        deletebus.clearParameters();
        deletebus.setInt(1, id);
        deletebus.executeUpdate();
        bDeleted = true;
    } catch (SQLException sqle) {
        sqle.printStackTrace();
    }
    return bDeleted;
}

deletebutton function

private void  deleteActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }

please anyone help me.thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.