-
白衣俊郎 初学数据Lv2
发表于2018-4-27 15:39
悬赏1
已解决
研究了下客户的报表,他们的totalcount是求一个子集的记录条数。
在我们自己设计的报表中,经研究,如果totalcount这样写
1.select count(name) a from dbo.dim_szysjs,这样可以正常计算;
2.select count(name) as a from dbo.dim_szysjs,计算第一页正常,点击下一页就会报错:计算浮动表元B1(rs1.1)时出错:java.lang.NullPointerException
3.select count(*) b from (select name from dbo.dim_szysjs) t,计算第一页正常,点击下一页就会报错:计算浮动表元B1(rs1.1)时出错:java.lang.NullPointerException
遇到像这样子的情况该如何处理?
执行这个报错的
去掉前面的注释就是好了的,但去掉了就没法进行分页处理了
执行SQL:
/*STARTINDEX:5*/select top 10 name from dbo.dim_szysjs
java.lang.NullPointerException: 计算浮动表元B1(rs1.1)时出错:java.lang.NullPointerException
at com.sanlink.jdbc.pool.impl.MSSQLPooledSQLException.analyseErrorCoede(MSSQLPooledSQLException.java:16)
at com.sanlink.jdbc.pool.impl.PooledSQLException.(PooledSQLException.java:57)
at com.sanlink.jdbc.pool.impl.PooledSQLException.(PooledSQLException.java:42)
at com.sanlink.jdbc.pool.impl.MSSQLPooledSQLException.(MSSQLPooledSQLException.java:13)
at com.sanlink.jdbc.pool.impl.PooledSQLExceptionFactory.getInstance(PooledSQLExceptionFactory.java:28)
at com.sanlink.jdbc.pool.impl.PooledStatement.throwSQLException(PooledStatement.java:64)
at com.sanlink.jdbc.pool.impl.PooledStatement.executeUpdate(PooledStatement.java:120)
at com.sanlink.jdbc.SqlExecuter.excuteUpdate(SqlExecuter.java:195)
at com.sanlink.jdbc.SqlExecuter.executeSql(SqlExecuter.java:159)
at com.sanlink.jdbc.SqlExecuter.executeQuery(SqlExecuter.java:106)
at com.sanlink.irpt.fxcalc.impl.cache.floatfxq2.OLTPResultManager.querySql(OLTPResultManager.java:135)
继续求大神处理
3个回答
/*STARTINDEX:10*/select top 15 name from dbo.dim_szysjs
执行这个报错的
去掉前面的注释就是好了的,但去掉了就没法进行分页处理了
执行SQL:
/*STARTINDEX:5*/select top 10 name from dbo.dim_szysjs
java.lang.NullPointerException: 计算浮动表元B1(rs1.1)时出错:java.lang.NullPointerException
at com.sanlink.jdbc.pool.impl.MSSQLPooledSQLException.analyseErrorCoede(MSSQLPooledSQLException.java:16)
at com.sanlink.jdbc.pool.impl.PooledSQLException.(PooledSQLException.java:57)
at com.sanlink.jdbc.pool.impl.PooledSQLException.(PooledSQLException.java:42)
at com.sanlink.jdbc.pool.impl.MSSQLPooledSQLException.(MSSQLPooledSQLException.java:13)
at com.sanlink.jdbc.pool.impl.PooledSQLExceptionFactory.getInstance(PooledSQLExceptionFactory.java:28)
at com.sanlink.jdbc.pool.impl.PooledStatement.throwSQLException(PooledStatement.java:64)
at com.sanlink.jdbc.pool.impl.PooledStatement.executeUpdate(PooledStatement.java:120)
at com.sanlink.jdbc.SqlExecuter.excuteUpdate(SqlExecuter.java:195)
at com.sanlink.jdbc.SqlExecuter.executeSql(SqlExecuter.java:159)
at com.sanlink.jdbc.SqlExecuter.executeQuery(SqlExecuter.java:106)
at com.sanlink.irpt.fxcalc.impl.cache.floatfxq2.OLTPResultManager.querySql(OLTPResultManager.java:135)
继续求大神处理
分析SQL类型时,将 /*STARTINDEX:5*/select top 10 name from dbo.dim_szysjs 这种类型的SQL分析为了没有结果集的SQL,所以执行该SQL时没有生成结果集。
修改分析SQL类型的相关代码。
替换 WEB-INF/lib 目录下的 jdbc 的 jar 包中的文件 \com\sanlink\jdbc\sqlfunc.class
大哥很IT 发表于 2018-4-27 15:41
/*STARTINDEX:10*/select top 15 name from dbo.dim_szysjs
执行这个报错的
话说大神按照这个配置就没有问题了吗?