private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getSource() == jButton3)
{
int x = 0;
String s1 = jTextField12.getText();
String s2 = jTextField13.getText();
Date s3 = jXDatePicker15.getDate();//**Here i need a correct code to store the user's selected date into the database**.
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:xe", "Raju", "1209");
PreparedStatement ps = con.prepareStatement("insert into NEWFRAME values(?,?,?)");
ps.setString(1, s1);
ps.setString(2, s2);
ps.setDate(3, (java.sql.Date) s3);//Here also i need some correct code.
ResultSet rs = ps.executeQuery();
x++;
if (x > 0)
{
JOptionPane.showMessageDialog(jButton3, "Data Saved Successfully");
}
}
catch(Exception ex) { 的System.out.println(前); } }