Solved

jdbc connection to as400

Posted on 2011-03-04
5
846 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
Comment Utility
try

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

Assisted Solution

by:Kdo
Kdo earned 166 total points
Comment Utility
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
Comment Utility
Do I have to have a catalog node and database to run jdbc?
0
 

Author Comment

by:cw50
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now