• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Where should IP address in Connection?

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic