RE: Oracle connection pooling

2009-02-13 Thread Hamacher, Eric
I was just putting some fake values there.

But I got around the problem (although I can't remember how)  Now I put:

Resource name=jdbc/GFDataSource auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server:port:SID/

into META-INF/context.xml.  The type javax.sql.DataSource didn't work.  Now 
when I call getConnection() on the OracleDataSource I get:

java.sql.SQLException: User credentials doesn't match the existing ones
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.validateUser(OracleImplicitConnectionCache.java:258)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:314)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:286)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:179)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:159)

This looks like an Oracle problem.

Thanks for all your help!!

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Thursday, February 12, 2009 4:27 PM
To: 'Tomcat Users List'
Subject: RE: Oracle connection pooling

Yeah --  looked like an odd port to me, too -- I've only seen 1521, 1526 
and 1527 before.
I figured his SID was just a generic placeholder for his real SID.

-Original Message-
From: Jorge Medina [mailto:jmed...@e-dialog.com]
Sent: Thursday, February 12, 2009 4:12 PM
To: Tomcat Users List
Subject: RE: Oracle connection pooling


Is your Oracle database port  and is the name of your SID SID?

We use Oracle jdbc driver with Oracle 10g.
I set the attributes on the resource to:
   type=javax.sql.DataSource
   driverClassName=oracle.jdbc.OracleDriver
and no factory


-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
Sent: Thursday, February 12, 2009 3:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at
survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at
util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at
util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
8)

when I add:

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=GLP_S
password=gideupstg
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

to either server.xml (under Server), config/context.xml (under Context), or 
in META-INF/context.xml.

Here's what these files look like when I place Resource in them:

** SERVER.XML
***

Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener
className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
/
  GlobalNamingResources
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved

factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource

RE: Oracle connection pooling

2009-02-13 Thread Propes, Barry L
For factory,  I have

 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory 
 type=javax.sql.DataSource/

I'd try taking out that line you have --

type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory

And switch up accordingly. See if that doesn't work.

-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com] 
Sent: Friday, February 13, 2009 11:45 AM
To: Tomcat Users List
Subject: RE: Oracle connection pooling

I was just putting some fake values there.

But I got around the problem (although I can't remember how)  Now I put:

Resource name=jdbc/GFDataSource auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server:port:SID/

into META-INF/context.xml.  The type javax.sql.DataSource didn't work.  Now 
when I call getConnection() on the OracleDataSource I get:

java.sql.SQLException: User credentials doesn't match the existing ones
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.validateUser(OracleImplicitConnectionCache.java:258)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:314)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:286)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:179)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:159)

This looks like an Oracle problem.

Thanks for all your help!!

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Thursday, February 12, 2009 4:27 PM
To: 'Tomcat Users List'
Subject: RE: Oracle connection pooling

Yeah --  looked like an odd port to me, too -- I've only seen 1521, 1526 
and 1527 before.
I figured his SID was just a generic placeholder for his real SID.

-Original Message-
From: Jorge Medina [mailto:jmed...@e-dialog.com]
Sent: Thursday, February 12, 2009 4:12 PM
To: Tomcat Users List
Subject: RE: Oracle connection pooling


Is your Oracle database port  and is the name of your SID SID?

We use Oracle jdbc driver with Oracle 10g.
I set the attributes on the resource to:
   type=javax.sql.DataSource
   driverClassName=oracle.jdbc.OracleDriver
and no factory


-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
Sent: Thursday, February 12, 2009 3:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at
survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at
util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at
util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
8)

when I add:

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=GLP_S
password=gideupstg
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

to either server.xml (under Server), config/context.xml (under Context), or 
in META-INF/context.xml.

Here's what these files look like when I place Resource in them:

** SERVER.XML
***

Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener
className

RE: Oracle connection pooling

2009-02-13 Thread Hamacher, Eric
Thanks, I was able to get connections that way.  However, I use Oracle-specific 
classes like:

oracle.jdbc.OracleTypes;
oracle.jdbc.internal.OracleCallableStatement;
oracle.sql.ARRAY;
oracle.sql.ArrayDescriptor;

which require Oracle-specific connections.  I've filed a Service Request with 
MetaLink to see if Oracle folks know what to do.  I had the exact same problems 
with jBoss, too.  The remedy there was to put jBoss-specfic code in the 
application - not an option with us.

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative


-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Friday, February 13, 2009 12:12 PM
To: 'Tomcat Users List'
Subject: RE: Oracle connection pooling

For factory,  I have

 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory
 type=javax.sql.DataSource/

I'd try taking out that line you have --

