File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes connect to Oracle cluster over JDBC thin client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connect to Oracle cluster over JDBC thin client" Watch "connect to Oracle cluster over JDBC thin client" New topic
Author

connect to Oracle cluster over JDBC thin client

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I'm trying to connect to multiple Oracle 10g databases (failover) over the JDBC thin client, and when I run the following, I get:
java.sql.SQLException: Io exception: NL Exception was generated


connection = DriverManager.getConnection("jdbc racle:thin:@DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = dbdev) (PORT = 1521))) (CONNECT_DATA = (INSTANCE_NAME = orcldev)))", "scott", "tiger");


I eventually want to put multiple ADDRESSes in that string, but right now I'm trying to get it to work with just one! I've tried multiple variations of this, like changing INSTANCE_NAME to SID or SERVICE_NAME, and using the internal IP address for the HOST dbdev (see below). Here's the tnsnames.ora file used by SQL*Plus on the same client machine:

ORCLDEV.world =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))
(CONNECT_DATA =
(SID = orcldev)
)
)
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
This is from the Oracle JDBC reference (you need to create a login to view it):
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Yeah, so why isn't this working?

David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Originally posted by Stephen Huey:
jdbc racle:thin:@DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.132) (PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ORCLDEV)))
You don't have an open paren between the @ and DESCRIPTION.
[ January 12, 2005: Message edited by: David Harkness ]
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Right. Thanks!
 
Don't get me started about those stupid light bulbs.
 
subject: connect to Oracle cluster over JDBC thin client
 
Similar Threads
Using oracle conn. manager - connection refused
Passing user and password in Oracle RAC url
JDBC
problems in setting SID/HOST/PORT
invalid SQL url specified