Database cannot connect to JDBC

Source: Internet
Author: User

Resolution: Connections could not being acquired from the underlying database! Blog Category:
    • Problem solving
    • Database
    • IBatis

Og4j:warn See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Org.quartz.SchedulerConfigException:Failure occured during job recovery. [See nested exception:org.quartz.JobPersistenceException:Failed to obtain DB connection from data source ' MyDS ': java.sq L.sqlexception:connections could not being acquired from the underlying database! [See nested exception:java.sql.SQLException:Connections could not being acquired from the underlying database!]]
At org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted (jobstoresupport.java:693)
At Org.quartz.core.QuartzScheduler.start (quartzscheduler.java:580)
At Org.quartz.impl.StdScheduler.start (stdscheduler.java:142)
At Org.quartz.ee.servlet.QuartzInitializerListener.contextInitialized (quartzinitializerlistener.java:198)
At Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:3830)
At Org.apache.catalina.core.StandardContext.start (standardcontext.java:4337)
At Org.apache.catalina.core.ContainerBase.start (containerbase.java:1045)
At Org.apache.catalina.core.StandardHost.start (standardhost.java:719)
At Org.apache.catalina.core.ContainerBase.start (containerbase.java:1045)
At Org.apache.catalina.core.StandardEngine.start (standardengine.java:443)
At Org.apache.catalina.core.StandardService.start (standardservice.java:516)
At Org.apache.catalina.core.StandardServer.start (standardserver.java:710)
At Org.apache.catalina.startup.Catalina.start (catalina.java:566)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:39)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:25)
At Java.lang.reflect.Method.invoke (method.java:597)
At Org.apache.catalina.startup.Bootstrap.start (bootstrap.java:288)
At Org.apache.catalina.startup.Bootstrap.main (bootstrap.java:413)
caused by:org.quartz.JobPersistenceException:Failed to obtain DB connection from data source ' MyDS ': Java.sql.SQLExcepti On:connections could not being acquired from the underlying database! [See nested exception:java.sql.SQLException:Connections could not being acquired from the underlying database!]
At Org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection (jobstoresupport.java:777)
At Org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection (jobstoretx.java:71)
At Org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock (jobstoresupport.java:3774)
At Org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock (jobstoresupport.java:3739)
At Org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverJobs (jobstoresupport.java:833)
At org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted (jobstoresupport.java:691)
... More
caused By:java.sql.SQLException:Connections could not being acquired from the underlying database!
At Com.mchange.v2.sql.SqlUtils.toSQLException (sqlutils.java:106)
At Com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection (c3p0pooledconnectionpool.java:529 )
At Com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection (abstractpoolbackeddatasource.java:128)
At Org.quartz.utils.PoolingConnectionProvider.getConnection (poolingconnectionprovider.java:247)
At Org.quartz.utils.DBConnectionManager.getConnection (dbconnectionmanager.java:108)
At Org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection (jobstoresupport.java:774)
... More
caused By:com.mchange.v2.resourcepool.cannotacquireresourceexception:a Resourcepool could notacquire A resource from Its primary factory or source.
At Com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable (basicresourcepool.java:1319)
At Com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource (basicresourcepool.java:557)
At Com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource (basicresourcepool.java:477)
At Com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection (c3p0pooledconnectionpool.java:525 )
... More

The above problems may be caused by the following reasons:

1, driver configuration error: Driver=com.mysql.jdbc.driver
2, database connection address error: Url=jdbc:mysql://localhost:3306/test?3useunicode=true&characterencoding=utf8
3, password or account error: Username=root
Password=root

4, the database is not started or is not authorized to access

5, the project did not introduce the corresponding drive jar package Mysql-connector-java-5.1.6-bin.jar

6,MySQL root does not have remote access permissions, need to increase permissions, the steps to increase permissions are as follows:
Go to MySQL database:
Grant all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT option;
Flush privileges;

If you have encountered the above problems, but the reason is not the above 5, please share the solution, thank you

Database cannot connect to JDBC

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.