• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JDBC and Oracle Host

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..
I try to connect jdbc to oracle 8 but it gives me error on hostname.
can any one tell me how should i get hostname for oralce.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Where is Oracle located (e.g. IP-adr)?
What is the URL to Oracle (e.g. 'jdbc:oracle:thin:@<HOST>:<PORT>:<SID>')?
/Rene
[ June 13, 2002: Message edited by: Rene Larsen ]
 
Sanjay Jadhav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi..
I write prg which just connect to oracle,where as you said (('jdbc racle:thin:@<HOST>:<PORT>:<SID> ) i have port and sid found but not host is this mean oracle server name or path were i installed oracle.
clarify the same.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Did you install oracle the same PC as you are trying to connect from - if yes then HOST = '127.0.0.1' or 'localhost' - if no then the host is the IP-adr or PC name where you have installed oracle.
/Rene
 
Sanjay Jadhav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi.
I tried your solution but it raised the SQLException saying Connection refused : connect.
I need the host parameter for oracle which i used.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Try to change: 'jdbc:oracle:thin:@....'
To: 'jdbc:oracle:oci8:@....'
Oracle 8 (ver. 8.0.x) can not use the thin driver - it is java - but oci8 is a native driver. But Oracle 8i (ver. 8.1.x) can use them both.
/Rene
[ June 22, 2002: Message edited by: Rene Larsen ]
[ June 22, 2002: Message edited by: Rene Larsen ]
 
Sanjay Jadhav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..
My code..

but give an exception in main unsatisfiedlinkerror: make_c_state
i don't understand it. The probs only with host port and sid or correct.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
What is the version of your oracle?
If it is a 8.0.x and up, then you can not use the 'oci7' driver.
You always have to provide HOST (127.0.0.1) PORT and SID.
/Rene
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Try read this post: http://p2p.wrox.com/archive/java_databases/2001-02/11.asp
/Rene
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Mark
sorry it just struck me as funny that each and every post in this thread started with Hi.
 
Sanjay Jadhav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
As I got that Oracle8 client is not properly installed, so i removed that one and installed Oracle8i.
Give me the exact systext or small prg to evalute the jdbc connection.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Remember to change HOST - PORT - SID
/Rene
[ June 27, 2002: Message edited by: Rene Larsen ]
 
Sanjay Jadhav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..
what is default host-port-sid for Oracle8i,As i look into tnsname.ora file it give me host as sanjay,port as 1521 and sid as oracle8i which as choose when i enter the global database name.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HOST - PC where you installed Oracle 8i - e.g. 127.0.0.1 (for this PC if it is the same as you installed the database) or the IP-adr of the PC where it is installed.
PORT - default is 1521, but you can change it when you make a Network Configuration.
SID - when you created the Database you typed two names, the first was the Database name, the second was the SID name.
/Rene
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic