You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Fran Varin <FV...@AMICA.com> on 2006/03/31 16:07:03 UTC

Configuring DB2 CLI "legacy" driver with Geronimo

The examples that I have found (and implemented) refer to configuring the DB2
Universal Driver with Geronimo. Up until this point we have used the legacy
driver as opposed to the Unerval Driver. Does anyone have any information on
how to configure the legacy driver with Geronimo?
--
View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3689906
Sent from the Apache Geronimo - Users forum at Nabble.com.


Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Fran Varin <FV...@AMICA.com>.
OK, let me give this a shot. According to this IBM article( 
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0512kokkat/  
), IBM referes to a "legacy" driver, it is this driver that we currently use
with our WSAD/WAS implementation. We're attempting to convert over to an
Eclipse environment using Geronimo for development purposes. So, we are
trying to configure a DB2 datasource that we have used in the previous
environment. Up until this point we have utilized the "Legacy" driver both
in code and from a server configuration point of view. All of the turotials
that I have found and inforamtion obtained from this board have discussed
configuring what IBM refers to as the "universal driver". The Legacy driver
requires DLLs to be installed on the machine...and they are since all of
this works with the WSAD environment. What I am left with is how to
configure the datasource descriptor to use the "legacy" driver and what to
copy where within Geronimo. The "Universal driver" install calls for moving
a couple of jar files to the Geronimo/repository/db2/jars directory and
renaming them. However, the "legacy" driver is housed in a .zip file and not
a .jar. Puzzling, but somehow all of this works in WAS and other application
servers I would presume since DB2 works with all of them. 

Any Ideas?
--
View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3690998
Sent from the Apache Geronimo - Users forum at Nabble.com.


Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Hernan Cunico <hc...@gmail.com>.
Hi Fran,
What version of DB2 are you using? The one I tested is "DB2 v8.1.8.806", "special_13153", 
"WR21348_13153" and FixPak "8"; namely DB2 v8.2

This version of DB2 has the db2jcc_license_*.jar files already included in the <SQLLIB_home>/java 
directory

<DIR>          images
<DIR>          jdk
      2,212,507 Common.jar
        237,008 db2fs.jar
      1,232,808 db2java.zip
      1,080,551 db2jcc.jar
         23,709 db2jcc_javax.jar
          2,063 db2jcc_license_cisuz.jar
          1,013 db2jcc_license_cu.jar
        118,928 db2policy.jar
        162,159 db2qgjava.jar
      1,513,404 sqlj.zip

Yup, maybe your local rep may give you a better answer.

As for the documentation, whatever is more convenient for you will work for us; although it would be 
great if you can put it together :)

You could even send me the doc (any format) and I'll put it in confluence for you so you don't have 
to deal with that part.

Let me know what works best for you.

Cheers!
Hernan

Fran Varin wrote:
> Hernan, thank you so much for your helpfullness. It appears to me that we
> should target a migration to the Universal Driver. 
> 
> Regarding the couple of question you asked in your response...it is my
> understanding that our current license agreement with IBM should allow us to
> connect to any DB2 resource we have throughout the enterprise. The puzzling
> part is that the client install portion of DB2 did not contain the cisuz
> license jar. Our DBAs are puzzled over this since all we should need to do
> is connect to the DB2 connect server. That server in turn manages the
> connection to the actual DB2 resource. In order to get Geronimo functioning,
> I found the cisuz license jar inside WSAD. That makes this even more
> curious. I think our next step on this point is to take this up with our
> local IBM rep. for clarification. 
> 
> Please let me know how you would like to proceed, 
> Fran 
> 
> Regarding our documentation...I would be glad to supply a copy of what we
> did to get this working. Please let me know what the best way would be to
> get you the information. Secondly, I don't think it was necessarily a case
> of missing/wrong steps. In our case it seemed that we could not seem to find
> the information specific to DB2 in a single place. I think the information
> is available, perhaps it is not readily available. Also, I would offer that
> some of our confusion on the matter may be due to us being "green" when it
> comes to Geronimo. Perhaps the information we send along could be put to use
> for those who would be in a similar situation as us. There are a couple of
> tutorials but, none seemed to be comprehensive. Perhaps I could spend the
> time to write one based on our experience with our implementation. If you
> feel that would be useful to others, I certainly would not mind spending the
> time doing so. 
> --
> View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3748254
> Sent from the Apache Geronimo - Users forum at Nabble.com.
> 
> 

Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Fran Varin <FV...@AMICA.com>.
Hernan, thank you so much for your helpfullness. It appears to me that we
should target a migration to the Universal Driver. 

