• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DB2: How to connect via IP - Address? - urgent

 
John Goodfield
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone!
I have a db2-connection using db2java.zip and
"DriverManager.getConnection("jdbc\:db2\:hostname :port/dbname", userID, userPW);"
Now everything works fine but for certain circumstances I want to get the connection via an ip-address. I have tried to replace the first 'getConnection' parameter with the ip address, but no success...
As I'm a newbie and this is urgent i hope you have some ideas how to get it done...
I appreciate any help!
Thanks!
John
[ February 26, 2002: Message edited by: John Goodfield ]
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
first to disble smilies just click on the bottom checkbox when posting a message.
the correct way to put the ip address is this (suppose u r using mysql as database).
jdbc:mysql://10.0.0.30:8080/mydatabase
or
jdbc:mysql://java.sun.com:80/mydatabase
the numbers specify the port for the server.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can go back in and edit your posts to get rid of the graemlins. At the bottom of the screen when you are posting a reply there is an option called "Disable smilies in this post". Check it to not see those annoying smilies in your post!
anyways, as per the question:
your IP Address can be used as your hostname in the connection string. I think you've tried this though? Anyways, that's the way it works for oracle
Jamie
 
John Goodfield
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
Sorry for the confusion and thanks for the quick help.
First of all: As you can see, I'm now able to edit my posts (and also to disable graemlins...) - yeah!
Second: I got the db-connection working with:
jdbc\:db2\:9.200.201.202\:1234/dbname
there was just a simple syntax-error and a hang-up of the database... so everything works fine now!
Thanks for your help!
John
[Aaargh! Forgot to disable smilies...]
[ February 26, 2002: Message edited by: John Goodfield ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic