By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,592 Members | 1,977 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,592 IT Pros & Developers. It's quick & easy.

client-server with db2

P: n/a
CT
Hi,

This might seem like a basic question but I have some doubts, please
humour me.

I have a client-server application using java where each client on
each machine needs to directly communicate directly with the database.
Do I need a separate db2 connect on each such machine.

Please advice.

confised.

CT.
Nov 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"CT" <co******@yahoo.com> wrote in message
news:f2**************************@posting.google.c om...
Hi,

This might seem like a basic question but I have some doubts, please
humour me.

I have a client-server application using java where each client on
each machine needs to directly communicate directly with the database.
Do I need a separate db2 connect on each such machine.

Please advice.

confised.

CT.


Please state operating system of DB2 Server, and Java clients.
Nov 12 '05 #2

P: n/a
CT wrote:
Hi,

This might seem like a basic question but I have some doubts, please
humour me.

I have a client-server application using java where each client on
each machine needs to directly communicate directly with the database.
Do I need a separate db2 connect on each such machine.


No. But that may be a reasonable option for some.

There are a number of possibilities, depending on platform and how
you've written your code.

1A. Type 2 JDBC driver, connecting to a host database, such as DB2 for
z/OS.

Here, you need DB2 Connect on each machine, or you need one DB2 Connect
Enterprise Edition (or variant such as DB2 Connect Unlimited Edition or
DB2 Connect Application Server Edition), and you need a client, such as
the DB2 Runtime Client on each client machine.

In the first case, each machine is configured such that the instance
can talk directly to the host server. In the second, each machine
talks to the gateway, and the gateway talks to the host server. Either
way, the JDBC application does not need to know any difference.

1B. Type 4 JDBC driver, connecting to host database.

Here you need DB2 Connect somewhere, and a license that says you can
copy the type 4 JDBC driver, and its license jar file, to each client
machine. You don't need the rest of DB2, although you'll need to
install it somewhere to get the right jar files. Be aware that this is
licensed code, so you'll need to pay IBM accordingly.

2A. Type 2 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you simply need the DB2 Client, such as DB2 Runtime Client, on
each machine. Configure the instance to talk to the server.

2B. Type 4 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you need the DB2 Client, such as DB2 Runtime Client, on a single
machine. Just copy the type 4 JDBC driver to each machine where your
Java app is deployed.
I hope that covers your situation and anyone who googles this response
;-)

Nov 12 '05 #3

P: n/a
CT
First wow!! Excellent reply. Thanks a lot.
CT wrote:
Hi,

This might seem like a basic question but I have some doubts, please
humour me.

I have a client-server application using java where each client on
each machine needs to directly communicate directly with the database.
Do I need a separate db2 connect on each such machine.
No. But that may be a reasonable option for some.

There are a number of possibilities, depending on platform and how
you've written your code.

1A. Type 2 JDBC driver, connecting to a host database, such as DB2 for
z/OS.

Here, you need DB2 Connect on each machine, or you need one DB2 Connect
Enterprise Edition (or variant such as DB2 Connect Unlimited Edition or
DB2 Connect Application Server Edition), and you need a client, such as
the DB2 Runtime Client on each client machine.

In the first case, each machine is configured such that the instance
can talk directly to the host server. In the second, each machine
talks to the gateway, and the gateway talks to the host server. Either
way, the JDBC application does not need to know any difference.

1B. Type 4 JDBC driver, connecting to host database.

Here you need DB2 Connect somewhere, and a license that says you can
copy the type 4 JDBC driver, and its license jar file, to each client
machine. You don't need the rest of DB2, although you'll need to
install it somewhere to get the right jar files. Be aware that this is
licensed code, so you'll need to pay IBM accordingly.


