Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: A little help connecting to oracle from java. Anyone? Please!!? :-)

Re: A little help connecting to oracle from java. Anyone? Please!!? :-)

From: AV <avek_nospam_at_videotron.ca>
Date: Sun, 11 Aug 2002 01:09:31 -0400
Message-ID: <_jm59.21691$us1.399266@wagner.videotron.net>


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 - 00:09:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US