看板 java 關於我們 聯絡資訊
※ 引述《hfnadkv (衝衝衝)》之銘言: : 昨天發問過,但因為說明過於簡單,加上剛才又找到中文的說明檔 : 所以重po一次 : 因為要連*.dbf的檔案 : 所以找了JDBF這個套件來用 : http://www.svcon.com/jdbf/docs/index.html : 中文說明檔:http://tinyurl.com/3xd57n : 但執行下面程式時,一直是出現錯誤(JDBFException指出找不到檔案) : 不知哪個環節出錯了?!謝謝大大解答 : Exception in thread "main" java.lang.Error: : Unresolved compilation problem: : Unhandled exception type JDBFException at testReadDBF3.main(testReadDBF3.java: : 13) : import com.svcon.jdbf.DBFReader; : public class testReadDBF{ : public static void main(String[] args) { : DBFReader test = new DBFReader("db/Book1.dbf"); : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ : 指向這裡 : System.out.println (test.getFieldCount()); //算出有幾個欄位 : } : } 1. 如果我沒看錯, 這個constructor需要處理 Exception的handle, 你有作這件事情嗎? 2. 如果你確定是"找不到檔案",你有確定過目錄底下的檔案是不是存在了嗎? (可利用java.io.File進行確認) --- 基本上我認為是1啦(攤手) try{ DBFReader test = new DBFReader("db/Book1.dbf"); System.out.println (test.getFieldCount()); //算出有幾個欄位 }catch(Exception e) { e.printStackTrace(); } --  ▄▅▆▇███▇▆▅▄▃        ╰┼╯─╮ ╮         ◥███████████◣       ╰┼╯=│=│         ◥██████───────    *. ╯  ╯ ╯ の 物 語 .*  ◥███████──────◣ ~ ◢◣             ◢◣  ◥██████───────◤   ◥◤  空白的世界.翼 ◥◤  ◥██▁▂▃▄▅▆▇███▆▅▄▃▂▂telnet://tony1223.no-ip.info -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.132.59.247
hfnadkv:哇,謝謝大大,在Tony大大回的同時,我也剛好解決了 01/17 17:44
hfnadkv:真的就是忘了加點東西上去= = 01/17 17:45