I have to connect to DB2 on z/os v 7.1 through various clients such as
winx or linux or unix. So far I have been able to install db2 connect
on each of these machines and connect to db2 using jdbc type 2 driver.
But until now I did not know that there existed a type 4 driver for
db2 on the host. Where can I get my hands on that and is type4 better
than type2 interms of performance and ease of deployment (I could just
copy the db2java.zip or variant and the licence.jar with my
distribution) Licensing is fine, we are db2 shop. But more important,
are there articles or info about type4 drivers to connect to db2 on
the host?
2A. Type 2 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you simply need the DB2 Client, such as DB2 Runtime Client, on
each machine. Configure the instance to talk to the server.

2B. Type 4 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you need the DB2 Client, such as DB2 Runtime Client, on a single
machine. Just copy the type 4 JDBC driver to each machine where your
Java app is deployed.

Again on a test platform, I am using db2 v8 on winx machine and using
db2connect to connect to this machine using jdbc type2. How can I
connect to db2 using type4. Again in your opinion (you do seem to know
your stuff), what is better, type2 or type4, for me at least, more
important is performance under heavvvy load and next is ease of
deployment on individual machines. My target program will be installed
on over 200 machines at a time, so deployment is important, since all
I am thinking about right now is webstart.


I hope that covers your situation and anyone who googles this response
;-)


It does and thanks again. I hope ppl google this. Hope to hear from
you and others on my further questions.

CT.
Nov 12 '05 #4

P: n/a
sea
question -- do I need db2 connect in addition to runtime client on
each client machine inorder for .app or .net to work?
om*****@yahoo.com (CT) wrote in message news:<f2**************************@posting.google. com>...
First wow!! Excellent reply. Thanks a lot.
CT wrote:
Hi,

This might seem like a basic question but I have some doubts, please
humour me.

I have a client-server application using java where each client on
each machine needs to directly communicate directly with the database.
Do I need a separate db2 connect on each such machine.


No. But that may be a reasonable option for some.

There are a number of possibilities, depending on platform and how
you've written your code.

1A. Type 2 JDBC driver, connecting to a host database, such as DB2 for
z/OS.

Here, you need DB2 Connect on each machine, or you need one DB2 Connect
Enterprise Edition (or variant such as DB2 Connect Unlimited Edition or
DB2 Connect Application Server Edition), and you need a client, such as
the DB2 Runtime Client on each client machine.

In the first case, each machine is configured such that the instance
can talk directly to the host server. In the second, each machine
talks to the gateway, and the gateway talks to the host server. Either
way, the JDBC application does not need to know any difference.

1B. Type 4 JDBC driver, connecting to host database.

Here you need DB2 Connect somewhere, and a license that says you can
copy the type 4 JDBC driver, and its license jar file, to each client
machine. You don't need the rest of DB2, although you'll need to
install it somewhere to get the right jar files. Be aware that this is
licensed code, so you'll need to pay IBM accordingly.


I have to connect to DB2 on z/os v 7.1 through various clients such as
winx or linux or unix. So far I have been able to install db2 connect
on each of these machines and connect to db2 using jdbc type 2 driver.
But until now I did not know that there existed a type 4 driver for
db2 on the host. Where can I get my hands on that and is type4 better
than type2 interms of performance and ease of deployment (I could just
copy the db2java.zip or variant and the licence.jar with my
distribution) Licensing is fine, we are db2 shop. But more important,
are there articles or info about type4 drivers to connect to db2 on
the host?
2A. Type 2 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you simply need the DB2 Client, such as DB2 Runtime Client, on
each machine. Configure the instance to talk to the server.

2B. Type 4 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you need the DB2 Client, such as DB2 Runtime Client, on a single
machine. Just copy the type 4 JDBC driver to each machine where your
Java app is deployed.


Again on a test platform, I am using db2 v8 on winx machine and using
db2connect to connect to this machine using jdbc type2. How can I
connect to db2 using type4. Again in your opinion (you do seem to know
your stuff), what is better, type2 or type4, for me at least, more
important is performance under heavvvy load and next is ease of
deployment on individual machines. My target program will be installed
on over 200 machines at a time, so deployment is important, since all
I am thinking about right now is webstart.


I hope that covers your situation and anyone who googles this response
;-)


