指定IBatis查询超时 [英] Specify IBatis query timeout

查看:182
本文介绍了指定IBatis查询超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法可以使用oracle jdbc和Java指定IBatis查询超时吗?

There is a way to specify IBatis query timeout using oracle jdbc and Java?

谢谢

推荐答案

来自iBatis手册:

From the iBatis manual :

< settings> 元素中:

(iBATIS版本2.2.0及更高版本)
此设置为整数值将作为所有语句的JDBC查询
超时应用。可以使用任何映射语句的
statement属性覆盖此值。如果未指定,则除非在映射语句的statement属性
上指定,否则不会设置
查询超时。指定的值是驱动程序等待语句完成的秒数
。请注意,并非所有驱动程序
都支持此设置。

(iBATIS versions 2.2.0 and later) This setting is an integer value that will be applied as the JDBC query timeout for all statements. This value can be overridden with the "statement" attribute of any mapped statement. If not specified, no query timeout will be set unless specified on the "statement" attribute of a mapped statement. The specified value is the number of seconds the driver will wait for a statement to finish. Note that not all drivers support this setting.

语句参数:

(仅限iBATIS版本2.2.0及更高版本)

(iBATIS versions 2.2.0 and later only)

设置此语句的JDBC查询超时。此处指定的任何值都将覆盖SQLMapConfig.xml文件中defaultStatementTimeout设置中指定的值
。如果指定默认超时
并确定您不希望特定语句超时,请将超时值设置为0.指定的
值是驱动程序等待的秒数声明完成。请注意,并非所有驱动程序
都支持此设置。

Sets the JDBC query timeout for this statement. Any value specified here will override the value specified in the "defaultStatementTimeout" setting in the SQLMapConfig.xml file. If you specify a default timeout and decide that you don't want a timeout for a particular statement, set the timeout value to 0. The specified value is the number of seconds the driver will wait for a statement to finish. Note that not all drivers support this setting.

oracle驱动程序支持此功能,因此这应该可行。

The oracle drivers support this functionality, so this should work.

这篇关于指定IBatis查询超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