• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

configure SQL Server 2000 DataSource in Tomcat 5.0.28

 
Tong Liu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a database called jspdev, and the username 'bn' and password 'bn' are used to access it.
The structure of the web app which i create is the following:
C:\Tomcat 5.0\webapps\ch13\storetest.jsp
where ch13 is the context root, and i added the following in web.xml

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/bn</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

and i also add the following in %Tomcat_Home%/conf/Catalina/localhost/manager.xml

<Resource
name="jdbc/bn"
type="javax.sql.DataSource"
password="bn"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
maxIdle="2"
maxWait="5000"
username="bn"
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=jspdev"
/>
<ResourceLink global="jdbc/bn" name="jdbc/bn" type="javax.sql.DataSource"/>

after these all done, when i tried to run this app in browser(IE 6+), it gives the following error?

------------------------------------------------------------------------
javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null'
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.storetest_jsp._jspService(storetest_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

-------------------------------------------------------------------------
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
com.jspdev.util.DatabaseConn.getConnection(DatabaseConn.java:16)
com.jspdev.ch13.StoreTest.<init>(StoreTest.java:11)
org.apache.jsp.storetest_jsp._jspService(storetest_jsp.java:49)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you put the JDBC driver?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic