Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String a,b,c,f;
- int d,e;
- a = jTextField1.getText();
- b = jTextField2.getText();
- c = jTextField3.getText();
- d = Integer.parseInt(jTextField4.getText());
- e = Integer.parseInt(jTextField5.getText());
- f = jTextField6.getText();
- try {
- Class.forName("java.mysql.DriverManager");
- Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/dash","root","root");
- Statement stmt = (Statement) con.createStatement();
- stmt.executeUpdate("insert into growth values('"+a+"','"+b+"','"+c+"','"+d+"','"+e+"','"+f+"',);");
- JOptionPane.showMessageDialog(this," record added");
- } catch (ClassNotFoundException | SQLException ex) {
- Logger.getLogger(cnnect1.class.getName()).log(Level.SEVERE, null, ex);
- }
Add Comment
Please, Sign In to add comment