JDBC Oracle8i connection string ?

larva

Member
Jul 15, 2001
185
0
0
Hi,

try
{

Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbcracle:thin192.1.1.168:1521rcl";

con = DriverManager.getConnection(url, "system","manager");
}
catch (SQLException ex)
{
System.out.println("\nFatal error: cannot connect to database!\n" + ex);
System.exit(1);
}
catch (java.lang.ClassNotFoundException ex)
{
System.out.println("\nFatal error: class not found!");
System.exit(1);
}

192.1.1.168 is Oracle DB Server address.
I configured my service name in tnsnames.ora is "abcora.transitlink.com.sg" and I never configure SID for my Oracle8i 8.1.7 DB.
I got the following error message:
Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

Pls help, Thanks !

larva



 

manly

Lifer
Jan 25, 2000
11,855
2,808
136
The connection string looks fine. Did you start the Oracle Net Listener? Using the JDBC thin driver requires the TCP listener daemon on the server.

SQL*Plus uses OCI so it only requires the Oracle Client.

You probably could use the OCI/thick driver if you wanted to, but just verify lsnrctl is running first on the server.
 

kmthien

Senior member
Oct 8, 2002
363
0
0
Hi guys,

I am facing the same problem also. Pls help, Thanks !

kmthien

=====================
Idea will always be an idea !
Unless you take action !
 

kmthien

Senior member
Oct 8, 2002
363
0
0
Hi Manly,

lsnrctl is running on the server but I still got the same error message !
How to use OCI/thick driver ??

kmthien
 

manly

Lifer
Jan 25, 2000
11,855
2,808
136
Oracle has extensive documentation available on Technet (free registration required):

Oracle 8i documentation root

Oracle 8i Online Documentation

I've never used the thick driver, but it requires Oracle Client preinstalled (sounds like you've done that), I think a different JDBC driver and a different connection URL.

Generally speaking, the thin driver should always be used unless there's a specific requirement for the OCI driver.

If you want, I'll paste in my listener.ora file for your reference. Btw, larva's code would work only if orcl is the SID for his database instance.
 

kmthien

Senior member
Oct 8, 2002
363
0
0
Hi manly,

When I setup Oracle8i database, I didn't enter SID since it's for Oracle8i don't really need it and need only Service Name. So how can I use SID in

String url = "jdbcracle:thin192.1.1.168:1521rcl";

?? Thanks !!

kmthien
 

manly

Lifer
Jan 25, 2000
11,855
2,808
136
Originally posted by: kmthien
Hi manly,

When I setup Oracle8i database, I didn't enter SID since it's for Oracle8i don't really need it and need only Service Name. So how can I use SID in

String url = "jdbcracle:thin192.1.1.168:1521rcl";

?? Thanks !!

kmthien
I'm not really a database developer, but I'm pretty sure the orcl in that URL is the Oracle SID. The few times I installed Oracle, SID seemed to be a fundamental part of the environment.

If you installed Oracle Client like you suggest you already have, just use the OCI driver, as documented here:
http://www.sts.tu-harburg.de/intranet/java/JDBC/Treiber/. And if you're going to be doing more work with Oracle, sign up for Technet.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |