Thank you very very much for this video .. Also other videos .. You made my life easier with this . I successfully completed the project because of your videos . I hope you succeed in your life at every stage ..
For those having prblems that it updates all the items in the database i used the following code: try { int row = jTable1.getSelectedRow(); String tableclick =(jTable1.getModel().getValueAt(row, 0).toString()); String value1=jTextField1.getText(); String value2=jTextField2.getText(); String value4=jTextField4.getText(); String value3=jTextField3.getText(); String value5=jTextField5.getText(); String sql ="update fumetti set sku='"+value1+"', nome='"+value2+"',prezzo='"+value4+"',uscita='"+value3+"',quantita='"+value5+"' where id ='"+tableclick+"'"; pst=conn.prepareStatement(sql); pst.execute(); JOptionPane.showMessageDialog(null, "Oggetto aggiornato"); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); }finally{ try{ pst.close(); rs.close(); }catch(Exception e){ } } Update_Table(); Hope it helps, i just added the int row = jTable1.getSelectedRow(); String tableclick =(jTable1.getModel().getValueAt(row, 0).toString()); and added in WHERE id ='"+tableclick+"'"; so it affects that item with the id selected in the table
hello, i want to ask that if i want to chance “empoyeeid" also how to make it? i have try and it show me "Updated" but actually the data didnt change anything. is it because of primary key? thanks
i found a problem with primary key . solve : String sql="update Employeeinfo set employeeid='"+value1+"',name='"+value2+"',surname='"+value3+"',age='"+value4+"',username='"+value5+"',password='"+value6+"' where employeeid='"+value1+"'";
When i updating the table. it exected and shows perfectly in the Jframe.. but those values are not updated in the actual database. plz help me out sir.
Hi Sir...I've tried this code but it is having an error to me...After Updating the jtable updated but when I checked my sqlite database the data values doesn't updated...plz help me with this...
the Update_Table is just the populate/refresh the table example: public void Update_table(){ //populate table of qoutation summary try { String sql = "Select * from tablenameinDB"; pst = conn.prepareStatement(sql); rs = pst.executeQuery(); tablename.setModel(DbUtils.resultSetToTableModel(rs)); }
String sql="update Employeeinfo set employeeid='"+value1+"', name='"+value2+"' where employeeid='"+value1+"' " pst = conn.preStatement(sql); pst.execute(); please what does ( pst = conn.prepareStatement(sql); ) mean and what is its function???????? again what does ( pst.execute(); ) mean???????????????? Again i want you to get me a brief explanation of these two declarations and their use. ResultSet rs = null; PreparedStatement pst = null;
Thank you very very much for this video ..
Also other videos ..
You made my life easier with this .
I successfully completed the project because of your videos .
I hope you succeed in your life at every stage ..
Thanks a lot. Helped me overcome this major obstacle
I was having problem in updating my db and this video helped me find out the reason...i didnt find it else where thankyou sir :)
see video no. 9 .......Java prog#9. Get value from JTable and set it to jtextfield in Netbeans Java and Sqlite (mysql)
You best the people in programming
Im arabic
Thank you so much. You saved me ❤
Thank you so much sir ☺️
Thx "Raj", good work!
Seriously. Thank you SO much!
Thank you so much .Perfect
Sir, may I just ask, how to view what I search and display it at jtable, tnx in advance.
Hi,
Nice work.
Could you please tell me how to add data to jTable using keyboard action and save to database using save button
thanks so much !!
Hello , can u help me , i want to update 3 table are same but diferent table name , how can i choose?
For those having prblems that it updates all the items in the database i used the following code:
try {
int row = jTable1.getSelectedRow();
String tableclick =(jTable1.getModel().getValueAt(row, 0).toString());
String value1=jTextField1.getText();
String value2=jTextField2.getText();
String value4=jTextField4.getText();
String value3=jTextField3.getText();
String value5=jTextField5.getText();
String sql ="update fumetti set sku='"+value1+"', nome='"+value2+"',prezzo='"+value4+"',uscita='"+value3+"',quantita='"+value5+"' where id ='"+tableclick+"'";
pst=conn.prepareStatement(sql);
pst.execute();
JOptionPane.showMessageDialog(null, "Oggetto aggiornato");
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}finally{
try{
pst.close();
rs.close();
}catch(Exception e){
}
}
Update_Table();
Hope it helps, i just added the
int row = jTable1.getSelectedRow();
String tableclick =(jTable1.getModel().getValueAt(row, 0).toString());
and added in WHERE id ='"+tableclick+"'"; so it affects that item with the id selected in the table
+Azmodan86 It still updates all the same items
It worked for me mate...dunno why for you not. Can you post your code?
+Azmodan86 thanx, it works!
;-)
sir!! i want to know how to edit data row wise and how do u import table data into jTextfields !!plz plz let me know !! thanks in advance
I tried updating the table but somehow everything got updated into the same variable
+Bijukaku same sh*t. can't find the problem
make a unique key that will serve as identification if what the specific you want to update
Kegs Production what do you mean sir? Unique key? How can i do that? Please sir i need it for my project
wow, u r genius
hello, i want to ask that if i want to chance “empoyeeid" also how to make it?
i have try and it show me "Updated" but actually the data didnt change anything.
is it because of primary key? thanks
how about in combobox not in textfields?
thank you sooo much !!!
hey hello sir...can u plz tell us how to update date column which is in database?
U're amazing
how to update the date bro? where the first column use auto increment.
buena he gracias me salvaste !!!
i found a problem with primary key . solve : String sql="update Employeeinfo set employeeid='"+value1+"',name='"+value2+"',surname='"+value3+"',age='"+value4+"',username='"+value5+"',password='"+value6+"' where employeeid='"+value1+"'";
Thanks man, I had the same issue!
Thank u sir❤️
im having an error at. pst = conn.preparedStatement;
Then you should use update quary() method instead of pst = conn. preparedStatement
Sir, how do i add a powerpoint presentation or video into netbeans..????
thanks
When i updating the table. it exected and shows perfectly in the Jframe.. but those values are not updated in the actual database. plz help me out sir.
same thing with me it only updates the jtable but sqlite is not updating....any solutions yet?
if you get an error when deleting try closing the connection
Hi Sir...I've tried this code but it is having an error to me...After Updating the jtable updated but when I checked my sqlite database the data values doesn't updated...plz help me with this...
i M trying to Update and delete the records its updating and deleting records from JTable BUT
Its not Deleting Records From My Database..
Help Me Out
i have the same problem
i have also the same problem
if anyone find the solution plzzz comment ..
nomi khan
me too !!
you have already primary key ?
save and update dont work while delete work without erro
please help me
thanks alott thanks thanks thanks
Getting error a lock could not be found within the time request
why the first value not changing but the other is ok
Please help me to fix it 🙏🙏
thanks sir :)
my table is not updating even though I already a UpdateJtable, any other suggestion sir, tnx.
ProgrammingKnowledge I didn't find the video where you have written the method update_table();
how to update data on other page
i am having general error please tell me what i do
me too, im not sure what is happening, i thought without quotes, but didnt help
any ideas
pst is error to me.. why is it?
pst=conn.prepareStatement(sql);
pst.execute();
is this still working?
pls tell us about your Update_table method. I cann't find your that video .
the Update_Table is just the populate/refresh the table
example:
public void Update_table(){ //populate table of qoutation summary
try
{
String sql = "Select * from tablenameinDB";
pst = conn.prepareStatement(sql);
rs = pst.executeQuery();
tablename.setModel(DbUtils.resultSetToTableModel(rs));
}
I wish they'd post the code
i want to update date can any one plz help me out
does this work on jdbc?
Yes.
String sql="update Employeeinfo set employeeid='"+value1+"', name='"+value2+"' where employeeid='"+value1+"' "
pst = conn.preStatement(sql);
pst.execute();
please what does ( pst = conn.prepareStatement(sql); ) mean and what is its function????????
again what does ( pst.execute(); ) mean????????????????
Again i want you to get me a brief explanation of these two declarations and their use.
ResultSet rs = null;
PreparedStatement pst = null;
PreparedStatement is like the command prompt for sql
i M trying to Update and delete the records its updating and deleting from jTable
Its not changing From My sqdb..
Connection conn;
ResultSet rs;
PreparedStatement pst;
don't initialize be "null"
Hong Le Khanh
it didn't work :/
there is no change on sqlite database
Erfan Ahmed
close connect
finally {
try {
rs.close();
pst.close();
} catch (SQLException ex) {
Logger.getLogger(Employee_info.class.getName()).log(Level.SEVERE, null, ex);
}
}
deleting und update funktioniert nicht so richtig.
what is pst?
PreparedStatement pst;
amd im using mysql
Value
Help me
how to jCalendar?
use javaFX
Going to air
Code
Thanks
Thanks