net.proteanit.sql.DbUtils Java Examples

The following examples show how to use net.proteanit.sql.DbUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Patient_Admit_Room.java    From Hospital-Management with GNU General Public License v3.0 6 votes vote down vote up
private void Get_Data1(){
    String sql="select PatientID as 'Patient ID', PatientName as 'Patient Name',Gen as 'Gender',BG as 'Blood Group' from Patientregistration order by PatientName";
    try{
        con=Connect.ConnectDB();
        pst=con.prepareStatement(sql);
        rs= pst.executeQuery();
        jTable1.setModel(DbUtils.resultSetToTableModel(rs));
     }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
     }
}
 
Example #2
Source File: Patient_Admit_Room.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void GetRecord(){
    String sql="select DoctorID as 'Doctor ID', DoctorName as 'Doctor Name' from Doctor order by DoctorName";  
    try{
       con=Connect.ConnectDB();
       pst=con.prepareStatement(sql);
       rs= pst.executeQuery();
       jTable2.setModel(DbUtils.resultSetToTableModel(rs));
    }catch(Exception e){
           JOptionPane.showMessageDialog(null, e);
    }
}
 
Example #3
Source File: RoomPanel.java    From Java-Simple-Hotel-Management with GNU General Public License v3.0 5 votes vote down vote up
private void populateRoomTypeTable()
{
    //System.out.println(tabbedPane.getSelectedIndex());
    result = roomdb.getRoomType();
    table_roomType.setModel(DbUtils.resultSetToTableModel(result));
    roomdb.flushAll();
}
 
Example #4
Source File: Patient_Admit_roomRec1.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
     String sql="Select PatientRegistration.PatientID as 'Patient ID',PatientRegistration.PatientName as 'Patient Name',PatientRegistration.Gen as 'Gender',PatientRegistration.BG as 'Blood Group',Disease,AdmitDate as 'Admit Date',Room.RoomNo as 'Room No',Doctor.DoctorID as 'Doctor ID',DoctorName as 'Doctor Name',AdmitPatient_Room.AP_Remarks as 'Remarks' from Room,Doctor,PatientRegistration,AdmitPatient_Room where Room.RoomNo=AdmitPatient_Room.RoomNo and Doctor.DoctorID=AdmitPatient_Room.DoctorID and PatientRegistration.PatientID=AdmitPatient_Room.PatientID order by admitdate";
     try{
     pst=con.prepareStatement(sql);
      rs= pst.executeQuery();
     jTable1.setModel(DbUtils.resultSetToTableModel(rs));
     }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
     }
}
 
Example #5
Source File: Patient_Discharge_roomRec2.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
         try{
         String sql="Select PatientRegistration.PatientID as 'Patient ID',PatientRegistration.PatientName as 'Patient Name',PatientRegistration.Gen as 'Gender',PatientRegistration.BG as 'Blood Group',Disease,AdmitDate as 'Admit Date',Room.RoomNo as 'Room No',RoomCharges as 'Room Cahrges',Doctor.DoctorID as 'Doctor ID',DoctorName as 'Doctor Name',DischargeDate as 'Discharge Date',DP_Remarks as 'Remarks' from Room,Doctor,PatientRegistration,AdmitPatient_Room,DischargePatient_Room where Room.RoomNo=AdmitPatient_Room.RoomNo and Doctor.DoctorID=AdmitPatient_Room.DoctorID and PatientRegistration.PatientID=AdmitPatient_Room.PatientID  and AdmitPatient_Room.PatientID= DischargePatient_Room.admitID order by Dischargedate";
         pst=con.prepareStatement(sql);
          rs= pst.executeQuery();
         jTable1.setModel(DbUtils.resultSetToTableModel(rs));
         }catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
          
}
    }
 
Example #6
Source File: Room.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
     String sql="select RoomNo as 'Room No.',RoomType as 'Room Type', RoomCharges as 'Room Charges',RoomStatus as 'Room Status' from Room";
     try{
         pst=con.prepareStatement(sql);
          rs= pst.executeQuery();
         Room_table.setModel(DbUtils.resultSetToTableModel(rs));
         }catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
          
}}
 
Example #7
Source File: Bill_Room.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates new form Bill_Room
 */
private void Get_Data1(){
  try{
    con=Connect.ConnectDB();
   String sql="select PatientRegistration.PatientID as 'Patient ID', PatientName as 'Patient Name',sum(serviceCharges) as 'Service Charges' from Services,PatientRegistration where Services.PatientID=PatientRegistration.PatientID group by PatientRegistration.PatientID,PatientName order by PatientName";
     pst=con.prepareStatement(sql);
     rs= pst.executeQuery();
     jTable1.setModel(DbUtils.resultSetToTableModel(rs));
     }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
      }
}
 
