• Post Reply Bookmark Topic Watch Topic
  • New Topic

Where should IP address in Connection?

 
Nitin Jawarkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nitin Jawarkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 18469
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
We noticed he had no friends. So we gave him this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!