using JDBC to DB2 on OS/390 , and JDBC Applet Server

using JDBC to DB2 on OS/390 , and JDBC Applet Server

Post by Ming Dat Tommy Ta » Thu, 13 Dec 2001 08:37:36



Hi.  We are using WebSphere Advanced Edition on Solaris8.  Our Java
applications run in this environment, WebSphere AE 3.5.5 / Solaris 8.
 Usually, we pull our data from Sybase via their JDBC driver, jConnect.
 I am now trying to figure out how to make a connection to our other
database, DB2, which runs on OS/390.

We are trying to solve this using IBM's JDBC Drivers.  My understanding
thus far is this:

* IBM has type 2 and type 3 drivers -- app driver, and net driver,
respectively.  
 - The app driver is typically select and used if WebSphere (or other
JDBC application) runs on the same local box as the database server
- The net driver is used of the WebSphere / JDBC application does not
reside on the same box as the DB2 application.

We are NOT looking to purchase a type 4 driver from a third-party vendor.

I've gotten some suggestions that the best way to make your JDBC
connection to DB2 6.1 on OS/390 (if your JDBC application is NOT on the
same box as OS/390), that "DB2 Connect" should be installed on the
Java/JDBC-enabled application.  This is an accpetable solution for us,
only that I haven't gotten it to work yet.  We are using JDBC 2.0
drivers from db2java.zip (after running usejdbc2.bat) from sqllib on my
windows machine.  I have gotten my Java application to successfully
connect and perform queries against DB2 running on Windows 2000, but not
on OS/390.

My question is this (the piece that I am missing) -- what is the link
between JDBC and DB2 Connect?  How do I get my Java application to talk
to DB2 Connect?  Do I somehow define my datasource in DB2 Connect.  If
so, how do I "register" it so that when do a lookup on the datasource,
it is able to find the definition created in DB2 Connect?  Under this
suggested setup, would I be using the net or app driver?

Also, on a separate but related note, I see two services on my Windows
2000 machine running DB2 6.1 -- "JDBC Applet Server" and "JDBC Applet
Server -- Control Center" .  They are listening on their default ports
6789, and 6790 respectively.  These services must have gotten installed
along with DB2 when I chose DB2 as my admin repository during my
WebSphere install.  Now, my question.  What exactly is this JDBC Applet
Server?  Is this on Windows only?  I've noticed that my Java code (using
JDBC) fails as soon as I turn off this server (it doesn't seem to matter
whether it's the net driver or app driver).  What does this JDBC
AppletServer play, and does it fit into any of this OS/390 I'm trying to
solve?

I've looked through a lot of documentation and links, other references,
both on the web and on IBM's site.  

Any help is greatly appreciated.

Thanks,
Tommy Tam

 
 
 

using JDBC to DB2 on OS/390 , and JDBC Applet Server

Post by ttjar » Thu, 13 Dec 2001 21:18:17


You have to use the DB2 Connect as a gateway to DB2 on OS/390. From JDBC you
will access the database the same way you access a local database. JDBC will
not see the difference between a local database and a mainframe database
accessed through DB2 Connect.

To create the DB2 connection, you can use the following DB2 commands:
CATALOG TCPIP NODE <nodename> REMOTE <ip-adr> SERVER <portnumber> OSTYPE MVS
CATALOG DCS DB <ssid> AS <ssid>
CATALOG DATABASE <ssid> AS <ssid> AT NODE <nodename> AUTHENTICATION DCS

You will have to ask your DB2 adminstrator to give you ip-adr, portnumber
and the DB2 ssid. You can choose what name you want for nodename - typically
the name of the mainframe.

You can then configure a DataSource object using <ssid> as database name.

You can also check the connection in DB2, by using
CONNECT TO <ssid> USER <userid> USING <password>
Then enter some SQL to query tables of whatever...

- jarl



Quote:

> Hi.  We are using WebSphere Advanced Edition on Solaris8.  Our Java
> applications run in this environment, WebSphere AE 3.5.5 / Solaris 8.
>  Usually, we pull our data from Sybase via their JDBC driver, jConnect.
>  I am now trying to figure out how to make a connection to our other
> database, DB2, which runs on OS/390.

....
> Thanks,
> Tommy Tam


 
 
 

1. using JDBC to DB2 on OS/390 , and JDBC Applet Server

Hi.  We are using WebSphere Advanced Edition on Solaris8.  Our Java
applications run in this environment, WebSphere AE 3.5.5 / Solaris 8.
 Usually, we pull our data from Sybase via their JDBC driver, jConnect.
 I am now trying to figure out how to make a connection to our other
database, DB2, which runs on OS/390.

We are trying to solve this using IBM's JDBC Drivers.  My understanding
thus far is this:

* IBM has type 2 and type 3 drivers -- app driver, and net driver,
respectively.  
 - The app driver is typically select and used if WebSphere (or other
JDBC application) runs on the same local box as the database server
- The net driver is used of the WebSphere / JDBC application does not
reside on the same box as the DB2 application.

We are NOT looking to purchase a type 4 driver from a third-party vendor.

I've gotten some suggestions that the best way to make your JDBC
connection to DB2 6.1 on OS/390 (if your JDBC application is NOT on the
same box as OS/390), that "DB2 Connect" should be installed on the
Java/JDBC-enabled application.  This is an accpetable solution for us,
only that I haven't gotten it to work yet.  We are using JDBC 2.0
drivers from db2java.zip (after running usejdbc2.bat) from sqllib on my
windows machine.  I have gotten my Java application to successfully
connect and perform queries against DB2 running on Windows 2000, but not
on OS/390.

My question is this (the piece that I am missing) -- what is the link
between JDBC and DB2 Connect?  How do I get my Java application to talk
to DB2 Connect?  Do I somehow define my datasource in DB2 Connect.  If
so, how do I "register" it so that when do a lookup on the datasource,
it is able to find the definition created in DB2 Connect?  Under this
suggested setup, would I be using the net or app driver?

Also, on a separate but related note, I see two services on my Windows
2000 machine running DB2 6.1 -- "JDBC Applet Server" and "JDBC Applet
Server -- Control Center" .  They are listening on their default ports
6789, and 6790 respectively.  These services must have gotten installed
along with DB2 when I chose DB2 as my admin repository during my
WebSphere install.  Now, my question.  What exactly is this JDBC Applet
Server?  Is this on Windows only?  I've noticed that my Java code (using
JDBC) fails as soon as I turn off this server (it doesn't seem to matter
whether it's the net driver or app driver).  What does this JDBC
AppletServer play, and does it fit into any of this OS/390 I'm trying to
solve?

I've looked through a lot of documentation and links, other references,
both on the web and on IBM's site.  

Any help is greatly appreciated.

Thanks,
Tommy Tam

2. Building the public domain version of Ingres on Solaris or DEC Unix

3. Newbie Question : JDBC remote connection to DB2 on OS/390

4. Transaction Processing in VB 4.0

5. JDBC, DB2 and os/390

6. Connecting to SQLServer from Apache website on Unix

7. jdbc connection to DB2 5.1.2 on os/390

8. How to connect with Micro Focus COBOL

9. JDBC connection to DB2 on OS/390 from Solaris

10. JDBC/SQLJ Driver for DB2 OS/390

11. how to insert/select from clob/blob column in db2 7.1/7.2 OS/390 in JDBC

12. DB2 on OS/390 and JDBC

13. os/390 db2 with jdbc?