Java Code Examples for net.proteanit.sql.DbUtils

The following examples show how to use net.proteanit.sql.DbUtils. These examples are extracted from open source projects. 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
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 2
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 3
Source Project: Hospital-Management   Source File: DocRec.java    License: 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 4
Source Project: Hospital-Management   Source File: Services.java    License: 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 5
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 6
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 7
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 8
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 9
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 10
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 11
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 12
/**
 * 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 13
Source Project: Hospital-Management   Source File: Room.java    License: 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 14
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 15
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 16
private void populateRoomTypeTable()
{
    //System.out.println(tabbedPane.getSelectedIndex());
    result = roomdb.getRoomType();
    table_roomType.setModel(DbUtils.resultSetToTableModel(result));
    roomdb.flushAll();
}
 
Example 17
Source Project: dctb-utfpr-2018-1   Source File: Main.java    License: 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
private void populateRoomTable()
{
    result = roomdb.getRooms();
    table_rooms.setModel(DbUtils.resultSetToTableModel(result));
    roomdb.flushAll();
}
 
Example 19
private void populateFoodTable() {
    result = db.getItems();
    table_item.setModel(DbUtils.resultSetToTableModel(result));
    db.flushAll();
}
 
Example 20
private void populateFoodTable() {
    result = foodDb.getFoods();
    table_food.setModel(DbUtils.resultSetToTableModel(result));
    foodDb.flushAll();
}
 
Example 21
private void populateItemTable()
{
   result = itemDb.getItems();
   table_item.setModel(DbUtils.resultSetToTableModel(result));
   itemDb.flushAll();
}
 
Example 22
private void populateFoodTable() {
    result = db.getFoods();
    table_food.setModel(DbUtils.resultSetToTableModel(result));
    db.flushAll();
}
 
Example 23
private void populateWithCustomerData()
{
    result = db.getAllCustomer();
    table_customer.setModel(DbUtils.resultSetToTableModel(result));
    
    
}
 
Example 24
private void populatePaymentTable(ResultSet result) {

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