Regarding the couple of question you asked in your response...it is my
understanding that our current license agreement with IBM should allow us to
connect to any DB2 resource we have throughout the enterprise. The puzzling
part is that the client install portion of DB2 did not contain the cisuz
license jar. Our DBAs are puzzled over this since all we should need to do
is connect to the DB2 connect server. That server in turn manages the
connection to the actual DB2 resource. In order to get Geronimo functioning,
I found the cisuz license jar inside WSAD. That makes this even more
curious. I think our next step on this point is to take this up with our
local IBM rep. for clarification. 

Please let me know how you would like to proceed, 
Fran 

Regarding our documentation...I would be glad to supply a copy of what we
did to get this working. Please let me know what the best way would be to
get you the information. Secondly, I don't think it was necessarily a case
of missing/wrong steps. In our case it seemed that we could not seem to find
the information specific to DB2 in a single place. I think the information
is available, perhaps it is not readily available. Also, I would offer that
some of our confusion on the matter may be due to us being "green" when it
comes to Geronimo. Perhaps the information we send along could be put to use
for those who would be in a similar situation as us. There are a couple of
tutorials but, none seemed to be comprehensive. Perhaps I could spend the
time to write one based on our experience with our implementation. If you
feel that would be useful to others, I certainly would not mind spending the
time doing so. 
--
View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3748254
Sent from the Apache Geronimo - Users forum at Nabble.com.


Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Hernan Cunico <hc...@gmail.com>.
Hi Fran,
see my comments inline

Cheers!
Hernan

Fran Varin wrote:
> Hi Hernan, thanks for your reply. We have the "legacy" driver working at this
> point. Part of our dilemma is that we have an existing applicaiton that has
> used that approach for several years. We're using WSAD and attempting to
> migrate to Eclipse/Geronimo as a development platform. So, our issue seems
> to really be centered around our lack of understanding of this new
> environment.

Keep in mind that DB2 has been fully integrated with WAS for a long time now. In fact, isn't WAS 
already providing a DB2 dev license?

> 
> Many of the configurations we typically perform in WSAD are handled through
> a series of panels and there is seldom a need for us to manipulate the
> resulting xml file directly. So, this is part of the learning curve for us. 
> 
> We have documented the steps we took to get the driver configured and
> running. If you feel this would be beneficial to others I would be glad to
> supply it to you.

This will certainly be beneficial for others in the same situation. I will compare the steps and 
update the existing documentation. Other than the obvious Legacy vs. Universal driver, did you find 
other missing/wrong steps?

> 
> One point that is a puzzling for us is understanding exactly what is needed
> for license jars. We have not had to use the cisuz jar in the past. So, we
> are trying to sort that out at the present time. 
> 
> We're also trying to sort out how the Universal driver vs. the legacy driver
> plays with the DB2 connect server. Our DBAs have some reservation over using

This article may help you identify some of the differences
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0506fechner/

> the type 4 driver because of the potential lack of control over what
> application/developer could connect to which database (read test vs.
> production). Under our current configuration using the Type 2 driver we must
> connect to the DB2 Connect server. It is our assumption that by using the
> type 4 driver that restriction would be removed.

