Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 22566 invoked from network); 13 May 2007 20:00:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 May 2007 20:00:55 -0000 Received: (qmail 25616 invoked by uid 500); 13 May 2007 20:00:48 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 25590 invoked by uid 500); 13 May 2007 20:00:48 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 25578 invoked by uid 99); 13 May 2007 20:00:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 May 2007 13:00:48 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of mgainty@hotmail.com designates 65.54.246.209 as permitted sender) Received: from [65.54.246.209] (HELO bay0-omc3-s9.bay0.hotmail.com) (65.54.246.209) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 May 2007 13:00:41 -0700 Received: from hotmail.com ([65.55.138.14]) by bay0-omc3-s9.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sun, 13 May 2007 13:00:20 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 13 May 2007 13:00:17 -0700 Message-ID: Received: from 24.63.77.77 by BAY133-DAV4.phx.gbl with DAV; Sun, 13 May 2007 20:00:13 +0000 X-Originating-IP: [24.63.77.77] X-Originating-Email: [mgainty@hotmail.com] X-Sender: mgainty@hotmail.com Reply-To: "Martin Gainty" From: "Martin Gainty" To: "Tomcat Users List" References: <3ef28230705121431g34798dady9a5fa907b7449280@mail.gmail.com> <3ef28230705131223h23748a4ela7bb9efeaf0f5fee@mail.gmail.com> Subject: Re: Oracle JDBC connection Tomcat 5.5 Date: Sun, 13 May 2007 16:00:06 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-2"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-OriginalArrivalTime: 13 May 2007 20:00:17.0908 (UTC) FILETIME=[543BAB40:01C79599] X-Virus-Checked: Checked by ClamAV on apache.org make sure the driver is ok first e.g. import java.sql.*; Properties props = new Properties(); String c_sUserNameKey="username"; String c_sPasswordKey="password"; String c_sDBURL ="jdbc:oracle:thin:@"; String c_sDriverName ="oracle.jdbc.driver.OracleDriver"; //Instantiate driver Driver c_Driver=null; try { c_Driver = (Driver)Class.forName( c_sDriverName ).newInstance(); } catch(SQLException sqle) { System.out.println("Cannot instantiate driver ..is it right version..is it on classpath?"); return; } //make sure Oracle listenet is operational (netstat -a | grep 1521) //make SURE Oracle DB is up and listening (tnsping SID) returns successful //make sure you acquire the username/password to establish connection to oracle db //place username,password into properties props.put( c_sUserNameKey, c_sDBUser ); props.put( c_sPasswordKey, c_sDBPassword ); //Get a connection try { Connection = c_Driver.connect( c_sDBURL, props ); } catch ( SQLException sqlex ) { System.out.println( "Error connecting to database", sqlex ); return; } //should get you started.. M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. ----- Original Message ----- From: "Rashmi Rubdi" To: "Tomcat Users List" Sent: Sunday, May 13, 2007 3:23 PM Subject: Re: Oracle JDBC connection Tomcat 5.5 > On 5/12/07, Zden�k Vr�bl�k wrote: >> Hi Rashmi, >> >> thans for reply. >> >> Configuration that is described in link you sent me works fine. >> Problem is when I change >> the datasource factory to Oracle datasource factory. Than is not >> possible to find this datasource through JNDI lookup and this >> connection disappear from admin console. >> I think that ojdbc14.jar is newer version of oracle drivers and it > > You are right, sorry you don't need classes12.jar in this case please > ignore my previous post. > > I also happen to have oracle 10g, in order to answer your question, I > was trying to see if I could set up a connection pool and then try to > get OracleConnection instead of SQL Connection, I tried for almost 1/2 > a day so far, to get things set up but got an error > "java.sql.SQLException: No more data to read from socket" that is > taking too long to figure out, even after searching for answers on the > Internet. I have other things to do :-) so I will give up on this for > now. > > Anyway, there's some more instructions here : > http://www.oracle.com/technology/sample_code/tech/java/oc4j/htdocs/jdbc_in_j2ee/jdbc_in_j2ee.html > > the above instructions are written for Oracle9iAS Container and not > Tomcat, however they demonstrate how to obtain OracleConnection ---- > may be you'll find some useful information there unless someone on > this list has a solution. > > You may also want to check with Oracle's Technology Forums. > >> works fine with standard datasource factory >> org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory and >> javax.sql.DataSource. It stops work when I use oracle datasource >> factory >> factory="oracle.jdbc.pool.OracleDataSourceFactory" and datasource type >> type="oracle.jdbc.pool.OracleDataSource". >> >> What I need is any solution how get OracleConnection instead of >> Connection to use. >> Do I miss any parameter in resource configuration? >> > auth="Container" >> type="oracle.jdbc.pool.OracleDataSource" >> factory="oracle.jdbc.pool.OracleDataSourceFactory" >> username="USER_51319" >> password="USER_51319" >> driverClassName="oracle.jdbc.OracleDriver" >> url="jdbc:oracle:thin:@192.168.100.119:1521:orcl" >> maxActive="20" maxIdle="10" maxwait="-1"/> >> >> Thanks. >> Zdenek >> > > -Regards > Rashmi > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org