JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java 新手區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 詢問一個 Uncompilable source code 的問題
sakata





發文: 311
積分: 0
於 2012-02-13 17:22 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
目前我的程式出現了以下的錯誤訊息

java.lang.RuntimeException: Uncompilable source code
at tw.com.gmpc.hrms.lunch.m0001.Lunch.compareTo(Lunch.java)
at java.util.TreeMap.put(TreeMap.java:545)
at java.util.TreeSet.add(TreeSet.java:238)
at tw.com.gmpc.hrms.lunch.m0001.LUN_M_0001DAO.getExistData(LUN_M_0001DAO.java:238)
at tw.com.gmpc.hrms.lunch.m0001.LUN_M_0001DAO.removeDuplicationDate(LUN_M_0001DAO.java:198)
at tw.com.gmpc.hrms.lunch.m0001.LUN_M_0001DAO.updateLunch(LUN_M_0001DAO.java:133)
at tw.com.gmpc.hrms.lunch.m0001.LUN_M_0001.upDataAction(LUN_M_0001.java:1385)
at tw.com.gmpc.hrms.autorun.LoadLunchData.update(LoadLunchData.java:89)
at tw.com.gmpc.hrms.autorun.LoadLunchData.execute(LoadLunchData.java:67)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)

程式碼如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
    private TreeSet<Lunch> getExistData(Connection conn, Date startDate, Date stopDate) throws SQLException {
        TreeSet<Lunch> dbLunch = new TreeSet<Lunch>();
 
        String sql = "select * from " + Hrdb.LUNCH + " where ldate between ? and ?";
        PreparedStatement pstmt = conn.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
        pstmt.setDate(1, new java.sql.Date(startDate.getTime()));
        pstmt.setDate(2, new java.sql.Date(stopDate.getTime()));
        ResultSet rs = pstmt.executeQuery();
        sql = "select * from " + Hrdb.LUNCH + " where ldate between '" + ChangeClass.date2String(startDate) + "' and '" + ChangeClass.date2String(stopDate) + "'";
        while (rs.next()) {
            Lunch lunch = new Lunch();
            lunch.setEmployeeId(rs.getString("employee_id"));
            lunch.setLdate(rs.getDate("ldate"));
            lunch.setLtime(rs.getTime("ltime"));
            lunch.setMealType(rs.getString("meal_type"));
            dbLunch.add(lunch);
        }
        rs.close();
        pstmt.close();
        return dbLunch;
    }


錯誤發生在
1
dbLunch.add(lunch);


花了一點時間查詢錯誤,但是我沒有找到
可以請問一下,可能發生問題的原因嗎?

感謝


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
864 詢問一個 Uncompilable source code 的問題 sakata 2192 2012-02-13 17:22
843 Re:詢問一個 Uncompilable source code 的問題 ch_huang 31 2012-02-13 17:38
762 Re:詢問一個 Uncompilable source code 的問題 uxa 87 2012-02-13 17:40
734 Re:詢問一個 Uncompilable source code 的問題 sakata 255 2012-02-14 08:03
754 Re:詢問一個 Uncompilable source code 的問題 ch_huang 97 2012-02-14 09:39
751 Re:詢問一個 Uncompilable source code 的問題 sakata 68 2012-02-14 09:55
» JWorld@TW »  Java 新手區

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8