Similar restrictions can be implemented when using the Universal JDBC driver.

> 
> So, to sum it up, we have it working currently but, there is still much that
> we need to understand. Further research is definately warranted on our part
> it seems. 
> --
> View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3746929
> Sent from the Apache Geronimo - Users forum at Nabble.com.
> 
> 

Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Fran Varin <FV...@AMICA.com>.
Hi Hernan, thanks for your reply. We have the "legacy" driver working at this
point. Part of our dilemma is that we have an existing applicaiton that has
used that approach for several years. We're using WSAD and attempting to
migrate to Eclipse/Geronimo as a development platform. So, our issue seems
to really be centered around our lack of understanding of this new
environment. 

Many of the configurations we typically perform in WSAD are handled through
a series of panels and there is seldom a need for us to manipulate the
resulting xml file directly. So, this is part of the learning curve for us. 

We have documented the steps we took to get the driver configured and
running. If you feel this would be beneficial to others I would be glad to
supply it to you. 

One point that is a puzzling for us is understanding exactly what is needed
for license jars. We have not had to use the cisuz jar in the past. So, we
are trying to sort that out at the present time. 

We're also trying to sort out how the Universal driver vs. the legacy driver
plays with the DB2 connect server. Our DBAs have some reservation over using
the type 4 driver because of the potential lack of control over what
application/developer could connect to which database (read test vs.
production). Under our current configuration using the Type 2 driver we must
connect to the DB2 Connect server. It is our assumption that by using the
type 4 driver that restriction would be removed. 

So, to sum it up, we have it working currently but, there is still much that
we need to understand. Further research is definately warranted on our part
it seems. 
--
View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3746929
Sent from the Apache Geronimo - Users forum at Nabble.com.


Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Hernan Cunico <hc...@gmail.com>.
Hi Fran,
I was going to suggest you to try the same COM.ibm.db2.jndi.DB2InitialContextFactory , although I 
have not tested it myself yet.

Have you seen the DB2 InfoCenter, this may give you some additional guidance.

http://publib.boulder.ibm.com/infocenter/db2v7luw/index.jsp?topic=/com.ibm.db2v7.doc/db2a0/db2a0159.htm

HTH

Cheers!
Hernan

Fran Varin wrote:
> I realized that I left off some crucial thinking in my last note. I should
> have added should the WebSphere jndi context factory be replaced with: 
> 
> com.ibm.db2.jndi.db2initialcontextfactory
> 
> 
> 
> --
> View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3694966
> Sent from the Apache Geronimo - Users forum at Nabble.com.
> 
> 

Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Fran Varin <FV...@AMICA.com>.
I realized that I left off some crucial thinking in my last note. I should
have added should the WebSphere jndi context factory be replaced with: 

com.ibm.db2.jndi.db2initialcontextfactory



--
View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3694966
Sent from the Apache Geronimo - Users forum at Nabble.com.


Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Fran Varin <FV...@AMICA.com>.
Hernan, thanks for the input, you have been very helpful. We are at the point
where the datasource loads successfully into Geronimo. The issue we are
faced with is that we specify the name of a JNDI context to derive the
initial context factory. In WebSphere it is the fully qualified name of a
specific class named "com.ibm.websphere.naming.WsnInitialContextFactory ".
Clearly, this is a WAS class that is part of WebSphere. This leaves me in
still another quandry...what is the equivalent in Geronimo? Where might I
find that information?
--
View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3694891
Sent from the Apache Geronimo - Users forum at Nabble.com.


Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Hernan Cunico <hc...@gmail.com>.
For the deployment follow the same steps as for the Universal driver. Instead of db2jcc.jar use 
db2java.zip and rename it to db2java-8.1.8.jar, you will still need to add the license drivers.

The plan below is the one I just used to deploy the pool on my machine, note the first dependency is 
pointing to the legacy driver and the JDBC driver class is COM.ibm.db2.jdbc.app.DB2Driver

