I am getting a Null Pointer Exception. And i have used the long text data type in the ms access table to for date and description
try
{
int z1=1,z2=2;
String s=JOptionPane.showInputDialog("enter the date(DD/MM/YEAR)");
String s1=JOptionPane.showInputDialog("enter data into your dairy");
pstmt=conn.prepareStatement(" INSERT INTO Table2(date,description) values(?,?)");
pstmt.setString(z1, s);
pstmt.setString(z2, s1);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Data enterd successfully");
update1();
close();
}
catch(Exception e1)
{
JOptionPane.showMessageDialog(null, "Data Insertion failed.This date may already exist or may be some other error");
JOptionPane.showMessageDialog(null, "ERROR:"+e1.getMessage());
}
I have used data type long text for date and description in the ms access table.