我想顯示我的數據庫到Java中的文本區域。下面的代碼工作,但它顯示「[email protected]」而不是數據。任何想法爲什麼?以及如何我可以糾正這種這是爲什麼返回「[email protected]」
我的代碼
public static String listAll() {
String output = listHeader();
try {
ResultSet res = stmt.executeQuery("SELECT * from STUDENT.MESSAGES");
while (res.next()) { // there is a result
//output += formatListEntry(res);
output += res;
output +=System.lineSeparator();
}
} catch (Exception e) {
System.out.println(e);
return null;
}
return output;
}
您好,謝謝您的幫助。現在它可以工作,但顯示的數據完全不正確?它沒有任何意義。 – 2015-02-11 15:40:27