Hello
guys !!
What’s
up
Welcome
back to masunduh2,last post,I’ve
shared tutorial about insert from input jtextfield into mysql database with
netbeans java swing part 11.
Today
i will show you how to delete data from mysql database with netbeans java swing
part 12.
How
do that ??
Ok
lets get started.
I hope you have read and following step by step in previous tutorials.
Drag
and drop jbutton component for delete data programs into mysql database.
right
click jbutton for execute or delete data performe.
Events
> action > actionPerformed.
in
jbuttonActionPerformed block
Type
or copy all syntax below :
String sql ="delete from dataop where id=?";
try {
pst=connect.prepareStatement(sql);
pst.setString(1, id_text.getText());
// id_text > jtextfield name
pst.execute();
JOptionPane.showMessageDialog(null, "has been Deleted !");
} 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
Watch
video tutorial how to delete data from
mysql database with netbeans java swing
part 12.
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
!
0 Response to "tutorial netbeans-delete data from mysql database(vol.12)"
Post a Comment