Example #8
Source File: Patient_Discharge_roomRec1.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
     try{
     String sql="Select PatientRegistration.PatientID as 'Patient ID',PatientRegistration.PatientName as 'Patient Name',PatientRegistration.Gen as 'Gender',PatientRegistration.BG as 'Blood Group',Disease,AdmitDate as 'Admit Date',Room.RoomNo as 'Room No',Doctor.DoctorID as 'Doctor ID',DoctorName as 'Doctor Name',DischargeDate as 'Discharge Date',DP_Remarks as 'Remarks' from Room,Doctor,PatientRegistration,AdmitPatient_Room,DischargePatient_Room where Room.RoomNo=AdmitPatient_Room.RoomNo and Doctor.DoctorID=AdmitPatient_Room.DoctorID and PatientRegistration.PatientID=AdmitPatient_Room.PatientID  and AdmitPatient_Room.PatientID= DischargePatient_Room.admitID order by Dischargedate";
     pst=con.prepareStatement(sql);
     rs= pst.executeQuery();
     jTable1.setModel(DbUtils.resultSetToTableModel(rs));
     }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
     }
}
 
Example #9
Source File: PatientRec.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
       String sql="select PatientID as 'Patient ID', PatientName as 'Patient Name',FatherName as 'Father Name',Address,ContactNo as 'Contact No',Email as 'Email ID',Age,Gen as 'Gender',BG as 'Blood Group',Remarks from Patientregistration";
       try{
            pst=con.prepareStatement(sql);
            rs= pst.executeQuery();
            jTable1.setModel(DbUtils.resultSetToTableModel(rs));
        }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
      }
}
 
Example #10
Source File: ServicesRec.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
      String sql="select ServiceID as 'Service ID', ServiceName as 'Service Name',ServiceDate as 'Service Date',PatientRegistration.PatientID as 'Patient ID',PatientName as 'Patient Name',ServiceCharges as 'Service Charges' from PatientRegistration,Services where Services.PatientID=PatientRegistration.PatientID order by PatientName";
      try{         
           pst=con.prepareStatement(sql);
           rs= pst.executeQuery();
           txtTable.setModel(DbUtils.resultSetToTableModel(rs));
        }catch(Exception e){
           JOptionPane.showMessageDialog(null, e);
           e.printStackTrace();
         }
}
 
Example #11
Source File: Bill_RoomRec.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
     try{
            String sql="Select BillNo as 'Bill No.',PatientRegistration.PatientID as 'Patient ID',PatientRegistration.PatientName as 'Patient Name',PatientRegistration.Gen as 'Gender',PatientRegistration.BG as 'Blood Group',Disease,AdmitDate as 'Admit Date',Room.RoomNo as 'Room No',Doctor.DoctorID as 'Doctor ID',DoctorName as 'Doctor Name',DischargeDate as 'Discharge Date',Bill_Room.RoomCharges as 'Room Charges',Bill_Room.ServiceCharges as 'Service Charges',Bill_Room.BillingDate as 'Billing Date',PaymentMode as 'Payement Mode',PaymentModeDetails as 'Payment Mode Details',TotalCharges as 'Total Charges',NoOfDays as 'No. Of Days',TotalRoomCharges as 'Total Room Charges' from Room,Doctor,PatientRegistration,AdmitPatient_Room,DischargePatient_Room,Bill_Room where Room.RoomNo=AdmitPatient_Room.RoomNo and Doctor.DoctorID=AdmitPatient_Room.DoctorID and PatientRegistration.PatientID=AdmitPatient_Room.PatientID  and AdmitPatient_Room.PatientID= DischargePatient_Room.admitID and Bill_Room.DischargeID=DischargePatient_Room.AdmitID  order by Billingdate"; 
            pst=con.prepareStatement(sql);
            rs= pst.executeQuery();
            jTable1.setModel(DbUtils.resultSetToTableModel(rs));
     }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
      }
}
 
Example #12
Source File: UserRecord.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data() {
    String sql = "select name as 'Name', user_name as 'User Name',password,contact_no as 'Contact No',email_id as 'Email ID' from registration";
    try {
        pst = con.prepareStatement(sql);
        rs = pst.executeQuery();
        jTable1.setModel(DbUtils.resultSetToTableModel(rs));
    } catch (Exception e) {
        JOptionPane.showMessageDialog(null, e);

    }
}
 
Example #13
Source File: LoginDetails.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
        String sql="select user_name as 'User Name',password as 'Password' from users order by user_name";
          try{
         pst=con.prepareStatement(sql);
          rs= pst.executeQuery();
         User_table.setModel(DbUtils.resultSetToTableModel(rs));
         }catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
          
}
    }
 
