A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Problem connecting to database
Mathews P Srampikal
Joined: Nov 26, 2002
Sep 07, 2008 03:15:00
I am getting the following exception while connecting to databse.
1. driver is loaded
2. Database server is running
what can be the problem. i gave ip address instead of machine name in place of URL
the code is:
System.out.println("Oracle driver loaded: ");
Connection conn = DriverManager.getConnection ("jdbc
racle:thin:@mats:1521:ORCL", "system", "orcl");
System.out.println("Connecting to oracle database: ");
The Exception is:
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
Cameron Wallace McKenzie
author and cow tipper
Joined: Aug 26, 2006
Sep 07, 2008 07:55:00
Can you ping the IP address and connect on that port? You might have a proxy or something blocking that port. Any firewalls?
Joined: Oct 11, 2000
Sep 07, 2008 21:58:00
When I did an Internet search on your error message I got over 4,000 hits.
Did none of them answer your question?
The cause of the error is usually one (or more) of the following:
Database server is not running.
Database connection listener is not running.
Connection URL is incorrect.
Check first one via
Check second one via "lsnrctl" utility.
Refer to documentation for correct syntax of third one and then check TNS configuration to verify the correct parameters required.
I agree. Here's the link:
subject: Problem connecting to database
not able to connect with 10g
thin driver connection problem @thin:
JDBC Error :- End of TNS data Channel. SQL Exception Error
java.sql.SQLException: No suitable driver
The Network Adapter could not establish the connection in jdbc connection
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014