An error encountered during the use of spring+mybatis+oracle.
Finally see online sharing to solve this problem, mark.
The main problem is that the MyBatis configuration is problematic. I copied it directly below.
Original link: http://hellostory.iteye.com/blog/1416507
Thanks again to the original author. Thx.
The database connection pool configuration error (Content.xml) was checked.
When configuring SQL Server (MySQL) database connection pooling, the default value of the property Validationquery is "Select 1".
The Oracle database connection pool should be set to "validationquery=" Select 1 from Dual ""
SQL Server Watts (same as MySQL) database connection pool configuration:
<Context>
<resource
name= "jdbc/myoracle"
type= "Javax.sql.DataSource"
username= "test"
password= "test"
driverclassname= "Oracle.jdbc.driver.OracleDriver"
maxidle= "5"
maxwait= "5000"
validationquery= "Select 1"
url= "Jdbc:oracle:thin:@192.168.1.1:1521:mydb"
maxactive= "
>
Oracle database Connection Pool configuration:
<Context> <resource name= "jdbc/myoracle" type= "Javax.sql.DataSource" use
Rname= "test" password= "test" driverclassname= "Oracle.jdbc.driver.OracleDriver" maxidle= "5" maxwait= "5000" validationquery= "SELECT 1 from Dual" url= "jdbc:oracle:thin:@192.168.1.1:1521:my db "maxactive="/> </context>