Hi,
> Thrid: Add extra information in your web.xml file like the following: 
> <resource-ref> 
>      <description>Oracle Datasource example</description> 
>      <res-ref-name>jdbc/db2universal</res-ref-name> 
>      <res-type>javax.sql.DataSource</res-type> 
>      <res-auth>Container</res-auth> 
>    </resource-ref> 


Do we have to add this since I am defining the resource as global?

Secondly I am getting the datasource reference from jndi but it seems to
loose it's parameters,


OUTPUT :

PRinting out entries in java:comp/env
Entry :jdbc: org.apache.naming.NamingContext
PRinting out entries in java:comp/env/jdbc
Entry :db2universal: org.apache.naming.ResourceLinkRef
It is not null
********************************
connPoolDataSource.getServerName() :null
 Port:446
 DB Name:null
Driver type :2
Timeout :0
User :null

Is there any way to print out the parameters that are passed along with the
Resource?
Or am I doing something fundamentally wrong?



Mohammed Zabin wrote:
> 
> I didn't work on DB2 before, but i have configured Oracle and MySql
> database in the same way.
> 
> First, you have to get the ideal connector for DB2, jar file, and
> place it inside CATALINA_HOME/lib, or JAVA_HOME/lib/ext.
> 
> Second, Define your resource name, you already did.
> 
> Thrid: Add extra information in your web.xml file like the following:
> <resource-ref>
>       <description>Oracle Datasource example</description>
>       <res-ref-name>jdbc/db2universal</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>     </resource-ref>
> 
> After that, you have to connect your Resource name to the your server.
> In context.xml add the following line of code:
> 
> <ResourceLink global="jdbc/db2universal" name="jdbc/db2universal"
> type="javax.sql.DataSource"/>
> 
> One last thing, please note that you have to change the previous
> parameters according to your database. Hope that will help
> On 7/27/07, dileep_sivaraman <[EMAIL PROTECTED]> wrote:
>>
>> Hi ,
>>
>> I am trying to register a com.ibm.db2.jcc.DB2ConnectionPoolDataSource
>> datasource in tomcat 5.5.4.
>>
>> I am not getting any exception's while doing a context lookup and gives
>> me
>> the datasource.
>> However the paramaeter's that are set with that Resource are always null.
>>
>> Server.xml
>> <GlobalNamingResources>
>> <Resource name="jdbc/db2universal"
>> type="com.ibm.db2.jcc.DB2ConnectionPoolDataSource"
>> factory="com.ibm.db2.jcc.DB2DataSourceFactory"
>> serverName="PROD9S03.bankofamerica.com" username="abc" password="abc"/>
>>
>> </GlobalNamingResources>
>>
>> In my code  I get the datasource as :
>>
>> connPoolDataSource=(DB2ConnectionPoolDataSource)
>> envContext.lookup("jdbc/db2universal");
>>
>> However when I print out the serverName parameter that has been set in
>> the
>> resource it prints null.
>>
>> System.out.println("connPoolDataSource.getServerName()
>> :"+connPoolDataSource.getServerName());
>>
>> OUTPUT:
>>
>> connPoolDataSource.getServerName() :null
>>
>>
>> Can somebody tell me what I  am doing wrong?
>> --
>> View this message in context:
>> http://www.nabble.com/registering-a-DB2ConnectionPoolDataSource-in-tomcat--5.5-tf4155802.html#a11823991
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/registering-a-DB2ConnectionPoolDataSource-in-tomcat--5.5-tf4155802.html#a11824613
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to