type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory

And switch up accordingly. See if that doesn't work.

-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
Sent: Friday, February 13, 2009 11:45 AM
To: Tomcat Users List
Subject: RE: Oracle connection pooling

I was just putting some fake values there.

But I got around the problem (although I can't remember how)  Now I put:

Resource name=jdbc/GFDataSource auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server:port:SID/

into META-INF/context.xml.  The type javax.sql.DataSource didn't work.  Now 
when I call getConnection() on the OracleDataSource I get:

java.sql.SQLException: User credentials doesn't match the existing ones
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.validateUser(OracleImplicitConnectionCache.java:258)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:314)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:286)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:179)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:159)

This looks like an Oracle problem.

Thanks for all your help!!

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Thursday, February 12, 2009 4:27 PM
To: 'Tomcat Users List'
Subject: RE: Oracle connection pooling

Yeah --  looked like an odd port to me, too -- I've only seen 1521, 1526 
and 1527 before.
I figured his SID was just a generic placeholder for his real SID.

-Original Message-
From: Jorge Medina [mailto:jmed...@e-dialog.com]
Sent: Thursday, February 12, 2009 4:12 PM
To: Tomcat Users List
Subject: RE: Oracle connection pooling


Is your Oracle database port  and is the name of your SID SID?

We use Oracle jdbc driver with Oracle 10g.
I set the attributes on the resource to:
   type=javax.sql.DataSource
   driverClassName=oracle.jdbc.OracleDriver
and no factory


-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
Sent: Thursday, February 12, 2009 3:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at
survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at
util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at
util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
8)

when I add:

Resource name=jdbc/GFDataSource auth=Container
  type

RE: Oracle connection pooling

2009-02-13 Thread Martin Gainty

Eric-

the serviceID in your connect string should match the supplied SID from 
%ORACLE_HOME%/network/admin/tnsnames.ora
if no SID is supplied Oracle takes the TNS entryname e.g. 
contents of %TOMCAT_HOME%/network/admin/tnsnames.ora

FOOBAR =
..
 (SID=FOOBAR2)


the SID is FOOBAR2
if SID is not present SID is assigned FOOBAR

As a quick check go to sqlplus login with supplied username/password (verify 
credentials for current TNS)
HTH
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




 From: eric_hamac...@gallup.com
 To: users@tomcat.apache.org
 Date: Fri, 13 Feb 2009 11:44:43 -0600
 Subject: RE: Oracle connection pooling
 
 I was just putting some fake values there.
 
 But I got around the problem (although I can't remember how)  Now I put:
 
 Resource name=jdbc/GFDataSource auth=Container
 type=oracle.jdbc.pool.OracleDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 connectionCachingEnabled=true
 maxActive=30
 maxIdle=2
 maxWait=1000
 username=username
 password=password
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@server:port:SID/
 
 into META-INF/context.xml.  The type javax.sql.DataSource didn't work.  Now 
 when I call getConnection() on the OracleDataSource I get:
 
 java.sql.SQLException: User credentials doesn't match the existing ones
 at 
 oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
 at 
 oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
 at 
 oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
 at 
 oracle.jdbc.pool.OracleImplicitConnectionCache.validateUser(OracleImplicitConnectionCache.java:258)
 at 
 oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:314)
 at 
 oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:286)
 at 
 oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:179)
 at 
 oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:159)
 
 This looks like an Oracle problem.
 
 Thanks for all your help!!
 
 J.  ERIC  HAMACHER
 Software Application Developer
 608.664.3859
 8476 Greenway Boulevard
 Suite 100
 Middleton, WI  53562
 USA
 GALLUP Technology
 
 Achiever | Learner | Restorative | Intellection | Deliberative
 
 -Original Message-
 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Sent: Thursday, February 12, 2009 4:27 PM
 To: 'Tomcat Users List'
 Subject: RE: Oracle connection pooling
 
 Yeah --  looked like an odd port to me, too -- I've only seen 1521, 1526 
 and 1527 before.
 I figured his SID was just a generic placeholder for his real SID.
 
 -Original Message-
 From: Jorge Medina [mailto:jmed...@e-dialog.com]
 Sent: Thursday, February 12, 2009 4:12 PM
 To: Tomcat Users List
 Subject: RE: Oracle connection pooling
 
 
 Is your Oracle database port  and is the name of your SID SID?
 
 We use Oracle jdbc driver with Oracle 10g.
 I set the attributes on the resource to:
