how can i get days from two dates one date will be from the data base and i can retrive it properly but how can i compare it with the current system date? im able to store current date into database using settimestamp function but cant use it for comparing i have used jodatime but cant get it through
// TODO add your handling code here:
JOptionPane.showMessageDialog(null,"Fine test");
try{
conn = Connect.ConnectDB();
String qw="select bookid,date from borrow";
//String date1="Select Cast ((JulianDay(ToDate) - JulianDay(FromDate)) As Integer)";
pst = conn.prepareStatement(qw);
rs=pst.executeQuery();
while(rs.next())
{
String fine=rs.getString("date");
//String today=Timestamp(System.currentTimeMillis()
//String date1="Select Cast ((JulianDay() - JulianDay(fine)) As Integer)";
//pst = conn.prepareStatement(date1);
//DateTime ret1=formatter.parseDateTime(df.format(dateobj));
// DateTime dt = formatter.parseDateTime(fine);
//days = Days.daysBetween(dt,dt).getDays();
// int n=ChronoUnit.DAYS.between(fine,fine);
JOptionPane.showMessageDialog(null,"Days are"+fine);
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Fine error"+e);
}
}
private void formWindowClosed(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
try{
conn.commit();
conn.close();
}
catch(Exception e)
{}
}