Re: Datasource configuration issue
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Karthik, On 10/13/2009 6:18 AM, Karthik Nanjangude wrote: > Also suggested to have the JDBC Driver to be in TOMCAT/lib folder > rather then in the /webapps/application/web-inf/lib I believe this is a /requirement/, not just good practice. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrU/CsACgkQ9CaO5/Lv0PDVnACfVFx4Wh4Ep03X94xBMuDNvQp3 z/0AoIwEiZP7kakdbb2Q6EzG4c4CPIKP =+Zq+ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Datasource configuration issue
Hi Also suggested to have the JDBC Driver to be in TOMCAT/lib folder rather then in the /webapps/application/web-inf/lib with regards Karthik -Original Message- From: VijayKS [mailto:ksvijay...@gmail.com] Sent: Tuesday, October 13, 2009 1:31 PM To: users@tomcat.apache.org Subject: Datasource configuration issue Hi, I am using Tomcat 5.0. I have one application "test". In "test" i created "META-INF" folder and put "context.xml" file.Here is the content factory org.apache.commons.dbcp.BasicDataSourceFactory url jdbc:sqlserver://localhost;DatabaseName=test;SelectMethod=cursor; driverClassName com.microsoft.jdbc.sqlserver.SQLServerDriver username sa password sa in WEB-INF\web.xml" file i have the entires jdbc/PDBDataSource javax.sql.DataSource Container in my jsp code i have the code Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbc/PDBDataSource"); Connection conn = ds.getConnection(); conn.close(); I am getting the follwoing error when accessing my page javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779) org.apache.jsp.index_jsp._jspService(index_jsp.java:69) 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) Help me to resolve this :confused: -- View this message in context: http://www.nabble.com/Datasource-configuration-issue-tp25868686p25868686.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Datasource configuration issue
VijayKS wrote: > Hi, I am using Tomcat 5.0. > > I have one application "test". > In "test" i created "META-INF" folder and put "context.xml" file.Here is the > content > That should be >
Datasource configuration issue
Hi, I am using Tomcat 5.0. I have one application "test". In "test" i created "META-INF" folder and put "context.xml" file.Here is the content factory org.apache.commons.dbcp.BasicDataSourceFactory url jdbc:sqlserver://localhost;DatabaseName=test;SelectMethod=cursor; driverClassName com.microsoft.jdbc.sqlserver.SQLServerDriver username sa password sa in WEB-INF\web.xml" file i have the entires jdbc/PDBDataSource javax.sql.DataSource Container in my jsp code i have the code Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbc/PDBDataSource"); Connection conn = ds.getConnection(); conn.close(); I am getting the follwoing error when accessing my page javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779) org.apache.jsp.index_jsp._jspService(index_jsp.java:69) 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) Help me to resolve this :confused: -- View this message in context: http://www.nabble.com/Datasource-configuration-issue-tp25868686p25868686.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org