If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Problem in connecting to the oracle

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-11, 04:38
usha gowda usha gowda is offline
Registered User
 
Join Date: Nov 2011
Posts: 1
Problem in connecting to the oracle

I am getting some error like "java.sql.SQLException: Io exception: The Network Adapter could not establish the connection".
i have given proper user name and pwd but still am not able to connect it.
Can anyone help me??

package orac;
//package com.orac.util;

import java.sql.Connection;
import java.sql.DriverManager;
//import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Oraclecall1 {
public static Connection getOracleConnection()throws ClassNotFoundException,SQLException{
System.out.println("Before");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection = DriverManager.getConnection("jdbcracle:thin:usla xorcstgdb13:1523:HLTS4","XXHL","XXHLTS4");
System.out.println(connection);
return connection;
}

public static void closeConnection(Connection pConnection,Statement pStatement)throws SQLException{
if(pStatement != null){
pStatement.close();
}
if(pConnection != null){
pConnection.close();
}

}
}
Reply With Quote
  #2 (permalink)  
Old 11-28-11, 09:23
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,415
can you connect to DB using different client and same connection details?

post Oracle error code & message resulting from failed request
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On