The Artima Developer Community
Sponsored Link

Java Answers Forum
jdbc connect to oracle

2 replies on 1 page. Most recent reply: Sep 1, 2005 6:47 PM by olin

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
olin

Posts: 2
Nickname: olin
Registered: Sep, 2005

jdbc connect to oracle Posted: Sep 1, 2005 1:10 AM
Reply to this message Reply
Advertisement
oracle SERVERNAME: oracle8.dbjdk1.4
package:(class12) is ok

if write this:
jdbc:oracle:thin:@172.18.28.110:1521:oracle8.db
java throws EXCEPTION (refuse to connect.. and so on)

but write this
jdbc:oracle:thin:@172.18.28.110:1521:oracle8
everything is ok

so why ?????(if SERVERNAME a=oracle8.db1,b=oracle8.db2, How shall I write the jdbc code? )

ps:if use oracle Net Manager,SERVERNAME=oracle8.db is correct , SERVERNAME=oracle8 is wrong


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: jdbc connect to oracle Posted: Sep 1, 2005 3:32 AM
Reply to this message Reply
> oracle SERVERNAME: oracle8.dbjdk1.4
> package:(class12) is ok
>
> if write this:
> jdbc:oracle:thin:@172.18.28.110:1521:oracle8.db
> java throws EXCEPTION (refuse to connect.. and so on)

I have never used Oracle but probably by default
every oracle db file has a .db* extension hence it
is not expected

> but write this
> jdbc:oracle:thin:@172.18.28.110:1521:oracle8
> everything is ok
>
> so why ?????(if SERVERNAME a=oracle8.db1,b=oracle8.db2,
> How shall I write the jdbc code? )

Incorrect! That's the name of your database,
not your server. Your server is 172.18.28.110,
1521 is the port you are using to connect to
the Server which listens at port 1521

oracle8 is the database (I don't know how oracle
stores its data - but probably a file).

> ps:if use oracle Net Manager,SERVERNAME=oracle8.db is
> correct , SERVERNAME=oracle8 is wrong

By the way I'm assuming thin is your user name
and you have an anonymous pass word why don't you
restructure the url and leave out the thin@
and when you call DriverManager.connect
instead of passing parameters (url, "", "")
try pass in (url, "thin", "")... Just a suggestion
won't necessarily work but its worth a try...

olin

Posts: 2
Nickname: olin
Registered: Sep, 2005

Re: jdbc connect to oracle Posted: Sep 1, 2005 6:47 PM
Reply to this message Reply
thank you for your advice ,i will be try

Flat View: This topic has 2 replies on 1 page
Topic: JTable question Previous Topic   Next Topic Topic: Replace Panel

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use