3 Problem solving for Tomcat connection to MySQL

Source: Internet
Author: User

Reprint please indicate the source:
This article is from: "Ouyida3 's Blog"

1, Basicdatasourcefactory

caused by:java.lang.ClassNotFoundException:org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
Solution: The original Oracle factory in Tomcat forgot to remove the

<Resource name="Jdbc/sdact1ds"      Auth="Container"      type="Javax.sql.DataSource"         Factory="Org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"      Driverclassname="Oracle.jdbc.driver.OracleDriver"         URL="Jdbc:oracle:thin:@13.121.2.13:1521:bsstest"         username="Ucr_ap"         Password="Ucr_ap"      maxactive=" the"      Maxidle="a"      maxwait="10000"      removeabandoned="true"      Removeabandonedtimeout=" the"      logabandoned="true"/>
2, No suitable driver

caused by:java.sql.SQLException:No suitable driver
Workaround: Similar to the above, or the resource node in Tomcat is not configured for

<Resource name="Ds_zplat_cen1"      Auth="Container"      type="Javax.sql.DataSource"      Driverclassname="Com.mysql.jdbc.Driver"      URL="Jdbc:mysql://13.51.23.24:3010/zplatdb"         username="Zplat_cen1"      Password="12345"      maxactive=" the"      Maxidle="a"      maxwait="10000"      removeabandoned="true"      Removeabandonedtimeout=" the"      logabandoned="true"      Defaultautocommit="false"/>
3, IsValid (I) Z

caused By:java.lang.AbstractMethodError:com.mysql.jdbc.Connection.isValid (I) Z
FIX: MySQL jar version number is too low, instead of Mysql-connector-java-5.1.34.jar (note that the latest is 5.1.35, lazy to download the latest. The 5.1.34 is running in tomcat8, no problem.
Official website: http://dev.mysql.com/downloads/connector/j/

2015.6.30

3 Problem solving for Tomcat connection to MySQL

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.