本帖最后由 CaptainGan 于 2011-11-08 16:16:57 编辑

解决方案 »

  1.   

    另外,我用的是一个叫Easy Java Persistence的ORM的JDBC数据库映射框架,进行的数据库访问。
      

  2.   

    是不是你导入的包有错啊
    eg:list 有两种导入包:java.util.list, java.awt.list,导入错误,也是有可能的
      

  3.   

    导入的包:
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.List;import ejp.Database;
    import ejp.DatabaseException;
    import ejp.DatabaseManager;
    import ejp.Result;
      

  4.   


    我调试发现在cutList 中已经有查询出来的对象,下一步只要将里面的数据打印出来就OK了。
      

  5.   

    你把cutList.get(i).getCustId().toString()看看是什么
      

  6.   

    晕,我发现程序没问题,是这个鸡巴框架要什么许可,太阴了,难怪没人会用这个东西。01:01:21.062 [main] DEBUG ejp.DatabaseManager - Creating new DatabaseManager: name = hibernatedemo, poolSize = 1000, driver = com.mysql.jdbc.Driver, url = jdbc:mysql://localhost:3306/hibernatedemo, username = root, password = root
    01:01:21.078 [main] DEBUG ejp.DatabaseManager - Retrieving database
    java.lang.ClassNotFoundException: EjpLicense
    01:01:21.531 [main] DEBUG ejp.DatabaseManager - Databases allocated = 1
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.ent.MapTab;
    at com.ent.TestMain.method(TestMain.java:19)
    at com.ent.TestMain.main(TestMain.java:36)
    01:01:21.531 [main] DEBUG ejp.Database - Limiting meta data with catalog = null
    01:01:21.531 [main] DEBUG ejp.Database - Limiting meta data with schema = null
    01:01:21.531 [main] DEBUG ejp.Database - Setting fetch size to null
    01:01:21.531 [main] DEBUG ejp.Database - Setting maximum result rows to null
    01:01:21.531 [main] DEBUG ejp.Database - Setting result set type to null
    01:01:21.531 [main] DEBUG ejp.Database - Setting result set concurrency to null
    01:01:21.531 [main] DEBUG ejp.Database - select * from maptab
    01:01:21.531 [main] DEBUG ejp.Database - Creating statement for querying: resultSetType = null, resultSetConcurrency = null
    This is a trial version, which will work for a limited time (10000 validations).  You need to obtain a license key from easierjava.com.
    01:01:21.546 [main] DEBUG ejp.Database - closing database
    01:01:21.546 [main] DEBUG ejp.DatabaseManager - Database added to free pool; size is now = 1, max size = 1000
    01:01:21.546 [main] DEBUG ejp.DatabaseManager - Databases allocated = 0
    添加了临时的许可jar文件后:01:02:17.046 [main] DEBUG ejp.DatabaseManager - Creating new DatabaseManager: name = hibernatedemo, poolSize = 1000, driver = com.mysql.jdbc.Driver, url = jdbc:mysql://localhost:3306/hibernatedemo, username = root, password = root
    01:02:17.046 [main] DEBUG ejp.DatabaseManager - Retrieving database
    01:02:17.843 [main] DEBUG ejp.DatabaseManager - Databases allocated = 1
    01:02:17.843 [main] DEBUG ejp.Database - Limiting meta data with catalog = null
    01:02:17.843 [main] DEBUG ejp.Database - Limiting meta data with schema = null
    01:02:17.843 [main] DEBUG ejp.Database - Setting fetch size to null
    01:02:17.843 [main] DEBUG ejp.Database - Setting maximum result rows to null
    01:02:17.843 [main] DEBUG ejp.Database - Setting result set type to null
    01:02:17.843 [main] DEBUG ejp.Database - Setting result set concurrency to null
    01:02:17.843 [main] DEBUG ejp.Database - select * from maptab
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.ent.MapTab;
    at com.ent.TestMain.method(TestMain.java:19)
    at com.ent.TestMain.main(TestMain.java:36)
    01:02:17.843 [main] DEBUG ejp.Database - Creating statement for querying: resultSetType = null, resultSetConcurrency = null
    License is valid.  However it expires on Sun Nov 13 17:22:34 CST 2011.  Thank you!
    01:02:17.937 [main] DEBUG ejp.Database - closing database
    01:02:17.937 [main] DEBUG ejp.DatabaseManager - Database added to free pool; size is now = 1, max size = 1000
    01:02:17.937 [main] DEBUG ejp.DatabaseManager - Databases allocated = 0不过还是不能显示出来,什么垃圾东西。