Jamsiya N P
question
1 Answer(s)      a year and 10 months ago
Posted in : Java Beginners

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

View Answers

July 12, 2011 at 5:17 PM


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();
}









Related Pages:
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
Question
Question   When there is an exception in my program how java runtime system handles
question
question  dear sir/madam my question is how to compare two text format in java..we are java beginners..so we need the complete source code for above mentioned question...we have to compare each and every word
question
question  Dear sir i had some typing mistake at previous question so its my humble request to let me know the steps to start the tomcat6 under the tomcat directory
question
question  Gud morning sir, I have asked u some question regarding jsp in saturaday for that i didnot find any answere in which u send me the some of the links.U have asked me the specify some details. There is a entity name
Question?
Question?  My question is how to: Add a menu bar to the program with a File menu. In the File menu, add a submenu (JMenuItem) called About. When the user clicks on the About menu item, display a JOptionPane message dialog

Ask Questions?

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.