It does and thanks again. I hope ppl google this. Hope to hear from
you and others on my further questions.

CT.

Nov 12 '05 #5

P: n/a
CT wrote:
First wow!! Excellent reply. Thanks a lot.
CT wrote:
> Hi,
>
> This might seem like a basic question but I have some doubts, please
> humour me.
>
> I have a client-server application using java where each client on
> each machine needs to directly communicate directly with the database.
> Do I need a separate db2 connect on each such machine.
No. But that may be a reasonable option for some.

There are a number of possibilities, depending on platform and how
you've written your code.

1A. Type 2 JDBC driver, connecting to a host database, such as DB2 for
z/OS.

Here, you need DB2 Connect on each machine, or you need one DB2 Connect
Enterprise Edition (or variant such as DB2 Connect Unlimited Edition or
DB2 Connect Application Server Edition), and you need a client, such as
the DB2 Runtime Client on each client machine.

In the first case, each machine is configured such that the instance
can talk directly to the host server. In the second, each machine
talks to the gateway, and the gateway talks to the host server. Either
way, the JDBC application does not need to know any difference.

1B. Type 4 JDBC driver, connecting to host database.

Here you need DB2 Connect somewhere, and a license that says you can
copy the type 4 JDBC driver, and its license jar file, to each client
machine. You don't need the rest of DB2, although you'll need to
install it somewhere to get the right jar files. Be aware that this is
licensed code, so you'll need to pay IBM accordingly.


I have to connect to DB2 on z/os v 7.1 through various clients such as
winx or linux or unix. So far I have been able to install db2 connect

^
Too many x's. ;-)
on each of these machines and connect to db2 using jdbc type 2 driver.
But until now I did not know that there existed a type 4 driver for
db2 on the host. Where can I get my hands on that and is type4 better
than type2 interms of performance and ease of deployment (I could just
copy the db2java.zip or variant and the licence.jar with my
distribution) Licensing is fine, we are db2 shop. But more important,
are there articles or info about type4 drivers to connect to db2 on
the host?
I know the type 4 driver is available in DB2 for LUW v8. I'm not sure
if it's in DB2 v7 or earlier. Please also note that pretty much
everything I refer to, unless I explicitly say "host" or "z/OS" is
referring to DB2 on Linux, Unix, or Windows since that is where pretty
much all my knowledge is.

As for using the type 4 driver, you may want to check out the v8.1
documentation - it should be documented there.

As for performance and ease of deployment - to be honest, I don't know.
I don't write Java. ;-) On one hand, it's easier to deploy in that
you don't need the whole DB2 client installed. On the other hand,
applying fixpaks is painful in that you may have a harder time tracking
what fixpak level a hand-copied db2jcc.zip file is at. Because you
copied it, and not the installer, the installer can't keep track of it
for you. Performance? I really, really don't know.

Oh - and the type 4 driver's connect string is radically different (or
as radical as it gets given the format JDBC imposes on it). You need
to know the server's hostname and port number. With type 2, that
information is in the instance configuration when you catalog the host
and database. Thus, with type 2, you can easily run your application
against a test server or swap back to the production server simply by
switching instances, or uncatalog/recatalog. With type 4, you point
directly at the server - which means that you need to have a dynamic
connect string, perhaps one that reads from a configuration file of its
own. Then you can swap your config file from test.config to
production.config and back as you need.
2A. Type 2 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you simply need the DB2 Client, such as DB2 Runtime Client, on
each machine. Configure the instance to talk to the server.

2B. Type 4 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you need the DB2 Client, such as DB2 Runtime Client, on a single
machine. Just copy the type 4 JDBC driver to each machine where your
Java app is deployed.


Again on a test platform, I am using db2 v8 on winx machine and using
db2connect to connect to this machine using jdbc type2. How can I
connect to db2 using type4. Again in your opinion (you do seem to know


It's a different JDBC connect string.
your stuff), what is better, type2 or type4, for me at least, more
As I said above, I don't use Java. I'm a perl (ab)user myself. But
I've seen enough written here and elsewhere to piece it together with
what I do know.
important is performance under heavvvy load and next is ease of
deployment on individual machines. My target program will be installed
on over 200 machines at a time, so deployment is important, since all
I am thinking about right now is webstart.


