Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

jdbc Oracle connection error

84 views
Skip to first unread message

ep

unread,
Feb 8, 2001, 8:03:26 AM2/8/01
to
Hi!

Can someone tell me what this means ?

Exception d'E/S: SO Exception was generated

I also have this in console:

oracle.net.TNSAddress.SOException
at oracle.net.TNSAddress.ServiceAlias.initFromNVPair(Unknown Source)
at oracle.net.TNSAddress.ServiceAlias.initFromString(Unknown Source)
at oracle.net.resolver.AddrResolution.resolveAddrTree(Unknown
Source)
at oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown
Source)
at oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
at oracle.net.ns.NSProtocol.connect(Unknown Source)
at oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java, Compiled
Code)

I got this exception when i tried to connect an Oracle database with jdbc
thin drivers on linux
before i had a message which told me that it didn't find the drivers so i
think it find them now...

Thanks,
Emmanuel.

here is a part of my code, concerned by the error message:

....
try
{
String identifiant;
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();

con = DriverManager.getConnection("jdbc:oracle:thin:@database", "user",
"pass");

stmt = con.createStatement();

// stmt =
con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATAB
LE);
// stmt.setFetchSize(25);

rs = stmt.executeQuery("SELECT ID FROM WHO");
}
.....


deja...@my-deja.com

unread,
Feb 8, 2001, 9:09:40 AM2/8/01
to
the connection string (url) fro thin driver
must be in format
"jdbc:oracle:thin:@<host>:<port>:<SID-database>"
for example for local:
"jdbc:oracle:thin:@127.0.0.1:1521:ORCL"

if you have problem after correcting url, please,
look for errors in listener.ora . I assume you did
not forget to start oracle's listener (?)

AlexV

In article <95u5cl$31k$1...@wanadoo.fr>,


Sent via Deja.com
http://www.deja.com/

ep

unread,
Feb 8, 2001, 9:57:06 AM2/8/01
to
now it works
in fact, the jdbc doesn't understand only the service_name so i replaced it
by its definition in tnsnames.ora

Thanks a lot ! :)

<deja...@my-deja.com> a 閏rit dans le message :
95u9at$m2f$1...@nnrp1.deja.com...

Konstantin Gordiyenko

unread,
Feb 8, 2001, 3:34:34 PM2/8/01
to
thin driver can't read any entries in tnsnames.ora. If you want to
specify in the connection string service name from tnsnames.ora file,
use OCI driver:
"jdbc:oracle:oci8:@service_name"

ep wrote:
>
> now it works
> in fact, the jdbc doesn't understand only the service_name so i replaced it
> by its definition in tnsnames.ora
>
> Thanks a lot ! :)
>

> <deja...@my-deja.com> a Иcrit dans le message :

konstantin.vcf
0 new messages