Java prog#16.Deleting Data from an SQLite (MySql) Database in Netbeans java
Vložit
- čas přidán 8. 05. 2012
- -----------------Online Courses to learn---------------------------
Java - bit.ly/2H6wqXk
C++ - bit.ly/2q8VWl1
AngularJS - bit.ly/2qebsLu
Python - bit.ly/2Eq0VSt
C- bit.ly/2HfZ6L8
Android - bit.ly/2qaRSAS
Linux - bit.ly/2IwOuqz
AWS Certified Solutions Architect - bit.ly/2JrGoAF
Modern React with Redux - bit.ly/2H6wDtA
MySQL - bit.ly/2qcF63Z
---------------------Follow--------------------------------------------
My Website - www.codebind.com
My Blog - goo.gl/Nd2pFn
My Facebook Page - goo.gl/eLp2cQ
Google+ - goo.gl/lvC5FX
Twitter - / programmingknow
Pinterest - goo.gl/kCInUp
Text Case Converter - goo.gl/pVpcwL
------------------------Stuff I use to make videos ------------------
Stuff I use to make videos
Windows notebook - amzn.to/2zcXPyF
Apple MacBook Pro - amzn.to/2BTJBZ7
Ubuntu notebook - amzn.to/2GE4giY
Desktop - amzn.to/2zct252
Microphone - amzn.to/2zcYbW1
notebook mouse - amzn.to/2BVs4Q3
-----------------Facebook Links ---------------------------------------
ProgrammingKnowledgeLear...
AndroidTutorialsForBegin...
Programmingknowledge
CppProgrammingLanguage
JavaTutorialsAndCode
SQLiteTutorial
UbuntuLinuxTutorials
EasyOnlineConverter
netbeans java tutorial
Deleting Data from an SQL Table in Netbeans java
Deleting Data in a SQL Database in Netbeans java
java netbeans and Mysql/SqLite (sql delete statement)
remove Data in a SQL Database in Netbeans java
iit Learn java netbeans
java tutorial netbeans
got it :) and a lill help to those who are still straggling... Sting Sql="detele from Table_Name where column_name =?";
try{ pst.conn.prepareStatement(sql);
pst.setString(1, textField1.getText());
pst.execute();
UpdateTabble();
pst.close(); //only close the pst
}
catch(){}
still useful in 2019. Thanks a lot!
Thank you for the video, very helpful.
Followed everything to a T, and everything works thx :D
I want to find out, whats the code i can use (in netbeans/java) to delete data in a relational database? i have two tables related by Customer ID. I want when the user enters customer ID and Ticket ID (A field in one of the tables) to have the data in the respective tables deleted.
Hhank you, you helped me a lot
Thanks for the tutorial.
Just follow his instruction and
Try putting this #1 :in the Table_EmployeeMouseClicked method.
#1 finally { try {rs.close(); pst.close();}catch(Exception e){}}
yeah It works . Thanks buddy !
Mmmm did exactly the same things but i get the error "unable to open database file"
thanks for your help really ! And i have a question how can i add Row to JTable automatically ?
i don't get any error on the delete button and no data is being deleted. how come yours works yet you didn't close the pst and the rs? please help
close ur database and open it once again. or refresh ur database . I think the problem will be solved.
what is this pst ??
What is PST.conn etc???
Is it a imported class or is it a variable?????
thancs for you DR
Thank Q REYAN PAPA~ It works ^^
i wonder what you have inside that update ()
i having the same problem...my data is not deleted yet...n i a refresh my database...but is still appear...wat should i do?
Thanks :)
thanks alot god bess you
Terima kasih :)
also want to delete name and age then how we write it in string?
Thanks. The problem was that I didn't close my connection with the "finally" code after the "try... catch". But it's strange that the save and everything else worked well... Anyway, problem solved!
hello,.
my data on DB are not delete.i tried to refresh DB and close DB and open again. , but it 's not work..
what to do now..
But i Request you to please Explain the COMMANDS also so people can understand the working.
Yeah me too my data is not deleted in sqlite Database i tried refreshing and reopening but the problem insist
Please help me, i need it urgently
when press to table, how to make it come out on the text field ? the code did not shown...please help
I have a question plz , when i add the code of delete data it show me an exception said database locked i think i did exactly as u have done and u didnt have this problem ? what did i Miss plz plz its very urgent
Thanks soo much.But i can't still delete from my sql database.I have refreshed database and checked and data still remains.The same applies to my "update" button.Thanks soo much and hope to hear from you soon.
Sir, what is PST ? and which video i can see Pst ?
prepared statement
My data is not deleted. Do you have any ideia why? My code is exactly as yours...
Thanks brother for your Tutorials.
Brother , I made a program same as yours 16th tutorial, but my jTable's only one row is Deleted. After one row, no row is deleted.
String sql = "delete from customer_info where cus_id = ?";
try{
pst = conn.prepareStatement(sql);
pst.setString(1, cid_txt.getText());
pst.execute();
JOptionPane.showMessageDialog(null, "Data Deleted");
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
Update_table();
My table doesn't delete them, help
No it doesn't.... If I delete data from table it will only be deleted in the table not in the database.... I have that problem please help...
Hi guys try to add after catch
finally{
try{
ps.close();
rs.close();
}catch(Exception e){
}
}
it works in my program. Hope it hepls
plz i have a question, if i opned this program its works deleted but the data is not deleted inside the sqlite, why?
java.lang.nullpointerexception :( What's wrong?
Same here...can't figure it out. Did u find out?
Hey everyone, I made a short 3 minute tutorial that covers how to update and delete data in a database using Java. Check it out here: czcams.com/video/NPYj9Z5k1kY/video.html