Druid Connection Oralce Database error problem ___ Database
Source: Internet
Author: User
Background description: According to project requirements, use Druid connection pool to connect MySQL database and Derby database; Problem Description: In Derby database environment error: Init dataSource error Encounter "<EOF>" at~~~. Analysis method: Initialization data times wrong, should be in the configuration file error, segment shielding configuration file, confirm the configuration item that produces the error is: Validationquery:select ' x '. The configuration item was commented and then an error: Testwhileidle is true,validataionquery not set. According to the literal meaning will testwhileidle modify to false no longer error, the project normal operation. However, there is a risk that the database will no longer be authenticated for connectivity. After reviewing the relevant data, it is found that different connection pools have different test statements (i.e. Validateionquery) when they connect to different databases. Combined with the error message (encounter "<EOF>") that is, the SQL statement syntax error occurs when the database is started and is associated with quotation marks. Confirm the Select ' X ' ERROR. According to the data, modify the test statement to the values 1 database to start running normally. Modified configuration: Dbconfig.properties
Url:jdbc:derby://localhost:1527/dbname
DriverClassName:org.apache.derby.jdbc.ClientDriver
Username:app
password:**********
Spring-*.xml <!--Ali Druid database connection pool-->
<bean id= "DataSource" class= "Com.alibaba.druid.pool.DruidDataSource" destroy-method= "Close" >
<!--database basic information Configuration-->
<property name= "url" value= "${url}"/>
<property name= "username" value= "${username}"/>
<property name= "Password" value= "${password}"/>
<property name= "Driverclassname" value= "${driverclassname}"/>
<property name= "Filters" value= "${filters}"/>
Maximum number of concurrent connections for the <!---->
<property name= "maxactive" value= "${maxactive}"/>
<!--initial number of connections-->
<property name= "InitialSize" value= "${initialsize}"/>
<!--Configure the time to get the connection wait timeout-->
<property name= "maxwait" value= "${maxwait}"/>
<!--minimum number of idle connections-->
<property name= "Minidle" value= "${minidle}"/>
<!--How long does the configuration interval take to detect and detect idle connections that need to be closed, in milliseconds-->
<property name= "Timebetweenevictionrunsmillis" value= "${timebetweenevictionrunsmillis}"/>
<!--Configure a connection to the minimum surviving time in the pool, in milliseconds-->
<property name= "Minevictableidletimemillis" value= "${minevictableidletimemillis}"/>
<property name= "Validationquery" value= "${validationquery}"/>
<property name= "Testwhileidle" value= "${testwhileidle}"/>
<property name= "Testonborrow" value= "${testonborrow}"/>
<property name= "Testonreturn" value= "${testonreturn}"/>
<property name= "maxopenpreparedstatements" value= "${maxopenpreparedstatements}"/>
<!--turn on removeabandoned function-->
<property name= "removeabandoned" value= "${removeabandoned}"/>
<!--1800 seconds, which is 30 minutes-->
<property name= "Removeabandonedtimeout" value= "${removeabandonedtimeout}"/>
<!--output error log when abanded connection is turned off-->
<property name= "logabandoned" value= "${logabandoned}"/>
</bean>
============================================================ Supplement: Other database and connection pool corresponding to the Validationquery, based on the following figure information to try to set up DBCP connection pool JDBC Connection Pool
Other connection pools:
Annex: This question refer to the URL solution https://my.oschina.net/xzfx/blog/478482 http://blog.csdn.net/zitong_ccnu/article/details/48629017 Http://blog.sina.com.cn/s/blog_72ef7bea0101hpj8.html http://blog.csdn.net/hj7jay/article/details/51686418
Reprint Address: https://blog.csdn.net/ronger4846/article/details/53487565
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.