0

Every other button is working fine only problem is with the save button. I am doing project in netbeans and it is not showing any errors eighter yet data is not getting into database from java GUI

        b1.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed (ActionEvent e)

            String fname=t1.getText();
            String lname=t2.getText();
            int age=Integer.parseInt(t3.getText());
            String city=t4.getText();
            String State=t5.getText();

            try{
                rs.moveToInsertRow();//moves cursor to new row

                rs.updateString("Fname", fname);
                rs.updateString("Lname", lname);
                rs.updateInt("age", age);
                rs.insertRow();

                JOptionPane.showMessageDialog(null, "updated!");
                //close two variable
                st.close();
                rs.close();

               }
            catch(Exception ex){

            }

        }
    });
mKorbel
  • 109,525
  • 20
  • 134
  • 319
Ojas Kale
  • 2,067
  • 2
  • 24
  • 39

0 Answers0