String sqlStr=" select a.* ,b.*,d.* "
+ "from table1 a left outer join table2 b on a.id=b.id "
+" left outer join table3 d on a.id=d.id "
+" where 。。。";
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection conn = DriverManager.getConnection("url", "user", "pass");
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery(sqlStr);
table1是一大表,里面有170个字段,原来查询一些正常,后把table1中的一些字段长度从varchar(50)改为varchar(500)后查询出现以下错误:
com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -1585, SQLSTATE: 54048, SQLERRMC: null
需改为
Statement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
才能查询成功
DB2出错因为配置1
最新推荐文章于 2019-12-19 09:24:23 发布