mysql - java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null'] with root cause -
i trying establish connection database using jndi up
this context.xml have defined in webapp meta-inf folder
<resource name="jdbc/connectdb" auth="container" type="javax.sql.datasource" maxtotal="100" maxidle="30" maxwaitmillis="10000" username="root" password="" driverclassname="com.mysql.jdbc.driver" url="jdbc:mysql://localhost:3306/connect" />
i calling in web.xml folder using process
<resource-ref> <res-ref-name>jdbc/connectdb</res-ref-name> <res-type>javax.sql.datasource</res-type> <res-auth>container</res-auth> </resource-ref>
after research resolve error, have tried referencing file in catalina folder using webappname.xml. have added jar in lib folder of tomcat , still error exists.
this error trace
severe: servlet.service() servlet [dispatcher] in context path [/connectmain] threw exception [request processing failed; nested exception org.springframework.jdbc.cannotgetjdbcconnectionexception: not jdbc connection; nested exception java.sql.sqlexception: cannot create jdbc driver of class '' connect url 'null'] root cause java.sql.sqlexception: no suitable driver @ java.sql.drivermanager.getdriver(drivermanager.java:315)
please missing error
your xml file not location of error. need download jdbc drivers database able connect it.
also, don't think java file issue, again don't know workspace , haven't seen stack trace looks this. problem in method call database in java file calls drivermanager.getconnection([url of db], [username], [password]);
Comments
Post a Comment