Sunday, February 8, 2015

date and time insert and select into mysqlDatabase using java


 //******************************** It is  INSERT Query Modal add calendar
    public void insertCalendarModalData(String meetingTpeModal,String meetingTitleModal,String meetingRoomModal,String insetStartTimeFullcalendar,String onestartTime,String twostartTime,String meetingDescriptionModal,String kaniz){
           System.out.println("kaniz");
           boolean fg = true;
           con = dbc.connectDB();

            if (con == null) {
                fg = false;
            }
       
       if (fg) {
        try {

               st = con.createStatement();
    
      query = "insert into rbs_room_booking(type_id,title,room_id,booking_date,start_time,end_time,description,entered_by,entry_timestamp) values ('"+meetingTpeModal+"','"+meetingTitleModal+"','"+meetingRoomModal+"','"+insetStartTimeFullcalendar+"','"+onestartTime+"','"+twostartTime+"','"+meetingDescriptionModal+"','"+kaniz+"','2015-01-31 15:37:17')";
       System.out.println("Query" + query);
       st.execute(query);

   

       } catch (SQLException sq) {       
         sq.printStackTrace();
       } finally {
         try {
             if (rs != null) {
                 rs.close();
             }
       
             con.close();
         } catch (SQLException ex) {
             ex.printStackTrace();
         }
       }
       }
    
              // return "subBankInformation";// As void not String
           }

   
     
   
    public List selectCalendarModalData() {   //** It is select query tree menu Need
         List roomBookingInfoDataList = new ArrayList();

         boolean fg = true;
         this.con = this.dbc.connectDB();

         if (this.con == null) {
             fg = false;
         }

         if (fg) {
             try {
                 this.st = this.con.createStatement();

              
               
                 String query = "SELECT booking_id,type_id,title,room_id,booking_date,start_time,end_time,description FROM rbs_room_booking";
                 this.rs = this.st.executeQuery(query);

                 while (this.rs.next()) {
                     MultiSetupModalInfo multiSetupModalInfo = new MultiSetupModalInfo();
                  
                     multiSetupModalInfo.setBooking_id(rs.getString("booking_id"));
                     multiSetupModalInfo.setType_id(rs.getString("type_id"));
                     multiSetupModalInfo.setTitle(rs.getString("title"));
                     multiSetupModalInfo.setRoom_id(rs.getString("room_id"));
                     multiSetupModalInfo.setStart_time(rs.getString("start_time"));
                     multiSetupModalInfo.setEnd_time(rs.getString("end_time"));
                
                     roomBookingInfoDataList.add(multiSetupModalInfo);
                 }
             } catch (SQLException sq) {
                 System.out.println("Tree  data  Info Query Exception "
                         + sq.getMessage());
                 try {
                     if (this.rs != null) {
                         this.rs.close();
                     }
                   

                     this.con.close();
                 } catch (SQLException ex) {
                     ex.printStackTrace();
                 }
             } finally {
                 try {
                     if (this.rs != null) {
                         this.rs.close();
                     }

                     this.con.close();
                 } catch (SQLException ex) {
                     ex.printStackTrace();
                 }
             }
         }

         return roomBookingInfoDataList;
     }
   

Meta data and json

What is meta data ?



What is json ?
 If  I get value from database with coloum name , it is called json.