JNDI + oracle + Tomcat
Hello, I try to connect to Oracle 8.1.7 using a DataSource (Tomcat 4.1.24). In the code, my datasource object is not null (Oracle driver have been founded) but on getConnection method I have the following error message : java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'null' Following is server.xml part : -- ResourceParams name=jdbc/app/geode parameter nameuser/name valueuser/value /parameter parameter namepassword/name valuepassword/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namedriverName/name valuejdbc:oracle:thin:@:1521:xx/value /parameter /ResourceParams Following is web.xml part : --- resource-ref descriptiongfds/description res-ref-namejdbc/app/geode/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Following is my code to obtain a connection : Context envGlobal = new InitialContext(); Context envApp = (Context)envGlobal.lookup(java:comp/env); DataSource m_oJdbcDataSource = ( DataSource )envApp.lookup(jdbc/app/geode); Connection l_connect = m_oJdbcDataSource.getConnection(); I don't understand why connect URL is null, somebody can help me ? Thank you. -- Faites un voeu et puis Voila ! www.voila.fr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JNDI + oracle + Tomcat
Sorry... I haven't seen that 'driverName' attribute has chenged in 'url' Hello, I try to connect to Oracle 8.1.7 using a DataSource (Tomcat 4.1.24). In the code, my datasource object is not null (Oracle driver have been founded) but on getConnection method I have the following error message : java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'null' Following is server.xml part : -- ResourceParams name=jdbc/app/geode parameter nameuser/name valueuser/value /parameter parameter namepassword/name valuepassword/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namedriverName/name valuejdbc:oracle:thin:@:1521:xx/value /parameter /ResourceParams Following is web.xml part : --- resource-ref descriptiongfds/description res-ref-namejdbc/app/geode/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Following is my code to obtain a connection : Context envGlobal = new InitialContext(); Context envApp = (Context)envGlobal.lookup(java:comp/env); DataSource m_oJdbcDataSource = ( DataSource )envApp.lookup(jdbc/app/geode); Connection l_connect = m_oJdbcDataSource.getConnection(); I don't understand why connect URL is null, somebody can help me ? Thank you. -- Faites un voeu et puis Voila ! www.voila.fr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Faites un voeu et puis Voila ! www.voila.fr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JNDI + Oracle + Pool
I am using the Connection pool through JNDI Datasource to connect me to the database Oracle, however as I can be sure that the pool is working correctly. Below it is the configuration of my server.xml for the pool through JNDI datasource. Resource name=jdbc/ged auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/ged parameternamefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternameusername/namevaluescott/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternameurl/name valuejdbc:oracle:thin:@xxx.yyy.zz:1521:AEI/value/parameter parameternamemaxActive/namevalue3/value/parameter parameternamemaxIdle/namevalue2/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue60/value/parameter /ResourceParams How can I be tested the pool of connections is working correctly, in other words, if my new requests of connections are being assisted by the pool instead of happening the creation of new connections? Sebastião Carlos Santos Oracle Database Administrator - OCP DBA 8i 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]
Re: JNDI + Oracle + Pool
Hi, Write a JSP or servlet in that get the DataSource and connections for the value, which is greater than the max connections defined for the datasource in a for loop as : If Max connections defined are 10 Datasourceds=ctxt.lookup(); Connnection con= null; for(int i=0;i11;i++){ con = ds.getConnection(); if(con != null){ out.println(Connection obtained for +(i+1)); } else{ out.println(Connection failure.); } } Beacuse, here we are not closing the connections after getting from the Datasource, they will be active. so for 11th connection it returns null. Check the same by closing the connection for the 10th connection. You should be able to get from the DataSource. I guess it should give you the proper result... Ragards. Pratt - Original Message - From: Sebastião Carlos Santos [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, March 08, 2003 5:34 PM Subject: JNDI + Oracle + Pool I am using the Connection pool through JNDI Datasource to connect me to the database Oracle, however as I can be sure that the pool is working correctly. Below it is the configuration of my server.xml for the pool through JNDI datasource. Resource name=jdbc/ged auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/ged parameternamefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternameusername/namevaluescott/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternameurl/name valuejdbc:oracle:thin:@xxx.yyy.zz:1521:AEI/value/parameter parameternamemaxActive/namevalue3/value/parameter parameternamemaxIdle/namevalue2/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue60/value/parameter /ResourceParams How can I be tested the pool of connections is working correctly, in other words, if my new requests of connections are being assisted by the pool instead of happening the creation of new connections? Sebastião Carlos Santos Oracle Database Administrator - OCP DBA 8i 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI + Oracle + Pool
I guess you would need to test it out. Make a program which in a loop uses JNDI to get a connection, but doesn't close it. I guess you would need to set removeAbandoned to false though, if your test program doesn't hold a reference to every connection that it obtains. Hope that helps, Tarun On Sat, 2003-03-08 at 17:34, =?us-ascii?Q?=22Sebasti=E3o_Carlos_Santos=22?= wrote: I am using the Connection pool through JNDI Datasource to connect me to the database Oracle, however as I can be sure that the pool is working correctly. Below it is the configuration of my server.xml for the pool through JNDI datasource. Resource name=jdbc/ged auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/ged parameternamefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternameusername/namevaluescott/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternameurl/name valuejdbc:oracle:thin:xxx.yyy.zz:1521:AEI/value/parameter parameternamemaxActive/namevalue3/value/parameter parameternamemaxIdle/namevalue2/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue60/value/parameter /ResourceParams How can I be tested the pool of connections is working correctly, in other words, if my new requests of connections are being assisted by the pool instead of happening the creation of new connections? Sebastio Carlos Santos Oracle Database Administrator - OCP DBA 8i Universidade Federal de Uberlndia - UFU Gratificao de Estmulo Docncia - GED - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JNDI + Oracle
Recently I configured JNDI with the intention of having a pool of connections working among my servant of applications (tomcat 4.1.18 + Apache 1.3.27) and the database servant Oracle 9i. However would I like to know how I can really be tested the pool of connections by JNDI works? The example that exists in JNDI Datasource HowTo demonstrates the alone use and only only for a connection. The one that I want is to have certainty that the defined parameters in the configuration of JNDI are working correctly and as they should work, as for instance, the maximum number of connections that can be open, the minimum number, etc. I thank the help in advance of all. Ps. Therefore I lower is the configuration of my JNDI in server.xml Resource name=jdbc/ged auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/ged parameternamefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternameusername/namevaluescott/value/parameter parameternamepassword/namevaluea/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternameurl/name valuejdbc:oracle:thin:@xxx.xxx.yy:1521:ZZZ/value/parameter parameternamemaxActive/namevalue10/value/parameter parameternamemaxIdle/namevalue5/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue60/value/parameter /ResourceParams 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]
JNDI + Oracle + Pool
I am using the Connection pool through JNDI Datasource to connect me to the database Oracle, however as I can be sure that the pool is working correctly. Below it is the configuration of my server.xml for the pool through JNDI datasource. Resource name=jdbc/ged auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/ged parameternamefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternameusername/namevaluescott/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternameurl/name valuejdbc:oracle:thin:@xxx.yyy.zz:1521:AEI/value/parameter parameternamemaxActive/namevalue3/value/parameter parameternamemaxIdle/namevalue2/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue60/value/parameter /ResourceParams How can I be tested the pool of connections is working correctly, in other words, if my new requests of connections are being assisted by the pool instead of happening the creation of new connections? Sebastião Carlos Santos Oracle Database Administrator - OCP DBA 8i 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]
JNDI + Oracle + Pool
I am using the Connection pool through JNDI Datasource to connect me to the database Oracle, however as I can be sure that the pool is working correctly. How can I be tested the pool of connections is working correctly, in other words, if my new requests of connections are being assisted by the pool instead of happening the creation of new connections?
JNDI + Oracle 9i Database
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 parameternamefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternameurl/name valuejdbc:oracle:[EMAIL PROTECTED]:1521:XXX/value/parameter parameternameusername/namevaluescott/value/parameter parameternamepassword/namevaluej/value/parameter parameternamemaxActive/namevalue20/value/parameter parameternamemaxIdle/namevalue10/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue60/value/parameter parameternamelogAbandoned/namevaluetrue/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 descriptionOracle Database Connection/description resource-ref descriptionPool/description res-ref-namejdbc/sged/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref welcome-file-list welcome-fileindex.html/welcome-file welcome-fileindex.jsp/welcome-file welcome-fileindex.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