-1

I am using Tomcat 10.0.27 and i cant connect my database clear JDBC to Tomcat. I'm faced with the problem: my Tomcat local server didn't see my MySQL database with problem (see below in screenshot) enter image description here and my META-INF context.xml

<?xml version="1.0" encoding="UTF-8"?>
<Context>
    <Resource
            name="jdbc/MySQLDataBase" type="javax.sql.DataSource"
            maxActive="100" maxIdle="30" maxWait="10000"
            url="jdbc:mysql://localhost:3306/MySQLDataBase"
            driverClassName="com.mysql.jdbc.Driver"
            username="***" password="***"
    />
</Context>

and WEB-INF

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
         version="5.0">
    <resource-env-ref>
        <resource-env-ref-name>jdbc/MySQLDataBase</resource-env-ref-name>
        <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
    </resource-env-ref>
</web-app>

I connect to lib MySQL connector version 8.0.28.jar and tomcat-dbcp-java-9.0.58.jar+tomcat-juil-9.0.58.jar and faced with problem tray (already attached).

OLEGA_zz
  • 15
  • 1
  • 10

1 Answers1

0

try=> driverClassName=com.mysql.cj.jdbc.Driver or use => driver-class-name as the property name