
i am using following one .please give me the correct one.i used grigorian calendar
if(hour<=13) {
i couldn't worked with this if condition please help me

Change the table name 'leave' as it contradicts. Then use the following code:
if(hour<=13) {
java.util.Date date=new java.util.Date();
SimpleDateFormat sdf1=new SimpleDateFormat("yyyy-MM-dd");
String d=sdf1.format(date);
SimpleDateFormat sdf2=new SimpleDateFormat("hh:mm:ss");
String t=sdf2.format(date);
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/roseindia", "root", "root");
Statement st=con.createStatement();
PreparedStatement ps = con.prepareStatement("insert into leavetable(empid,username,datefield,ip_address,status,morning) values(?,?,?,?,?,?)");
ps.setInt(1,1);
ps.setString(2,"roseindia");
ps.setString(3,d);
ps.setString(4,"192.123.10.111");
ps.setString(5,"L");
ps.setString(6,t);
ps.executeUpdate();
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.