nested exception is java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null' - Spring MVC JNDI issue

落花浮王杯 提交于 2019-12-05 13:46:41

In Server.xml place resource under <GlobalNamingResources>

<GlobalNamingResources>
     <Resource auth="Container" 
        driverClassName="com.mysql.jdbc.Driver"
        maxActive="20" maxIdle="10" 
        maxWait="-1" 
        name="jdbc/UsersDB" 
        type="javax.sql.DataSource"
        username="root" password="root"
        url="jdbc:mysql://localhost:3306/test" />
</GlobalNamingResources>

In Context.xml

<ResourceLink global="jdbc/UsersDB" name="jdbc/UsersDB" auth="Container" type="javax.sql.DataSource"/>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!