Java prog#17.How to update/Edit a data in SQLite (MySql) Database in Netbeans java

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2024

Комментарии • 90

  • @mayurgudi3282
    @mayurgudi3282 7 лет назад +3

    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 ..

  • @sauravdangol
    @sauravdangol 10 лет назад +3

    Thanks a lot. Helped me overcome this major obstacle

  • @manishlamichhane4592
    @manishlamichhane4592 12 лет назад

    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 :)

  • @ProgrammingKnowledge
    @ProgrammingKnowledge  12 лет назад +1

    see video no. 9 .......Java prog#9. Get value from JTable and set it to jtextfield in Netbeans Java and Sqlite (mysql)

  • @محمدمحمد-ص4غ2ظ
    @محمدمحمد-ص4غ2ظ Год назад

    You best the people in programming
    Im arabic

  • @chethanarasangi2001
    @chethanarasangi2001 5 месяцев назад

    Thank you so much. You saved me ❤

  • @monodeepsantra3358
    @monodeepsantra3358 2 года назад

    Thank you so much sir ☺️

  • @lucaspacheco883
    @lucaspacheco883 9 лет назад

    Thx "Raj", good work!

  • @nefty420
    @nefty420 10 лет назад

    Seriously. Thank you SO much!

  • @emilytheb820
    @emilytheb820 10 лет назад +1

    Thank you so much .Perfect

  • @sherwinpadilla6299
    @sherwinpadilla6299 11 лет назад +1

    Sir, may I just ask, how to view what I search and display it at jtable, tnx in advance.

  • @joodmohammed1958
    @joodmohammed1958 3 года назад

    Hi,
    Nice work.
    Could you please tell me how to add data to jTable using keyboard action and save to database using save button

  • @shafaq8419
    @shafaq8419 3 года назад

    thanks so much !!

  • @kejvinluga
    @kejvinluga 2 года назад

    Hello , can u help me , i want to update 3 table are same but diferent table name , how can i choose?

  • @Azmodan86
    @Azmodan86 9 лет назад +5

    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

    • @sainthaven15
      @sainthaven15 9 лет назад

      +Azmodan86 It still updates all the same items

    • @Azmodan86
      @Azmodan86 9 лет назад

      It worked for me mate...dunno why for you not. Can you post your code?

    • @xvAnnGvx
      @xvAnnGvx 9 лет назад

      +Azmodan86 thanx, it works!

    • @Azmodan86
      @Azmodan86 9 лет назад

      ;-)

  • @donzrag1
    @donzrag1 12 лет назад

    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

  • @1701032
    @1701032 9 лет назад +5

    I tried updating the table but somehow everything got updated into the same variable

    • @xvAnnGvx
      @xvAnnGvx 9 лет назад

      +Bijukaku same sh*t. can't find the problem

    • @KegsProduction
      @KegsProduction 7 лет назад

      make a unique key that will serve as identification if what the specific you want to update

    • @jhongutierrez5255
      @jhongutierrez5255 6 лет назад +1

      Kegs Production what do you mean sir? Unique key? How can i do that? Please sir i need it for my project

  • @I-believe-in-humanity
    @I-believe-in-humanity 9 лет назад

    wow, u r genius

  • @limkunze4159
    @limkunze4159 12 лет назад

    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

  • @excuse98
    @excuse98 12 лет назад +1

    how about in combobox not in textfields?

  • @bavenagopikrishnan6935
    @bavenagopikrishnan6935 5 лет назад

    thank you sooo much !!!

  • @akshaysatoskar7995
    @akshaysatoskar7995 11 лет назад

    hey hello sir...can u plz tell us how to update date column which is in database?

  • @vishwajeetmallan6304
    @vishwajeetmallan6304 6 лет назад

    U're amazing

  • @FirhansMaulana
    @FirhansMaulana 6 лет назад

    how to update the date bro? where the first column use auto increment.

  • @Israel_597
    @Israel_597 8 лет назад

    buena he gracias me salvaste !!!

  • @shishirahmed3095
    @shishirahmed3095 8 лет назад +2

    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+"'";

  • @Patrickteodoro15
    @Patrickteodoro15 9 лет назад +3

    im having an error at. pst = conn.preparedStatement;

    • @swatisharma3425
      @swatisharma3425 2 года назад +1

      Then you should use update quary() method instead of pst = conn. preparedStatement

  • @AashishBharat
    @AashishBharat 12 лет назад

    Sir, how do i add a powerpoint presentation or video into netbeans..????

  • @1978qwer2
    @1978qwer2 12 лет назад

    thanks

  • @maheshreddy920
    @maheshreddy920 12 лет назад

    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.

  • @michaelklimov6620
    @michaelklimov6620 11 лет назад

    same thing with me it only updates the jtable but sqlite is not updating....any solutions yet?

  • @ScoutSniper
    @ScoutSniper 10 лет назад

    if you get an error when deleting try closing the connection

  • @Myztyliz
    @Myztyliz 11 лет назад

    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...

  • @kautubh93
    @kautubh93 10 лет назад +2

    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

    • @DaddyDadBod
      @DaddyDadBod 10 лет назад

      i have the same problem

    • @nomikhan-st8bb
      @nomikhan-st8bb 10 лет назад

      i have also the same problem
      if anyone find the solution plzzz comment ..

    • @ErfanAhmed
      @ErfanAhmed 10 лет назад

      nomi khan
      me too !!

    • @KegsProduction
      @KegsProduction 7 лет назад

      you have already primary key ?

  • @mrsciencetv2526
    @mrsciencetv2526 11 лет назад

    save and update dont work while delete work without erro
    please help me

  • @osamaamin2531
    @osamaamin2531 6 лет назад

    thanks alott thanks thanks thanks

  • @amalsathyan5530
    @amalsathyan5530 4 года назад

    Getting error a lock could not be found within the time request

  • @piggfunny3677
    @piggfunny3677 4 года назад

    why the first value not changing but the other is ok
    Please help me to fix it 🙏🙏

  • @erickruanes1181
    @erickruanes1181 8 лет назад

    thanks sir :)

  • @sherwinpadilla6299
    @sherwinpadilla6299 11 лет назад

    my table is not updating even though I already a UpdateJtable, any other suggestion sir, tnx.

  • @RSJC_JOE
    @RSJC_JOE 9 лет назад

    ProgrammingKnowledge I didn't find the video where you have written the method update_table();

  • @AliDzakifikri
    @AliDzakifikri Год назад

    how to update data on other page

  • @Sanjay54251
    @Sanjay54251 8 лет назад

    i am having general error please tell me what i do

  • @microworksceo
    @microworksceo 12 лет назад

    me too, im not sure what is happening, i thought without quotes, but didnt help
    any ideas

  • @klainmesh2
    @klainmesh2 12 лет назад

    pst is error to me.. why is it?
    pst=conn.prepareStatement(sql);
    pst.execute();

  • @imagenigraphics
    @imagenigraphics 5 лет назад

    is this still working?

  • @anjubora1111
    @anjubora1111 7 лет назад

    pls tell us about your Update_table method. I cann't find your that video .

    • @KegsProduction
      @KegsProduction 7 лет назад

      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));
      }

  • @RockMcStone
    @RockMcStone 10 лет назад

    I wish they'd post the code

  • @SIDDHARTH8925
    @SIDDHARTH8925 10 лет назад

    i want to update date can any one plz help me out

  • @CrunkKidd808
    @CrunkKidd808 10 лет назад

    does this work on jdbc?

  • @brainyrichards4537
    @brainyrichards4537 7 лет назад

    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;

    • @thunder1kid
      @thunder1kid 7 лет назад +1

      PreparedStatement is like the command prompt for sql

  • @nomikhan-st8bb
    @nomikhan-st8bb 10 лет назад


    i M trying to Update and delete the records its updating and deleting from jTable
    Its not changing From My sqdb..

    • @honglekhanh1865
      @honglekhanh1865 10 лет назад

      Connection conn;
      ResultSet rs;
      PreparedStatement pst;
      don't initialize be "null"

    • @ErfanAhmed
      @ErfanAhmed 10 лет назад

      Hong Le Khanh
      it didn't work :/
      there is no change on sqlite database

    • @honglekhanh1865
      @honglekhanh1865 10 лет назад

      Erfan Ahmed
      close connect
      finally {
      try {
      rs.close();
      pst.close();
      } catch (SQLException ex) {
      Logger.getLogger(Employee_info.class.getName()).log(Level.SEVERE, null, ex);
      }
      }

  • @kyamranahmed653
    @kyamranahmed653 11 лет назад

    deleting und update funktioniert nicht so richtig.

  • @sibnathin428
    @sibnathin428 6 лет назад

    what is pst?

    • @Mimeys
      @Mimeys 6 лет назад

      PreparedStatement pst;

  • @donzrag1
    @donzrag1 12 лет назад

    amd im using mysql

  • @jeanrodrigues6249
    @jeanrodrigues6249 2 года назад

    Value

  • @sophayon6702
    @sophayon6702 8 лет назад

    Help me

  • @lananhtran8146
    @lananhtran8146 8 лет назад

    how to jCalendar?

  • @محمدمحمد-ص4غ2ظ
    @محمدمحمد-ص4غ2ظ Год назад

    Going to air

  • @jeanrodrigues6249
    @jeanrodrigues6249 2 года назад

    Code

  • @cnxcadde7217
    @cnxcadde7217 4 года назад

    Thanks

  • @sandeepgupta6526
    @sandeepgupta6526 3 месяца назад

    Thanks