Hello Daniel,

> Am 17. Juni 2024 22:18:53 MESZ schrieb Daniel Schwartz
> <d...@danielgschwartz.com>:
> >Hello,
> >
> >
> >
> >I'm trying to set up MySQL 8.0.11 database connection pooling in Tomcat
> >10.1.24 on Windows 10.  The MySQL database is "holidays" with user name
> >"root" and password "rootpwd". I've tried to follow the examples at
> >https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto
> >.html
> >#MySQL_DBCP_2_Example.
> >
> >
> >
> >Attached are my files context.xml, which I put in the Tomcat conf
> >directory, and web.xml, which I put in my project WEB-INF directory.
> >Also attached is my file DataSourceSingleton.java, which is the program
> >file that crashes on the line
> >
> >
> >
> >    dataSource = (DataSource) ctx.lookup("jdbc/holidays");
> >


Could you try the path ctx.lookup("java:comp/env/jdbc/holidays");  ?


> >
> >
> >producing the error message
> >
> >
> >
> >    javax.naming.NameNotFoundException: Name [jdbc/holidays] is not
> >bound in this Context. Unable to find [jdbc].
> >
> >
> >
> >in the Command Prompt where Tomcat is running.  I must be missing some
> >little thing.  Can anyone help?
> 
> Have you added the MySQL jar to your installation? Where did you place it?
> 
> Are there any error messages in catalina.out and/or localhost_<date>.log 
> files?
> 
> Felix
> 
> >
Greetings, Thomas

Reply via email to