File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes What IP address do i use. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "What IP address do i use." Watch "What IP address do i use." New topic

What IP address do i use.

ismail lunat

Joined: Mar 09, 2006
Posts: 1
I am trying to connect SQL Server 2000 from the local machine. It is behind a router. If The IP adress i get is: and local IP as
what Do i use for <Host> in the following code in java:

Connection connection = DriverManager.getConnection(

also am using Windows login settings to login to the DB, what do i use for UID and PWD.
Masoud Kalali
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

you should use the remote computer IP address.
sql server should be in mixed mode authentication ,, because from JDBC drivers
you can not authenticate with Windows . (when last i used it was impossible to authenticate with windows and we used a mixed mode authentication.)

Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
I agree. Here's the link:
subject: What IP address do i use.
It's not a secret anymore!