tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastião Carlos Santos" <>
Subject JNDI + Oracle 9i Database
Date Tue, 25 Feb 2003 18:07:40 GMT
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"
          <ResourceParams name="jdbc/sged">
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"
    <description>Oracle Database Connection</description>
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();
                        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 (
                                resultado.append("Número de Conexões -> ");
                catch (java.lang.Exception e)
                        if (conn != null)
                                catch (java.lang.Exception ex)
                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
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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message