我想显示我的数据库到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