Here it is
Method body
public void callDatabase(String date1, String date2){
PreparedStatement stmt=con.prepareStatement("select absentdt, period from stu_attendancemaster where classid=70 AND absentdt BETWEEN '"+date1+"' AND '"+date2+"' ");
ResultSet rs=stmt.executeQuery();
while(rs.next())
{
//get data here
}
}
Method call
String d1,d2; //initialize
callDatabase(d1,d2);
3
solved How to fetch database values between two dates [closed]