Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: A little help connecting to oracle from java. Anyone? Please!!? :-)
Thanks for your help guys. I'm pretty sure the listener is working because
TOAD can connect no problem and sql plus works fine. I also tested it using
the the lstnr program that AV mentioned and tnsping gave the following when
I pinged dayaton:
Used parameter files:
C:\oracle_server\network\admin\sqlnet.ora
C:\oracle_server\network\admin\tnsnames.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL =
TCP)(HOST = aegis)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME =
dayton.homenet)))
OK (350 msec)
Does this give any clues? It's so bizarre. Everything looks like its working. Is there any way I can start isolating and narrowing down to the problem? TOAD works. SQL Plus works. The listener says its listening. Could someone tell me if SQL Plus and TOAD could connect to the database if the listener were mis-configured? Do they use another method of connection that I don't know about?
Thank you all so much for taking a sec to help Simon
> Look your harddrive for program with name something
> like lsnctrl.exe (or .sh), start it and enter "status"
> Check if there is handler (entry in status message)
> corresponding to your Oracle instance name.
> Use exactly this name in connection URL (after 1521).
> Also, the relevant file is listener.ora, not tnsnames.ora.
>
> AlexV.
>
>
> "Simon Harvey" <noThanks_at_pdf.com> wrote in message
> news:3d554318_1_at_news.teranews.com...
> > Hi,
> >
> > I'm having problems conecting to an oracle database using jdbc and I was
> > wondering if you could help.
> >
> > The only way I know how to connct to a database (MS Access in
particular)
> is
> > to create a DSN in the Windows control panel applet called Data Sources
> > (ODBC) and then use that name as part of the connection string in my
java
> > program.
> >
> > But with oracle I'm getting a bit confused as I'm not sure if using this
> > method comes into it at all (I hope it does cos it's easy!!) I've read
> that
> > instead of using the DSN, you just use the service name. Now service
names
> > scare the crap out of me as I dont understand them.
> >
> > Well, I've tried both now (I think (not sure if I got the service name
> > right)) and each time I'm getting:
> >
> > java.sql.SQLException: Io exception: Connection
> >
>
refused(DESCRIPTION=(TMP=)(VSNNUM=150999297)(ERR=12505)(ERROR_STACK=(ERROR=(
> > CODE=12505) (EMFI=4))))
> >
> >
> > I've tried the following two connection strings:
> >
> > DSN Version:
> > String connectionString = "
> jdbc:oracle:thin:localhost:1521:daytonDSN";
> >
> > What I think is the Service Name version:
> > String connectionString = "
> > jdbc:oracle:thin:localhost:1521:dayton.homenet";
> > also tried:
> > String connectionString = " jdbc:oracle:thin:localhost:1521:DAYTON";
> >
> >
> > I dont know which is the actual service name as I've been told to
> differing
> > things. Could someone take a sec just to tell me once and for all!!
> Please!
> >
> > Where the relevant part in my TNS.ora is:
> >
> > DAYTON = **** Is this the Service Name******
> > (DESCRIPTION =
> > (ADDRESS_LIST =
> > (ADDRESS = (PROTOCOL = TCP)(HOST = aegis)(PORT = 1521))
> > )
> > (CONNECT_DATA =
> > (SERVICE_NAME = dayton.homenet) ******* Or is this the
> Service
> > Name********
> > )
> > )
> >
> >
> > You have know idea how much it would mean to me to get this sorted out.
I
> > was hoping that comething as simple as connecting to the database would
be
> > easy to do right out of the box but this has had me, my girlfriend and
one
> > of my best mates bamboozled for weeks.
> >
> > My (and our) sincerest thanks to anyone who knows what all this means
and
> > how to fix it. I know its going to be something so trivial but its so
> > frustrating!!
> >
> > Thanks again
> >
> > Simon
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
Received on Sun Aug 11 2002 - 04:53:42 CDT
![]() |
![]() |