Insert Date in mysql.
java.sql.Date sqldate = new java.sql.Date(jd1.getDate().getTime());
java.sql.Date sqldate1 = new java.sql.Date(jd2.getDate().getTime());
try
{
Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3305/commity","root","root");
PreparedStatement pst=(PreparedStatement) con.prepareStatement("insert into group1 values(?,?,?,?,?,?)");
pst.setString(1,jTextField1.getText());
pst.setDate(2,sqldate );
pst.setDate(3, sqldate1);
pst.setDouble(4,Double.parseDouble(jTextField2.getText()));
pst.setDouble(5,Double.parseDouble(jTextField3.getText()));
pst.setInt(6,Integer.parseInt(jTextField4.getText()));
pst.executeUpdate();
reset();
}
catch(Exception e)
{
System.out.println(e);
}