Solved

jdbc connection to as400

Posted on 2011-03-04
5
862 Views
Last Modified: 2012-05-11
I am doing db2 everyplace  parallel migration.  It uses jdbc (I am new to how jdbc drivers work).
This is a clean database and I am migrating the information for one machine to another.  The xml script is adding the data.

I run the xml script with (jdbc:db2:my400)

results:  could not connect to source database jdbc:db2:my400.

How does jdbc know what ipaddress to go to?
0
Comment
Question by:cw50
  • 2
  • 2
5 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 334 total points
ID: 35039003
try

jdbc:db2://<HOST>:<PORT>/<DB>
0
 
LVL 45

Assisted Solution

by:Kent Olsen
Kent Olsen earned 166 total points
ID: 35039035
Hi cw50,

Several things have to work together for this type of connection to succeed.

The xml describes the connection as jdbc:db2:my400.  It's a jdbc connection to a db2 database named my400.

The DB2 server must have a database named my400 (probably the alias name), accept TCP/IP connections, and discovery must be turned on.  You can check discovery by entering:

  db2 get dbm cfg

at the command line.  The check for these three lines:

 TCP/IP Service name                          (SVCENAME) = db2c_DB2
 Discovery mode                               (DISCOVER) = SEARCH
 Discover server instance                (DISCOVER_INST) = ENABLE

Also do a:

  db2 list database directory.  my400 MUST be one of the listed databases.



Kent
0
 

Author Comment

by:cw50
ID: 35039108
Do I have to have a catalog node and database to run jdbc?
0
 

Author Comment

by:cw50
ID: 35039133
Does jdbc use dns?  If so can I put the ipaddress and my400 name in the host file?
0
 
LVL 37

Assisted Solution

by:momi_sabag
momi_sabag earned 334 total points
ID: 35041419
you don't have to catalog
you can connect by using a type 4 connection string
this way the universal driver will connect to a remote db2 without the need to catalog it
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Only Assign IP's to approved computers 8 58
Testing DSL speed/internal netwrk speed, etc. 3 102
As400 - Remote Journaling on system journal 8 19
Configure BGP 22 10
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question