• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic