0
private String getQuery() {
StringBuilder sb = new StringBuilder();
sb.append(" SELECT DISTINCT col1, ");
sb.append(" col2, ");
sb.append(" col3, ");
sb.append(" col4, ");
sb.append(" col5, ");.....so on
return sb.toString();
public List<Object[]> getDetails(Connection connection, String RequestId) throws Exception {
List<Object[]> test = null;
final Map<Integer, Object> testMap = new HashMap<Integer, Object>();
testMap.put(1, RequestId);
test = executeQuery(connection, getQuery(), testMap, 100);
return test;
}
我想打印。我是提供打印列表
System.out.println(test.toString());
然後toString()
重寫方法列表中,但它仍然是打印地址。
我想打印像下面 -
System.out.println(test.toString());
@Override
public String toString() {
return "className [getQuery()=" + getQuery() + "]";
}
你是如何打印列表的 –
@ ANKUR-singhal-:請看看編輯..toString ()方法生成使用eclipse源代碼 - >生成toString()選項 – master
所以你實際上試圖打印'查詢' –