Example #14
Source File: Patient_Admit_roomRec2.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
   String sql="Select PatientRegistration.PatientID as 'Patient ID',PatientRegistration.PatientName as 'Patient Name',PatientRegistration.Gen as 'Gender',PatientRegistration.BG as 'Blood Group',Disease,AdmitDate as 'Admit Date',Room.RoomNo as 'Room No',Doctor.DoctorID as 'Doctor ID',DoctorName as 'Doctor Name',AdmitPatient_Room.AP_Remarks as 'Remarks' from Room,Doctor,PatientRegistration,AdmitPatient_Room where Room.RoomNo=AdmitPatient_Room.RoomNo and Doctor.DoctorID=AdmitPatient_Room.DoctorID and PatientRegistration.PatientID=AdmitPatient_Room.PatientID order by admitdate";
   try{
      pst=con.prepareStatement(sql);
      rs= pst.executeQuery();
      jTable1.setModel(DbUtils.resultSetToTableModel(rs));
     }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
      }
}
 
Example #15
Source File: Services.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data1(){
      try{
        con=Connect.ConnectDB();
        String sql="select PatientID as 'Patient ID', PatientName as 'Patient Name' from Patientregistration order by PatientName";
         
         pst=con.prepareStatement(sql);
         rs= pst.executeQuery();
         tblPatient.setModel(DbUtils.resultSetToTableModel(rs));
         }catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
          
}
    }
 
Example #16
Source File: DocRec.java    From Hospital-Management with GNU General Public License v3.0 5 votes vote down vote up
private void Get_Data(){
  String sql="select DoctorID as 'Doctor ID', DoctorName as 'Doctor Name',FatherName as 'Father Name',Address,ContacNo as 'Contact No',Email as 'Email ID',Qualifications,Gender,BloodGroup as 'Blood Group',DateOfJoining as 'Joining Date' from Doctor order by DoctorName";        
  try{
     pst=con.prepareStatement(sql);
      rs= pst.executeQuery();
     jTable1.setModel(DbUtils.resultSetToTableModel(rs));
     }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
      
    }
}
 
Example #17
Source File: Main.java    From dctb-utfpr-2018-1 with Apache License 2.0 4 votes vote down vote up
private void update_table(){
    try{
        MySqlDAO m = new MySqlDAO();
        jTab.setModel(DbUtils.resultSetToTableModel(m.select()));
    }catch(Exception e){};
}
 
Example #18
Source File: RoomPanel.java    From Java-Simple-Hotel-Management with GNU General Public License v3.0 4 votes vote down vote up
private void populateRoomTable()
{
    result = roomdb.getRooms();
    table_rooms.setModel(DbUtils.resultSetToTableModel(result));
    roomdb.flushAll();
}
 
Example #19
Source File: ItemPanel.java    From Java-Simple-Hotel-Management with GNU General Public License v3.0 4 votes vote down vote up
private void populateFoodTable() {
    result = db.getItems();
    table_item.setModel(DbUtils.resultSetToTableModel(result));
    db.flushAll();
}
 
Example #20
Source File: OrderPanel.java    From Java-Simple-Hotel-Management with GNU General Public License v3.0 4 votes vote down vote up
private void populateFoodTable() {
    result = foodDb.getFoods();
    table_food.setModel(DbUtils.resultSetToTableModel(result));
    foodDb.flushAll();
}
 
Example #21
Source File: OrderPanel.java    From Java-Simple-Hotel-Management with GNU General Public License v3.0 4 votes vote down vote up
private void populateItemTable()
{
   result = itemDb.getItems();
   table_item.setModel(DbUtils.resultSetToTableModel(result));
   itemDb.flushAll();
}
 
Example #22
Source File: FoodPanel.java    From Java-Simple-Hotel-Management with GNU General Public License v3.0 4 votes vote down vote up
private void populateFoodTable() {
    result = db.getFoods();
    table_food.setModel(DbUtils.resultSetToTableModel(result));
    db.flushAll();
}
 
Example #23
Source File: CustomerPanel.java    From Java-Simple-Hotel-Management with GNU General Public License v3.0 3 votes vote down vote up
private void populateWithCustomerData()
{
    result = db.getAllCustomer();
    table_customer.setModel(DbUtils.resultSetToTableModel(result));
    
    
}
 
Example #24
Source File: PaymentPanel.java    From Java-Simple-Hotel-Management with GNU General Public License v3.0 2 votes vote down vote up
private void populatePaymentTable(ResultSet result) {

        table_payment.setModel(DbUtils.resultSetToTableModel(result));
    }