java - How to set oracle.net.ns.SQLnetDef.TCP_CONNTIMEOUT_STR -
i have googled , found lots of documents , web pages saying should set oracle.net.ns.sqlnetdef.tcp_conntimeout_str 3 seconds. unable locate example of how that.
is system level property can set -doracle.net.ns.sqlnetdef.tcp_conntimeout_str=3 or what? properties file? spring config example?
i have plain java application ojdbc.jar in classpath. beans configured/wired using spring xml.
<bean id="mydatasource" destroy-method="close" class="org.apache.commons.dbcp.basicdatasource"> <property name="driverclassname" value="${my.jdbc.driverclassname}" /> <property name="url" value="${my.jdbc.url}" /> <!-- cut --> </bean>
to set oracle connection timeout @ socket level basicdatasource
1) use latest basicdatasource -> commons-dbcp-1.4.jar
2) jdbcdriver version > 10.1.0.5
add property <property name="connectionproperties" value="oracle.jdbc.readtimeout=20000"/>
or jdbcdriver version < 10.1.0.5
add <property name="connectionproperties" value="oracle.net.read_timeout=20000"/>
Comments
Post a Comment