Solved

jdbc connection to as400

Posted on 2011-03-04
5
856 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:Kdo
Kdo 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
db2 != check 14 54
VPN 101 - how and which protocol? 9 111
IP address hacked PC? 18 121
filter big file based upon on multipe criteria 2 57
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…
Network ports are the threads that hold network communication together. They are an essential part of networking that can be easily ignore or misunderstood, my goals is to show those who don't have a strong network foundation how network ports opera…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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