type=javax.sql.DataSource
driverClassName=oracle.jdbc.OracleDriver
 and no factory
 
 
 -Original Message-
 From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
 Sent: Thursday, February 12, 2009 3:52 PM
 To: users@tomcat.apache.org
 Subject: Oracle connection pooling
 
 Hello:
 
 I am in a bind.
 
 I am getting:
 
 javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at
 org.apache.naming.NamingContext.lookup(NamingContext.java:770)
   at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
   at
 org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
   at javax.naming.InitialContext.lookup(InitialContext.java:351)
   at
 survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
   at
 util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
   at
 util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
 8)
 
 when I add:
 
 Resource name=jdbc/GFDataSource auth=Container
   type=oracle.jdbc.pool.OracleDataSource
   factory=oracle.jdbc.pool.OracleDataSourceFactory
   connectionCachingEnabled=true
 maxActive=30
 maxIdle=2
 maxWait=1000
 username=GLP_S
 password=gideupstg

RE: Oracle connection pooling

2009-02-13 Thread Propes, Barry L
I guess I'm not sure why...I have all kinds of packages and stored procs in 
mine, and yet I'm never using Oracle-specific classes.

It's probably too lengthy an explanation for you as to why you have to or need 
to use them.

 

-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com] 
Sent: Friday, February 13, 2009 1:55 PM
To: Tomcat Users List
Subject: RE: Oracle connection pooling

Thanks, I was able to get connections that way.  However, I use Oracle-specific 
classes like:

oracle.jdbc.OracleTypes;
oracle.jdbc.internal.OracleCallableStatement;
oracle.sql.ARRAY;
oracle.sql.ArrayDescriptor;

which require Oracle-specific connections.  I've filed a Service Request with 
MetaLink to see if Oracle folks know what to do.  I had the exact same problems 
with jBoss, too.  The remedy there was to put jBoss-specfic code in the 
application - not an option with us.

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative


-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Friday, February 13, 2009 12:12 PM
To: 'Tomcat Users List'
Subject: RE: Oracle connection pooling

For factory,  I have

 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory
 type=javax.sql.DataSource/

I'd try taking out that line you have --

type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory

And switch up accordingly. See if that doesn't work.

-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
Sent: Friday, February 13, 2009 11:45 AM
To: Tomcat Users List
Subject: RE: Oracle connection pooling

I was just putting some fake values there.

But I got around the problem (although I can't remember how)  Now I put:

Resource name=jdbc/GFDataSource auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server:port:SID/

into META-INF/context.xml.  The type javax.sql.DataSource didn't work.  Now 
when I call getConnection() on the OracleDataSource I get:

java.sql.SQLException: User credentials doesn't match the existing ones
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.validateUser(OracleImplicitConnectionCache.java:258)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:314)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:286)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:179)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:159)

This looks like an Oracle problem.

Thanks for all your help!!

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Thursday, February 12, 2009 4:27 PM
To: 'Tomcat Users List'
Subject: RE: Oracle connection pooling

Yeah --  looked like an odd port to me, too -- I've only seen 1521, 1526 
and 1527 before.
I figured his SID was just a generic placeholder for his real SID.

-Original Message-
From: Jorge Medina [mailto:jmed...@e-dialog.com]
Sent: Thursday, February 12, 2009 4:12 PM
To: Tomcat Users List
Subject: RE: Oracle connection pooling


Is your Oracle database port  and is the name of your SID SID?

We use Oracle jdbc driver with Oracle 10g.
I set the attributes on the resource to:
   type=javax.sql.DataSource
   driverClassName=oracle.jdbc.OracleDriver
and no factory


-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
Sent: Thursday, February 12, 2009 3:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137

RE: Oracle connection pooling

2009-02-13 Thread Uma Gudi
Hi Eric,

I am executing as Stand-alone(my .class file out the tomcat), Is 
it possible to lookup for JNDI, As Tomcat running in the same machine.
Thanks and Regards
Uma Maheswara Rao Gudi
Tata Consultancy Services
Mailto: uma.g...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Outsourcing




Hamacher, Eric eric_hamac...@gallup.com 
02/13/2009 11:14 PM
Please respond to
Tomcat Users List users@tomcat.apache.org


To
Tomcat Users List users@tomcat.apache.org
cc

Subject
RE: Oracle connection pooling






I was just putting some fake values there.

But I got around the problem (although I can't remember how)  Now I put:

Resource name=jdbc/GFDataSource auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server:port:SID/

into META-INF/context.xml.  The type javax.sql.DataSource didn't work. 
Now when I call getConnection() on the OracleDataSource I get:

java.sql.SQLException: User credentials doesn't match the existing ones
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.validateUser(OracleImplicitConnectionCache.java:258)
at 
oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:314)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:286)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:179)
at 
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:159)

