• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC connection in different machine

 
imran quazi
Greenhorn
Posts: 18
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic