k_satish0101 0 Newbie Poster

my application is to reserv a resourse by entering start time and end time before reserving i need to check the availability in the database

My problem is (for eg)i 'm requesting reserving by entering startime as 10.00 and end time as 14.00 on a particular day

if they had already reserved in Database with 11.00 to 16.00 on the same day I should not allow the user to reserve

i dont know how to solve this problem but i tried with some way it does't give solution for my problem

if(dbDate.equals(rs.getString(2)))
{
if((stime1 >= rs.getDouble(3))||(etime1 <= rs.getDouble(4)))
{
msg = "Scheduled time is already exist try for different timing";
request.setAttribute("errmsg",msg);
pageContext.forward("schedule.jsp");
}
}
}
else
{
insert into database


}

Plz help thank u in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.