• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

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
 
0
SunScreenCert
Asked:
SunScreenCert
1 Solution
 
objectsCommented:
>         BillingDetails(){

make that:

       public BillingDetails(){

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now