This looks like an Oracle problem.

Thanks for all your help!!

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Thursday, February 12, 2009 4:27 PM
To: 'Tomcat Users List'
Subject: RE: Oracle connection pooling

Yeah --  looked like an odd port to me, too -- I've only seen 1521, 
1526 and 1527 before.
I figured his SID was just a generic placeholder for his real SID.

-Original Message-
From: Jorge Medina [mailto:jmed...@e-dialog.com]
Sent: Thursday, February 12, 2009 4:12 PM
To: Tomcat Users List
Subject: RE: Oracle connection pooling


Is your Oracle database port  and is the name of your SID SID?

We use Oracle jdbc driver with Oracle 10g.
I set the attributes on the resource to:
   type=javax.sql.DataSource
   driverClassName=oracle.jdbc.OracleDriver
and no factory


-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
Sent: Thursday, February 12, 2009 3:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context 
at
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at
survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at
util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at
util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
8)

when I add:

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=GLP_S
password=gideupstg
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

to either server.xml (under Server), config/context.xml (under 
Context), or in META-INF/context.xml.

Here's what these files look like when I place Resource in them:

** SERVER.XML
***

Server port=8005 shutdown=SHUTDOWN
  Listener className

RE: Oracle connection pooling

2009-02-12 Thread Jorge Medina
Try 

ds = (DataSource)context.lookup(java:/comp/env/jdbc/GFDataSource); 

-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com] 
Sent: Thursday, February 12, 2009 3:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this
Context at
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at
survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at
util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at
util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
8)

when I add:

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=GLP_S
password=gideupstg
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

to either server.xml (under Server), config/context.xml (under
Context), or in META-INF/context.xml.

Here's what these files look like when I place Resource in them:

** SERVER.XML
***

Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener
className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
/
  GlobalNamingResources
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
 
factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

  /GlobalNamingResources
  Service name=Catalina

Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /

Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host
/Engine
  /Service
/Server

*** CONFIG/CONTEXT.XML
***


Context
Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/
WatchedResourceWEB-INF/web.xml/WatchedResource

/Context

*** META-INF/CONTEXT.XML
***

Context

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/
/Context



Here is the offending code:

   Context context = new InitialContext();
DataSource pds = null;
pds = (DataSource)context.lookup(jdbc/GFDataSource);
Connection conn = pds.getConnection();
context.close();


I have tried java:comp/env/jdbc/GFDataSource as well.  I am using
ojdbc14dms.jar and dms.jar.

J.  ERIC  HAMACHER
Software Application Developer

RE: Oracle connection pooling

2009-02-12 Thread Jorge Medina

Is your Oracle database port  and is the name of your SID SID?

We use Oracle jdbc driver with Oracle 10g. 
I set the attributes on the resource to:
   type=javax.sql.DataSource
   driverClassName=oracle.jdbc.OracleDriver
and no factory


-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com] 
Sent: Thursday, February 12, 2009 3:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this
Context at
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at
survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at
util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at
util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
8)

when I add:

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=GLP_S
password=gideupstg
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

to either server.xml (under Server), config/context.xml (under
Context), or in META-INF/context.xml.

Here's what these files look like when I place Resource in them:

** SERVER.XML
***

Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener
className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
/
  GlobalNamingResources
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
 
factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

  /GlobalNamingResources
  Service name=Catalina

Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /

Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host
/Engine
  /Service
/Server

*** CONFIG/CONTEXT.XML
***


Context
Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/
WatchedResourceWEB-INF/web.xml/WatchedResource

/Context

*** META-INF/CONTEXT.XML
***

Context

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/
/Context



Here is the offending code:

   Context context = new InitialContext();
DataSource pds = null;
pds = (DataSource)context.lookup(jdbc/GFDataSource);
Connection conn = pds.getConnection();
   

RE: Oracle connection pooling

2009-02-12 Thread Propes, Barry L
Mine differs slightly, though I see you're obviously on a diff. version of 
Tomcat than I am.

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);
// Look up our data source
DataSource ds = (DataSource)
  envCtx.lookup(jdbc/myoracle);
// Allocate and use a connection from the pool
Connection connection = ds.getConnection(); 

-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com] 
Sent: Thursday, February 12, 2009 2:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at 
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at 
util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:78)

when I add:

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=GLP_S
password=gideupstg
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

to either server.xml (under Server), config/context.xml (under Context), or 
in META-INF/context.xml.

Here's what these files look like when I place Resource in them:

** SERVER.XML 
***

Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /
  GlobalNamingResources
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

  /GlobalNamingResources
  Service name=Catalina

Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /

Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host
/Engine
  /Service
