2017-03-01 24 views
-3

these are the errors我試圖編譯我的Java項目在命令提示符,它給了我這些錯誤

從這個角度

我越來越

public ArrayList<DatabasePayroll> getDbPList() { 
    ArrayList<DatabasePayroll> dbPList = new ArrayList<DatabasePayroll>(); 
    Connection connection = getConnection(); 

    String query = "SELECT * FROM `salary sheet`"; 
    Statement st; 
    ResultSet rs; 

    try { 
     st = connection.createStatement(); 
     rs = st.executeQuery(query); 
     DatabasePayroll databasePayroll; 
     while (rs.next()) { 
      databasePayroll = new DatabasePayroll(rs.getInt("Num"), rs.getString("Name"), rs.getDate("LastPaymentDate"), rs.getString("Site"), rs.getString("Designation"), rs.getFloat("SalaryBalance"), rs.getFloat("PerDay"), rs.getFloat("Days"), rs.getFloat("Salary"), rs.getFloat("OTHours"), rs.getFloat("OTRate"), rs.getDouble("OT"), rs.getFloat("Allowance"), rs.getDouble("GrossSalary"), rs.getFloat("Advance"), rs.getFloat("Loan"), rs.getDouble("NetSalary"), rs.getDouble("RequestedAmount"), rs.getString("Status")); 
      dbPList.add(databasePayroll); 
     } 
    } catch (SQLException e) { 
     e.printStackTrace(); 
    } 
    return dbPList; 
} 

我使用進口java.util中的錯誤。數組列表;包。

+4

請將此減少到[mcve]並在問題*中包含錯誤*。 (我懷疑問題是你只編譯了你的代碼的一部分,並希望編譯器能夠找到其他類,但是沒有從包根編譯...) –

回答

0

它看起來像編譯issue.Make確保您的DatabasePayroll類正確導入。如果來自外部jar,那麼將該jar添加到您的構建路徑中。更好地使用像eclipse這樣的java IDE,它可以簡化編譯,調試等等。

+0

非常感謝我會盡力:) – Lisa234

相關問題