tutorial netbeans edit and update data from mysql database with netbeans java(vol.13)

tutorial netbeans-edit and update data from mysql database(vol.13)




Hello guys !!
Hows it going ??

Welcome back to masunduh2,last post,I’ve shared tutorial about how to delete data from mysql database with netbeans java swing part 12.
Today i will show you the next awesome tutorials part 13 how to edit and update data from mysql database with netbeans java swing.

Check this out !

still for same trick like the previous tutorials
Just create jbutton for execute or edit data and insert source code

How do that ??
Lets extreams !!

Drag and drop jbutton component for edit and update the data with java programs into mysql database.

right click jbutton for execute or edit and update data performe.
Events > action > actionPerformed.

in jbuttonActionPerformed block
Type or copy all syntax below :
 
try {
String val1 = id_text.getText(); // textfield name
String val2 = user_text.getText(); // textfield name
String val3 = pass_text.getText(); // textfield name
String val4 = age_text.getText(); // textfield name
String val5 = email_text.getText(); // textfield name

String sql = "update dataop set id='"+val1+"',username='"
            +val2+"',password='"+val3+"',age='"
            +val4+"',email='"
            +val5+"' where id='"
            +val1+"'";
pst=connect.prepareStatement(sql);
pst.execute();
JOptionPane.showMessageDialog(null, "has been Updated !");
        } catch (SQLException | HeadlessException e) 
        {
JOptionPane.showMessageDialog(null, e);
        }



Now, if no error in your java swing project you can run that programs

Click Run > choose Clean and build project.
Then, click run again > and select Run File.



Like image below
Screenshot
screenshot-tutorial netbeans edit and update data from mysql database with netbeans java(vol.13)

Watch video tutorial how to edit and update data  from mysql database with netbeans java swing part 13.


Please write comment,share it, and subscribed !
Don’t forget join on my fanspage now,ok  guys !

See you the next awesome and simple tutorials. Bye !




4 Responses to "tutorial netbeans edit and update data from mysql database with netbeans java(vol.13)"

Ads Inside Post