/Server

*** CONFIG/CONTEXT.XML ***


Context
Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/
WatchedResourceWEB-INF/web.xml/WatchedResource

/Context

*** META-INF/CONTEXT.XML ***

Context

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/
/Context



Here is the offending code:

   Context context = new InitialContext();
   

RE: Oracle connection pooling

2009-02-12 Thread Propes, Barry L
Yeah --  looked like an odd port to me, too -- I've only seen 1521, 1526 
and 1527 before.
I figured his SID was just a generic placeholder for his real SID. 

-Original Message-
From: Jorge Medina [mailto:jmed...@e-dialog.com] 
Sent: Thursday, February 12, 2009 4:12 PM
To: Tomcat Users List
Subject: RE: Oracle connection pooling


Is your Oracle database port  and is the name of your SID SID?

We use Oracle jdbc driver with Oracle 10g. 
I set the attributes on the resource to:
   type=javax.sql.DataSource
   driverClassName=oracle.jdbc.OracleDriver
and no factory


-Original Message-
From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
Sent: Thursday, February 12, 2009 3:52 PM
To: users@tomcat.apache.org
Subject: Oracle connection pooling

Hello:

I am in a bind.

I am getting:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at
survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at
util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at
util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
8)

when I add:

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=GLP_S
password=gideupstg
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

to either server.xml (under Server), config/context.xml (under Context), or 
in META-INF/context.xml.

Here's what these files look like when I place Resource in them:

** SERVER.XML
***

Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener
className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
/
  GlobalNamingResources
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
 
factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

  /GlobalNamingResources
  Service name=Catalina

Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /

Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host
/Engine
  /Service
/Server

*** CONFIG/CONTEXT.XML
***


Context
Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/
WatchedResourceWEB-INF/web.xml/WatchedResource

/Context

*** META-INF/CONTEXT.XML
***

Context

Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password

Re: Oracle connection pooling

2009-02-12 Thread Anurag Kapur
ds = (DataSource)context.lookup(java:/comp/env/jdbc/GFDataSource);

The above works fine for me as well.

But your original email mentions that you have tried it. That's weird!

Anyway, try the attributes Jorge mentioned. Your context.xml /server.xml
definitions look like a problem to me. The code snippet looks fine (assuming
you use java:/comp/env/jdbc/GFDataSource).

Coming back to your Resource definition,

type=oracle.jdbc.pool.OracleDataSource should not be used as it is
deprecated. type=javax.sql.DataSource should be used to enable DBCP.

Anurag
--
Anurag Kapur
Associate - Technology,
Sapient Corporation India
--


On Thu, Feb 12, 2009 at 10:26 PM, Propes, Barry L
barry.l.pro...@citi.comwrote:

 Yeah --  looked like an odd port to me, too -- I've only seen 1521,
 1526 and 1527 before.
 I figured his SID was just a generic placeholder for his real SID.

 -Original Message-
 From: Jorge Medina [mailto:jmed...@e-dialog.com]
 Sent: Thursday, February 12, 2009 4:12 PM
 To: Tomcat Users List
 Subject: RE: Oracle connection pooling


 Is your Oracle database port  and is the name of your SID SID?

 We use Oracle jdbc driver with Oracle 10g.
 I set the attributes on the resource to:
   type=javax.sql.DataSource
   driverClassName=oracle.jdbc.OracleDriver
 and no factory


 -Original Message-
 From: Hamacher, Eric [mailto:eric_hamac...@gallup.com]
 Sent: Thursday, February 12, 2009 3:52 PM
 To: users@tomcat.apache.org
 Subject: Oracle connection pooling

 Hello:

 I am in a bind.

 I am getting:

 javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
 at
 org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
 org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  at javax.naming.InitialContext.lookup(InitialContext.java:351)
  at
 survey.db.SurveyConnection.getConnection(SurveyConnection.java:66)
  at
 util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:137)
  at
 util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:7
 8)

 when I add:

 Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=GLP_S
password=gideupstg
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

 to either server.xml (under Server), config/context.xml (under
 Context), or in META-INF/context.xml.

 Here's what these files look like when I place Resource in them:

 ** SERVER.XML
 ***

 Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
 SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener
 className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener
 className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
 /
  GlobalNamingResources
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved

 factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /

 Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  connectionCachingEnabled=true
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@server::SID/

  /GlobalNamingResources
  Service name=Catalina

Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /

Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host
/Engine
  /Service
 /Server

 *** CONFIG/CONTEXT.XML
 ***


 Context
 Resource name=jdbc/GFDataSource auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory