Is there a way to limit the rows returned at the Oracle datasource level in a Tomcat application?

有没有办法限制Tomcat应用程序中Oracle数据源级别返回的行?

It seems maxRows is only available if you set it on the datasource in the Java code. Putting maxRows="2" on the datasource doesn't apply.

似乎只有在Java代码中的数据源上设置maxRows才可用。在数据源上放置maxRows =“2”不适用。

Is there any other way limit the rows returned? Without a code change?

有没有其他方法限制返回的行?没有代码更改?

6 个解决方案

#1


4

It isn't something that is available at the configuration level. You may want to double check that it does what you want it to do anyway: see the javadoc for setMaxRows. With Oracle it is still going to fetch every row back for the query and then just drop the ones outside the range. You would really need to use rownum to make it work well with Oracle and you can't do that either in the configuration.

它不是配置级别可用的东西。您可能需要仔细检查它是否按照您的意愿执行操作:请参阅setMaxRows的javadoc。对于Oracle,它仍然会为查询提取每一行,然后只删除范围之外的那些。您确实需要使用rownum使其与Oracle良好协作,您无法在配置中执行此操作。

更多相关文章

  1. Java读取数据源相关信息

随机推荐

  1. 通过Min / Max / Avg操作对表中的值进行
  2. 关于SQL2005安装完毕后,没有SQL Server M
  3. sql间歇性出现无法连接和卡死的情况。
  4. CentOS7安装MySQL并设置远程登录
  5. 即使提供了参数,过程也需要参数
  6. 错误:第t列。tgisconstraint不存在
  7. 请问MYSQL 08S01错误怎么解决,谢谢
  8. StringBuilder 拼接sql语句比较快
  9. hibernate中load,get;find,iterator;merg
  10. IFX数据库访问介绍