因为ibatis好像没专区,所以就发在这里问了
小弟最近初用struts2+ibatis,展现没问题了,现在想了解下分页代码
ibatis中自带了个结果集边界查询,官方例子中写的是:
String resource = “com/ibatis/example/sqlMap-config.xml”;
Reader reader = Resources.getResourceAsReader (resource);
SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMap(reader);】这里的com/ibatis/example/sqlMap-config.xml是哪个文件,我是用的ibator自动生成的,是那个吗?网上找了下,这个地方都写得不是很详细,麻烦谁能讲解下详细的代码,不胜感激

解决方案 »

  1.   

    sqlMap-config.xml   看名字就是里面放的 SQL的XML文件.   com/ibatis/example/这个下面肯定有它的文件
      

  2.   

    sqlMap-config.xml是ibatis的一些通用配置文件
    里面有像:
    <sqlMapConfig>
    <settings
    cacheModelsEnabled="true"
    enhancementEnabled="true"
    lazyLoadingEnabled="true"
    errorTracingEnabled="true"
    useStatementNamespaces="true"
    statementCachingEnabled="true"
    classInfoCacheEnabled="true"
    maxRequests="128" 
    maxSessions="64" 
    maxTransactions="8" 
    />分页可以采用sql语句控制,用rownum控制分页
      

  3.   

    问题已解决,在官方的api文档中查看了下,就是ibatis自己带了结果集分界还有翻页