When I copied the drivers to the Geronimo repo I created a com.ibm.db2 directory instead of just 
plain db2, this should be reflected in the <uri> for the dependencies.

I have not tested it against a mainframe. As Matt mentioned, your runtime environment should be set 
to find the specific libraries for the destination OS. I think you should have this already set as 
you mentioned you used to use the legacy driver so far.

<?xml version="1.0" encoding="UTF-8"?>
<connector configId="user/database-pool-DB2_Test/1/car"
	xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0">
   <dependency>
     <uri>com.ibm.db2/db2java/8.1.8/jar</uri>
   </dependency>
   <dependency>
     <uri>com.ibm.db2/db2jcc_license_cu/8.1.8/jar</uri>
   </dependency>
   <dependency>
     <uri>com.ibm.db2/db2jcc_license_cisuz/8.1.8/jar</uri>
   </dependency>
   <resourceadapter>
     <outbound-resourceadapter>
       <connection-definition>
         <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
         <connectiondefinition-instance>
           <name>DB2_Test</name>
           <config-property-setting name="Password">db2admin</config-property-setting>
           <config-property-setting name="CommitBeforeAutocommit">false</config-property-setting>
           <config-property-setting 
name="Driver">COM.ibm.db2.jdbc.app.DB2Driver</config-property-setting>
           <config-property-setting 
name="ExceptionSorterClass">org.tranql.connector.AllExceptionsAreFatalSorter</config-property-setting>
           <config-property-setting name="UserName">db2admin</config-property-setting>
           <config-property-setting 
name="ConnectionURL">jdbc:db2://localhost:50000/SAMPLE</config-property-setting>
           <connectionmanager>
             <local-transaction/>
             <single-pool>
               <match-one/>
             </single-pool>
             </connectionmanager>
         </connectiondefinition-instance>
       </connection-definition>
     </outbound-resourceadapter>
   </resourceadapter>
</connector>

HTH

Cheers!
Hernan

Matt Hogstrom wrote:
> By legacy driver you mean the Type 2 driver?
> 
> I haven't tried it but I would expect that there are at least two 
> changes that need to be made.  First, you'll need to ensure that your 
> runtime environment is setup to find the dlls or so's depending on the 
> target OS.  The second is when deploying the driver you'll need to 
> specify that the DriverType is 2 and not 4.
> 
> Can you provide some additional detail on how your setting this up ?
> 
> Fran Varin wrote:
> 
>> The examples that I have found (and implemented) refer to configuring 
>> the DB2
>> Universal Driver with Geronimo. Up until this point we have used the 
>> legacy
>> driver as opposed to the Unerval Driver. Does anyone have any 
>> information on
>> how to configure the legacy driver with Geronimo?
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3689906 
>>
>> Sent from the Apache Geronimo - Users forum at Nabble.com.
>>
>>
>>
>>
> 

Re: Configuring DB2 CLI "legacy" driver with Geronimo

Posted by Matt Hogstrom <ma...@hogstrom.org>.
By legacy driver you mean the Type 2 driver?

I haven't tried it but I would expect that there are at least two changes that 
need to be made.  First, you'll need to ensure that your runtime environment is 
setup to find the dlls or so's depending on the target OS.  The second is when 
deploying the driver you'll need to specify that the DriverType is 2 and not 4.

Can you provide some additional detail on how your setting this up ?

Fran Varin wrote:
> The examples that I have found (and implemented) refer to configuring the DB2
> Universal Driver with Geronimo. Up until this point we have used the legacy
> driver as opposed to the Unerval Driver. Does anyone have any information on
> how to configure the legacy driver with Geronimo?
> --
> View this message in context: http://www.nabble.com/Configuring-DB2-CLI-%22legacy%22-driver-with-Geronimo-t1374822.html#a3689906
> Sent from the Apache Geronimo - Users forum at Nabble.com.
> 
> 
> 
>