This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Network adaper connection error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Network adaper connection error" Watch "Network adaper connection error" New topic
Author

Network adaper connection error

Allam Rosaiah
Greenhorn

Joined: Dec 25, 2011
Posts: 2
Hi i am connected spring to hibernate database is oracle.but whenever i used type 4 driver m getting like this exception.
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

But in type1 driver working fine may i know what is the reason.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1098

Allam I am afraid nobody will be able to help with that little information TellTheDetails please read this explanatory page
Allam Rosaiah
Greenhorn

Joined: Dec 25, 2011
Posts: 2
Hi,

m pasting java code below please observe clearly.type1 driver connecting db successfully ,but type4 is the problem creating.I started all the services in services area and global name is orcl also.please help to solve this problem.

try {
Class.forName("oracle.jdbc.driver.OracleDriver");
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
Connection con =DriverManager.getConnection("jdbcracle:thin:@172.20.10.51:1521rcl","scott","manager");
// Connection con =DriverManager.getConnection("jdbcdbc:arosa","scott","manager");
if(con!=null)
System.out.println("conection is connected");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}



Error is :

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)





 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Network adaper connection error
 
Similar Threads
Problem connecting to database
The Network Adapter could not establish the connection in jdbc connection
help with ms sql server 2005
The Network Adapter could not establish the connection.
Unable to establish a network connection