aspose file tools*
The moose likes JDBC 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
Bookmark "What IP address do i use." Watch "What IP address do i use." New topic
Author

What IP address do i use.

ismail lunat
Greenhorn

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: 196.258.130.27 and local IP as 10.0.0.3
what Do i use for <Host> in the following code in java:

DriverManager.registerDriver(new
com.microsoft.jdbc.sqlserver.SQLServerDriver());
Connection connection = DriverManager.getConnection(
"jdbc:microsoft:sqlserver://<Host>:1433",<"UID>","<PWD>");

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

Joined: Jul 08, 2004
Posts: 531

you should use the remote computer IP address. 196.258.130.27
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: http://aspose.com/file-tools
 
subject: What IP address do i use.