Re: Connection Problems
Posted by: Arya Shivaji
Date: January 27, 2005 07:03PM

Hi ,

I am getting the following error while running my java program trying to coonect to oracle 8i.

java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNU
M=135286784)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

Please see the code below
import java.sql.*;
import oracle.jdbc.driver.*;
import java.io.*;


public class DB
{
public static void main(String args[])throws SQLException
{

try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@mini:1521:ORACLE", "scott", "tiger");

System.out.println("establised");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from dept");
ResultSetMetaData rsmd = rs.getMetaData();
for(int i = 1 ; i <= rsmd.getColumnCount(); i++)
System.out.print(rsmd.getColumnLabel(i));

System.out.println();
while(rs.next())
{

System.out.println(rs.getInt(1) + " ," + rs.getString(2) + " ," + rs.getString(2) );
}
}

catch(Exception ex)
{
System.out.println(ex);


}
}

}

Please see my listener.ora file
# E:\ORANT\NETWORK\ADMIN\LISTENER.ORA Configuration File:E:\ORANT\NETWORK\ADMIN\listener.ora
# Generated by Oracle Net8 Assistant

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(PROTOCOL_STACK =
(PRESENTATION = TTC)
(SESSION = NS)
)
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = mini)(PORT = 1521))
(PROTOCOL_STACK =
(PRESENTATION = TTC)
(SESSION = NS)
)
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = oracle))
(PROTOCOL_STACK =
(PRESENTATION = TTC)
(SESSION = NS)
)
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = test)(PORT = 2481))
(PROTOCOL_STACK =
(PRESENTATION = GIOP)
(SESSION = RAW)
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\ORANT)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = oracle.domain)
(ORACLE_HOME = E:\ORANT)
(SID_NAME = ORACLE)
)
(SID_DESC =
(GLOBAL_DBNAME = oracle)
(ORACLE_HOME = E:\ORANT)
(SID_NAME = ORCL1)
)
)

LOGGING_LISTENER = OFF

Options: ReplyQuote


Subject
Written By
Posted
October 24, 2004 05:55PM
October 26, 2004 06:37PM
November 04, 2004 12:49PM
November 16, 2004 07:01PM
Re: Connection Problems
January 27, 2005 07:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.