在MyEclipse Tomcat配置JNDI(mysql)

在<workspace目录>.metadata.me_tcat\conf目录下找到context.xml文件
加入以下内容,按照需要进行更改

<Resource name="jdbc/xxxx" auth="Container" type="javax.sql.DataSource"
	maxActive="100" maxIdle="30" maxWait="1000" username="root" password="123"
	driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/xxxxxxxxxx"
	removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"/>

在Myeclipse安装目录找到类似下面的路径,可能你的和我不太一样
<Myeclipse安装目录>\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_8.5.0.me201003121946\tomcat\lib 复制mysql的驱动包进这个目录

updatedupdated2023-12-062023-12-06