This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC connection in different machine

 
imran quazi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I'm trying to connect with oracle installed in different machine. I've oracle client installed in my machine. So i'm writing like this:


abcd is the dns name.
My question is what i've to pass as parameter in the getConnection() method if the other machine has ip: 10.124.12.148 and port:8081.?
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have Oracle as the database, you should be using Oracle's type-4 driver instead of the ODBC bridge driver which is inherently limited.

http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
Download the driver for your version from the link above.

Here's a tutorial on using JDBC with Oracle:
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-jdbc.html
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by imran quazi:
what i've to pass as parameter in the getConnection() method if the other machine has ip: 10.124.12.148 and port:8081.?


your first place would be Java Doc to find your answer regarding signature of getConnection() method.

JavaDoc DriverManager
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic