Link to home
Start Free TrialLog in
Avatar of SunScreenCert
SunScreenCert

asked on

java public access throwing error

i have this new function in custarea1DAO.java in javafiles folder
 public BillingDetails getBillingDetails(int appid){
          Connection conn = null;
          entities.BillingDetails billingDetailsList = null;
          String command = "select billingDetailId, billingType, billingRate, billRound from billingdetails where appid = '" + appid + "'";
        try {
   conn = getConnection();
            Statement stmt = conn.createStatement();
   if (stmt.execute(command.toString())) {
    ResultSet rs = stmt.getResultSet();
    while (rs.next()) {
                    billingDetailsList = new entities.BillingDetails();//error throwing here
                    billingDetailsList.setBillingDetailId(rs.getInt("billingDetailId"));
                    billingDetailsList.setBillingType(rs.getInt("billingType"));
                    billingDetailsList.setBillingRate(rs.getFloat("billingRate"));
                    billingDetailsList.setBillingRound(rs.getInt("billRound"));
                   
                }
            }
           
    }catch (Exception e) {
   // TODO: Handle
   e.printStackTrace();
  } finally {
   if (conn != null) {
    try {
     conn.close();
    } catch (SQLException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    }
   }
  }
  }
        return billingDetailsList;
    }
 
 
and i have this file BillingDetails.java in entities folder
 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;
/**
 *
 * @author Administrator
 */
public class BillingDetails {
        BillingDetails(){
            billingDetailId = 0;
            billingType = 0;
            billingRate = 0.0f;
 }
    private Integer billingDetailId;
    private Integer billingType;
    public Float getBillingRate() {
        return billingRate;
    }
    public void setBillingRate(Float billingRate) {
        this.billingRate = billingRate;
    }
    public Integer getBillingRound() {
        return billingRound;
    }
    public void setBillingRound(Integer billingRound) {
        this.billingRound = billingRound;
    }
    public Integer getBillingType() {
        return billingType;
    }
    public void setBillingType(Integer billingType) {
        this.billingType = billingType;
    }
    private Float billingRate;
    private Integer billingRound;
    public Integer getBillingDetailId() {
        return billingDetailId;
    }
    public void setBillingDetailId(Integer billingDetailId) {
        this.billingDetailId = billingDetailId;
    }
}

 
now in the line commented it is throwing the errror that BillingDetails is not public in entities, it cannot be accessed outside the package. Can you please help me here
 
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial