Page 111 - IP
P. 111

try


                   {        Class.forName("java.sql.Driver");


                           Connection con =
               DriverManager.getConnection("jdbc:mysql://localhost:3306/employee","root","1

               234");

                           Statement stmt =  con.createStatement();


                           String query= "INSERT INTO work_details

               VALUES('"+leave+"','"+overtime+"','"+eno+"','"+month+"','"+year+"');";

                           JOptionPane.showMessageDialog(this,query);


                           stmt.executeUpdate(query);


                   }

                   catch(Exception e)


                   {        JOptionPane.showMessageDialog(this,e.getMessage());


                   }





















               2.
   106   107   108   109   110   111   112   113   114   115   116