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 ..
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
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...
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+"'";
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
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;
see video no. 9 .......Java prog#9. Get value from JTable and set it to jtextfield in Netbeans Java and Sqlite (mysql)
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 ..
You best the people in programming
Im arabic
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 :)
Thank you so much. You saved me ❤
how about in combobox not in textfields?
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
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
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?
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...
Hello , can u help me , i want to update 3 table are same but diferent table name , how can i choose?
hey hello sir...can u plz tell us how to update date column which is in database?
Sir, how do i add a powerpoint presentation or video into netbeans..????
im having an error at. pst = conn.preparedStatement;
Then you should use update quary() method instead of pst = conn. preparedStatement
Sir, may I just ask, how to view what I search and display it at jtable, tnx 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
my table is not updating even though I already a UpdateJtable, any other suggestion sir, tnx.
pst is error to me.. why is it?
pst=conn.prepareStatement(sql);
pst.execute();
how to update the date bro? where the first column use auto increment.
save and update dont work while delete work without erro
please help me
Getting error a lock could not be found within the time request
Thank you so much sir ☺️
how to update data on other page
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 ?
Thx "Raj", good work!
Hi,
Nice work.
Could you please tell me how to add data to jTable using keyboard action and save to database using save button
i am having general error please tell me what i do
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❤️
does this work on jdbc?
Yes.
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!
;-)
Thank you so much .Perfect
Seriously. Thank you SO much!
if you get an error when deleting try closing the connection
why the first value not changing but the other is ok
Please help me to fix it 🙏🙏
thanks so much !!
is this still working?
what is pst?
PreparedStatement pst;
deleting und update funktioniert nicht so richtig.
ProgrammingKnowledge I didn't find the video where you have written the method update_table();
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 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);
}
}
wow, u r genius
me too, im not sure what is happening, i thought without quotes, but didnt help
any ideas
buena he gracias me salvaste !!!
U're amazing
I wish they'd post the code
i want to update date can any one plz help me out
thank you sooo much !!!
how to jCalendar?
use javaFX
thanks alott thanks thanks thanks
thanks sir :)
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
thanks
amd im using mysql
Help me
Value
Code
Going to air
Thanks
Thanks