Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
AW: Tomcat 5 and oracle

AW: Tomcat 5 and oracle

2003-12-10       - By Ullrich, Ralf

 Back
have you tried with classes111.jar instead?

cheers,

ralf

-- --Urspr�ngliche Nachricht-- --
Von: Jonathan Drnek [mailto:Jonathan.Drnek@(protected)]
Gesendet: Mittwoch, 10. Dezember 2003 16:59
An: Tomcat Users List
Betreff: RE: Tomcat 5 and oracle


I'm not sure how that got removed, but I put it back in and it did not
help.  

I can do the following:

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@(protected):1521:ORDT","ordl
ine","junk");

So I assume that I have the right oracle drivers etc, I just don't have
JNDI or dbcp setup right.


Thanks for the suggestion

-- --Original Message-- --
From: Knight, Digby [mailto:Digby_Knight@(protected)]
Sent: Wednesday, December 10, 2003 10:10 AM
To: tomcat-user@(protected)
Subject: RE: Tomcat 5 and oracle

You may need the following in your server.xml ResourceParams:

   <parameter>
     <name>factory</name>
     <value>org.apache.commons.dbcp.BasicDataSourceFactory Source code of org.apache.commons.dbcp.BasicDataSourceFactory</value>
   </parameter>

It's described in more detail in:
http://jakarta.apache.org/tomcat/tomcat-4 (See http://cat-4.ora-code.com).1-doc/jndi-datasource-examples
-how
to.html
<http://jakarta.apache.org/tomcat/tomcat-4 (See http://cat-4.ora-code.com).1-doc/jndi-datasource-example
s-ho
wto.html>
-- --Original Message-- --
From: Jonathan Drnek [mailto:Jonathan.Drnek@(protected)]
Sent: 10 December 2003 14:37
To: tomcat-user@(protected)
Subject: Tomcat 5 and oracle


I am having a problem setting up a data source in tomcat.  I seem to
remember having this problem last time I played with it several moths
ago
but I don't remember what I did to fix it.

I am running Tomcat 5.0.16 with JVM version 1.4.2_03-b02 on windows
2000.

I am trying to connect to an Oracle 8.1.7.1.0 database.

I have placed the ojdbc14.jar file in common\lib

The error I am getting is

javax.servlet.ServletException Source code of javax.servlet.ServletException: Cannot create JDBC driver of class ''
for
connect URL 'null', cause: No suitable driver

I am using oracle.jdbc.driver.OracleDriver because that's what the docs
said, but I seem to recall that was not correct.  I just can't find
anything
that tells me what other driver I should be using.


My server.xml file has

.
.
.
<Resource name="jdbc/ordt" type="javax.sql.DataSource Source code of javax.sql.DataSource"/>
.
.
.
</ResourceParams>
 <ResourceParams name="jdbc/ordt">
     <parameter>
       <name>validationQuery</name>
       <value>select * from dual</value>
     </parameter>
     <parameter>
       <name>url</name>
       <value>jdbc:oracle:thin:@(protected):1521:ORDT</value>
     </parameter>
     <parameter>
       <name>password</name>
       <value>password</value>
     </parameter>
     <parameter>
       <name>maxActive</name>
       <value>4</value>
     </parameter>
     <parameter>
       <name>maxWait</name>
       <value>5000</value>
     </parameter>
     <parameter>
       <name>driverClassName</name>
       <value>oracle.jdbc.driver.OracleDriver</value>
     </parameter>
     <parameter>
       <name>username</name>
       <value>username</value>
     </parameter>
     <parameter>
       <name>maxIdle</name>
       <value>2</value>
     </parameter>
</ResourceParams>
.
.
.

web.xml looks like

<?xml version="1.0" encoding="ISO-8859 (See http://ISO-8859.ora-code.com)-1"?>

<!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>
 <display-name>Metrology Lab</display-name>
 <description>
    First Source Metrology Lab
 </description>

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

</web-app>

my code looks like

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

Thanks for any help,

Jon Drnek



*****************************************************************
The information in this email and in any attachments is
confidential and intended solely for the attention and use
of the named addressee(s). This information may be
subject to legal professional or other privilege or may
otherwise be protected by work product immunity or other
legal rules.  It must not be disclosed to any person without
our authority.

If you are not the intended recipient, or a person
responsible for delivering it to the intended recipient, you
are not authorised to and must not disclose, copy,
distribute, or retain this message or any part of it.
*****************************************************************


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.