日期:2014-05-17  浏览次数:20737 次

iReport中使用JavaBean作为Table的数据源:The supplied java.sql.Connection object is nul

Java code
Hibernate: 
    select
        unitathlet0_.unitName as col_0_0_,
        unitathlet0_.manAthlete as col_1_0_,
        unitathlet0_.femalAthlete as col_2_0_,
        unitathlet0_.guide as col_3_0_,
        unitathlet0_.athleteId as col_4_0_,
        unitathlet0_.coach as col_5_0_,
        unitathlet0_.teamDoctor as col_6_0_ 
    from
        sportSys.dbo.unitAthleteView unitathlet0_ 
    where
        unitathlet0_.userId='9'
2012-5-15 11:21:39 net.sf.jasperreports.engine.query.JRJdbcQueryExecuter <init>
警告: The supplied java.sql.Connection object is null.
2012-5-15 11:21:39 net.sf.jasperreports.engine.query.JRJdbcQueryExecuter <init>
警告: The supplied java.sql.Connection object is null.


不知道为什么一直是上面的这个错误,
我使用Sql语句作为数据源的时候,是没有什么问题的呢,
是不是Table DataSet设置的问题?
我Table DataSet 设置的也是JavaBean数据源呢~

iReport版本:4.5.1
Struts2版本:Struts2.2.3

------解决方案--------------------
JavaBean数据源预览不了的,需要到程序里面获取到数据才行~