|
|
Re: jdbc connect to oracle
|
Posted: Sep 1, 2005 3:32 AM
|
|
> 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...
|
|