Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Oracle 8.1.7.0.1 JDBC/Thin The network adapter could not establish...

0 views
Skip to first unread message

Michael Aidane

unread,
Nov 19, 2001, 6:29:58 PM11/19/01
to
Hi,

I have been reading hundreds of postings about the "Network adapter
but it did not help me to solve my problem. Please help me...

*I have Oracle 8.1.7.0.1 running on Linux (Red Hat 7.1)
*Oracle 9.0.1 client is installed on my workstation (w2k)
*I used the "Employee.java" source code:
import java.sql.*;

class Employee
{
public static void main (String args [])
throws SQLException
{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());

// Connect to the database
// You must put a database name after the @ sign in the connection
URL.
// You can use either the fully specified SQL*net syntax or a
short cut
// syntax as <host>:<port>:<sid>. The example uses the short cut
syntax.
String url = "jdbc:oracle:thin:@webdev:1521:TEST";
String userName = "scott";
String password = "tiger";

if (args.length > 0) url = args[0];
if (args.length > 1) userName = args[1];
if (args.length > 2) password = args[2];

Connection conn =
DriverManager.getConnection (url, userName, password);
// Create a Statement
Statement stmt = conn.createStatement ();

// Select the ENAME column from the EMP table
ResultSet rset = stmt.executeQuery ("select ENAME from EMP");

// Iterate through the result and print the employee names
while (rset.next ())
System.out.println (rset.getString (1));
}
}
*I unjarred classes12.zip in the same directory where I have
Employee.class

I get the following message:
Exception in thread "main" java.sql.SQLException: Io exception: The
Network Adap
ter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:335)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:361)

at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va, Compiled Code)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java,
Compiled C
ode)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Employee.main(Employee.java, Compiled Code)

*I checked the syntax (the problem run if I launch it from the linux
Server)
*I checked that the listener is launched
*I checked the listener.log and It actually connect!

I do not know what do to do now!!!

Mike

AV

unread,
Nov 19, 2001, 8:20:13 PM11/19/01
to
On the oracle's machine look for ORA_HOME/bin/lsnrctrl.sh
Start it. in prompt lsnrctrl> enter
lsnrctrl>status
If there is some error message than enter
lsnrctrl>start
Check if listener (miniserver) started properly (no err messages).
than again
lsnrctrl>status
If you still can not get connection, may be LISTENER.ORA file must be
fixed. Look for NetConfig or NetAssistance utilities in Ora_Home/bin.

ALexV

"Michael Aidane" <mi...@webxtract.com> wrote in message
news:90a9aff9.01111...@posting.google.com...

0 new messages