From what I've read, both type 2 and type 4 have their benefits. But I
don't remember what they are ;-) Hopefully someone else will reply who
is more familiar with different type drivers for JDBC.
I hope that covers your situation and anyone who googles this response
;-)


It does and thanks again. I hope ppl google this. Hope to hear from
you and others on my further questions.

Nov 12 '05 #6

P: n/a
sea wrote:
question -- do I need db2 connect in addition to runtime client on
each client machine inorder for .app or .net to work?


The only reason you need DB2 Connect is to connect to a host database,
such as DB2 for z/OS.

DB2 Connect also embeds all the functionality of the DB2 clients, thus
you never need to install both.

Hope that helps.
Nov 12 '05 #7

P: n/a
Yes, you need DB2 Connect.

sea wrote:
question -- do I need db2 connect in addition to runtime client on
each client machine inorder for .app or .net to work?
om*****@yahoo.com (CT) wrote in message news:<f2**************************@posting.google. com>...
First wow!! Excellent reply. Thanks a lot.

CT wrote:
Hi,

This might seem like a basic question but I have some doubts, please
humour me.

I have a client-server application using java where each client on
each machine needs to directly communicate directly with the database.
Do I need a separate db2 connect on each such machine.

No. But that may be a reasonable option for some.

There are a number of possibilities, depending on platform and how
you've written your code.

1A. Type 2 JDBC driver, connecting to a host database, such as DB2 for
z/OS.

Here, you need DB2 Connect on each machine, or you need one DB2 Connect
Enterprise Edition (or variant such as DB2 Connect Unlimited Edition or
DB2 Connect Application Server Edition), and you need a client, such as
the DB2 Runtime Client on each client machine.

In the first case, each machine is configured such that the instance
can talk directly to the host server. In the second, each machine
talks to the gateway, and the gateway talks to the host server. Either
way, the JDBC application does not need to know any difference.

1B. Type 4 JDBC driver, connecting to host database.

Here you need DB2 Connect somewhere, and a license that says you can
copy the type 4 JDBC driver, and its license jar file, to each client
machine. You don't need the rest of DB2, although you'll need to
install it somewhere to get the right jar files. Be aware that this is
licensed code, so you'll need to pay IBM accordingly.


I have to connect to DB2 on z/os v 7.1 through various clients such as
winx or linux or unix. So far I have been able to install db2 connect
on each of these machines and connect to db2 using jdbc type 2 driver.
But until now I did not know that there existed a type 4 driver for
db2 on the host. Where can I get my hands on that and is type4 better
than type2 interms of performance and ease of deployment (I could just
copy the db2java.zip or variant and the licence.jar with my
distribution) Licensing is fine, we are db2 shop. But more important,
are there articles or info about type4 drivers to connect to db2 on
the host?

2A. Type 2 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you simply need the DB2 Client, such as DB2 Runtime Client, on
each machine. Configure the instance to talk to the server.

2B. Type 4 JDBC driver, connecting to a Linux, Windows, or Unix
database.

Here you need the DB2 Client, such as DB2 Runtime Client, on a single
machine. Just copy the type 4 JDBC driver to each machine where your
Java app is deployed.


Again on a test platform, I am using db2 v8 on winx machine and using
db2connect to connect to this machine using jdbc type2. How can I
connect to db2 using type4. Again in your opinion (you do seem to know
your stuff), what is better, type2 or type4, for me at least, more
important is performance under heavvvy load and next is ease of
deployment on individual machines. My target program will be installed
on over 200 machines at a time, so deployment is important, since all
I am thinking about right now is webstart.
I hope that covers your situation and anyone who googles this response
;-)


It does and thanks again. I hope ppl google this. Hope to hear from
you and others on my further questions.

CT.


Nov 12 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.