tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Omkar Joshi" <omj...@hotmail.com>
Subject Cannot create JDBC driver of class '' for connect URL 'null'
Date Mon, 03 Nov 2003 13:50:49 GMT
Hi,

Am arunning application on tomcat 4.1.24

I want to use DBCP for my connection with oracle.
I have created a .xml file for the application in weapps folder.

the code for the file is.

<Context className="org.apache.catalina.core.StandardContext" path="/NIMS" 
docBase="D:/Tomcat/webapps/NIMS" debug="9" reloadable="true" 
mapperClass="org.apache.catalina.core.StandardContextMapper"
displayName="NIMS">
<Loader checkInterval="3"/>
<Logger className="org.apache.catalina.logger.SystemOutLogger" 
timestamp="true"/>
<Resource name="jdbc/nims" auth="Container"
type="javax.sql.DataSource"/>

<ResourceParams name="jdbc/nims">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@172.16.16.22:1521:nims</value>
</parameter>
<parameter>
<name>username</name>
<value>nimsuser</value>
</parameter>
<parameter>
<name>password</name>
<value>nimsdata123</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>
<parameter> <name>validationQuery</name> <value>select 1 from dual</value>

</parameter> <parameter> <name>testOnBorrow</name> <value>true</value>

</parameter>
<parameter>
<name>timeBetweenEvictionRunsMillis</name>
<value>300000</value>
</parameter>
<parameter>
<name>numTestsPerEvictionRun</name>
<value>3</value>
</parameter>
<parameter>
<name>minEvictableIdleTimeMillis</name>
<value>1800000</value>
</parameter>
<parameter>
<name>testWhileIdle</name>
<value>true</value>
</parameter>
</ResourceParams>
</Context>


The entry in web.xml file is as follows,

resource-ref>
<description>Oracle Datasource example</description>
<res-ref-name>jdbc/nims</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>


but when i call this connection in my jsp page

<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.rmi.*" %>
<%@ page import="javax.naming.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<html>
<head>
<title>Cable and Wireless</title>
</head>

<body bgcolor="#FFFFFF" text="#000000" 
onload="javascript:{if(parent.frames[0]&&parent.frames['topFrame'].Go)parent.frames['topFrame'].Go()}">
<%
try
{

Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/nims");
Connection conn = ds.getConnection();



am getting error
"Cannot create JDBC driver of class '' for connect URL 'null' "

help me

_________________________________________________________________
MSN Hotmail now on your Mobile phone. 
http://server1.msn.co.in/sp03/mobilesms/ Click here.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message