aspose file tools*
The moose likes JDBC and the fly likes Where should IP address in Connection? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Where should IP address in Connection?" Watch "Where should IP address in Connection?" New topic
Author

Where should IP address in Connection?

Nitin Jawarkar
Ranch Hand

Joined: Dec 18, 2004
Posts: 79
Hello,
I have an JDBC code and i want to access my SQL server database using its IP address, is it possible? My code look loke this for connection.

con = DriverManager.getConnection("jdbc dbc:skypak;sa;doublebull");

Thanx


Cheers<br />Nitin
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
jdbc b2://192.168.1.1:5000/SAMPLE
this is for DB2 connection, but if you are using ODBC, I think you define IP address in ODBC data source.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Nitin Jawarkar
Ranch Hand

Joined: Dec 18, 2004
Posts: 79
hi,

Thanx for suggesion but can you tell me how to set IP address in ODBC means which tab in ODBC window for SQL server. But i think if we create system DSN only then we can specify IP address in JDBC code directly, i have seen like this code somewhere.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

The IP address is entered in the box where you provide the server name.

However, you should not use the JDBC-ODBC bridge for SQL server access. Use the SQL Server JDBC driver instead. JDBC-ODBC bridge is a kludge and isn't robust enough for production use, especially for multithreaded environments.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
wood burning stoves
 
subject: Where should IP address in Connection?