Hi [difficult name ommited],

I had this problem a couple of weeks ago.

try changing the url to capitals !

<name>URL</name>

This fixed an identical problem for me.

Thanks,

Mehdi Nejad



                                                                                       
                                               
                      "Sebasti�o Carlos                                                
                                               
                      Santos"                  To:       [EMAIL PROTECTED]             
                                  
                      <[EMAIL PROTECTED]        cc:                                    
                                                
                      .com.br>                 Subject:  JNDI + Tomcat + Oracle 9i 
Database                                           
                                                                                       
                                               
                      25/02/2003 15:02                                                 
                                               
                      Please respond to                                                
                                               
                      "Tomcat Users                                                    
                                               
                      List"                                                            
                                               
                                                                                       
                                               
                                                                                       
                                               




I am trying to configure JNDI to access Oracle 9i R1,
according to JNDI Datasource HOW-TO,
however I am not obtaining a lot of success when I go
to establish the connection.

In the end of this e-mail I will list some fragments of the configuration
of server.xml,
web.xml and of my class java that I am using to accomplish the connection
test.

The reference $CATALINA_HOME/common/lib/*. jar is in CLASSPATH of the
system

Fragment of configuration of server.xml

...
          <Resource name="jdbc/sged" auth="Container"
                    type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/sged">
            <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:[EMAIL PROTECTED]:1521:XXX</value></parameter>

<parameter><name>username</name><value>scott</value></parameter>

<parameter><name>password</name><value>jjjjj</value></parameter>
            <parameter><name>maxActive</name><value>20</value></parameter>
            <parameter><name>maxIdle</name><value>10</value></parameter>
            <parameter><name>maxWait</name><value>10000</value></parameter>

<parameter><name>removeAbandoned</name><value>true</value></parameter>

<parameter><name>removeAbandonedTimeout</name><value>60</value></parameter>

<parameter><name>logAbandoned</name><value>true</value></parameter>
          </ResourceParams>
...

File /web/WEB-INF/web.xml

<?xml version="1.0" encoding="ISO-8859-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>
    <description>Oracle Database Connection</description>
    <resource-ref>
      <description>Pool</description>
      <res-ref-name>jdbc/sged</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>index.htm</welcome-file>
    </welcome-file-list>
  </web-app>


Method of the class java that makes the connection test

public String obtem_dados()
            {
                Connection conn = null;
                Statement stmt = null;
                ResultSet rset = null;
                resultado = new StringBuffer();
                try
                    {
                        Context initContext = new InitialContext();
                        Context envContext = (Context)initContext.lookup
("java:/comp/env");
                        DataSource ds = (DataSource)envContext.lookup
("jdbc/sged");
                        conn = ds.getConnection();
                        stmt = conn.createStatement();
                        rset = stmt.executeQuery("SELECT COUNT(*) FROM
V$SESSION");
                        if (rset.next())
                            {
                                resultado.append("N�mero de Conex�es -> ");
                                resultado.append(rset.getString(1));
                                resultado.append("<br>");
                            }
                    }
                catch (java.lang.Exception e)
                    {
                        resultado.append(e.getMessage());
                        resultado.append("<br>");
                    }
                finally
                    {
                        if (conn != null)
                            {
                                try
                                    {
                                        conn.close();
                                    }
                                catch (java.lang.Exception ex)
                                    {
                                        resultado.append(ex.getMessage());
                                        resultado.append("<br>");
                                    }
                            }
                    }
                return ((resultado.toString()));
            }

Ao executar o m�todo anterior, recebo a seguinte mensagem de erro:

Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for
connect URL jdbc:oracle:[EMAIL PROTECTED]:1521:XXX

Algu�m tem alguma id�ia do que pode estar acontecendo?

Excuse me for the gigantic message.
I thank in advance.
Sebasti�o Carlos Santos
Oracle Database Administrator
Universidade Federal de Uberl�ndia - UFU
Gratifica��o de Est�mulo � Doc�ncia - GED






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to