Anonymous
Anonymous asked in Computers & InternetProgramming & Design · 1 decade ago

How can I update data using a GUI in netbeans?

I am working on a project for programming a database using java and SQL in netbeans and I need to be able to edit a record using a GUI but I do not know what to do

here is an add function I was able to get working

private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

addRecord();

}

public void addRecord()

{

connectJavaDB();

try

{

connectOrderDB();

int ItemNumber = Integer.parseInt(ItemText.getText());

String Description = DescriptionText.getText();

String insert = "INSERT INTO MENU (ITEM_NUMBER, DESCRIPTION_OF_ITEM)";

insert = insert + "VALUES(" + ItemNumber + ",'" + Description + "')";

stmt.execute(insert);

// result.next();

//move to first record

//if(result != null && result.next()

1 Answer

Relevance
Still have questions? Get your answers by asking now.