jdbc connection to as400

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?
Who is Participating?
momi_sabagConnect With a Mentor Commented:

Kent OlsenConnect With a Mentor Data Warehouse Architect / DBACommented:
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.

cw50Author Commented:
Do I have to have a catalog node and database to run jdbc?
cw50Author Commented:
Does jdbc use dns?  If so can I put the ipaddress and my400 name in the host file?
momi_sabagConnect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.