Home » Developer & Programmer » JDeveloper, Java & XML » javax.servlet.ServletException: Exception creating DataSource: org.hsql.jdbcDriver
javax.servlet.ServletException: Exception creating DataSource: org.hsql.jdbcDriver [message #216412] Sat, 27 January 2007 06:04
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member


sir you see my full coding



hi master
sir i edit my server.xml and web.xml but system give me this error

javax.servlet.ServletException: Exception creating DataSource: org.hsql.jdbcDriver


server.xml file code

**
- <Context path="/DBTest" docBase="DBTest" debug="5" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_DBTest_log." suffix=".txt" timestamp="true" />
<Resource name="jdbc/myoracle" auth="Container" type="javax.sql.DataSource" />
- <ResourceParams name="jdbc/myoracle">
- <parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
- <parameter>
<name>driverClassName</name>
<value>oracle.jdbc.OracleDriver</value>
</parameter>
- <parameter>
<name>url</name>
<value>jdbc:oracle:thin:@127.0.0.1:1521:aamir</value>
</parameter>
- <parameter>
<name>username</name>
<value>scott</value>
</parameter>
- <parameter>
<name>password</name>
<value>tiger</value>
</parameter>
- <parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
- <parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
- <parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
<Resource name="jdbc/myoracle" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@127.0.0.1:1521:aamir" username="muhammad" password="mfa786" maxActive="20" maxIdle="10" maxWait="-1" />
</Context

*******

web.xml file
*********
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>testconn</servlet-name>
<servlet-class>testconn</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testconn</servlet-name>
<url-pattern>/servlet/testconn</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
<welcome-file>
index.html
</welcome-file>
<welcome-file>
index.htm
</welcome-file>
</welcome-file-list>
<resource-ref>
<description>Oracle Datasource example</description>
<res-ref-name>jdbc/myoracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>



this is my test jsp code
<HTML>
<%@ page import="java.sql.*,java.util.*" %>
<%@ page import="javax.sql.DataSource" %>
<%@ page import="javax.naming.Context" %>
<%@ page import="javax.naming.InitialContext"%>
<%
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Connection conn = ds.getConnection();
%>
<br>
TEST DONE!
</HTML>

but server give me error

javax.servlet.ServletException: Exception creating DataSource: org.hsql.jdbcDriver
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.bistest$jsp._jspService(bistest$jsp.java:96)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:226)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.netbeans.modules.web.monitor

sir please give me idea ho i access my oracel data in jsp page with datasource

thanks


when i complied the project the netbeans give me this error

==========
Warning: ZIP files located in the WEB-INF/lib directory are not automatically added to Tomcat's execution classpath.
See the online help topic "Setting Tomcat Installation Properties" for adding ZIP files using the External Execution Process property.
==========
Previous Topic: xml Sequence displaying errors.
Next Topic: ORA-00911: invalid character when using X-path in XSQL
Goto Forum:
  


Current Time: Sun Nov 24 13:22:52 CST 2024