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

java.sql.SQLException: No more data to read from socket

12 views
Skip to first unread message

Manel NOSPAM Rodero

unread,
Oct 25, 1998, 2:00:00 AM10/25/98
to
Hi,

I have some problems using JDBC drivers against a Oracle 8.0.3 server.
I'm using JDK 1.1.7 and the JDBC drivers that come with this Oracle
distribution (7.3.3.1.3). I'm using JDBC thin drivers to connect to
this database (running in a NT system at home with MS Loopback adapter)

Hostname: leviathan
Service: orcl
Port: 1521
SID: ORCL

1) If I try the following:
-------------------------------------------------------------------------

Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@zumba:1721:PP",
"scott", "tiger");
-------------------------------------------------------------------------

then I get:
-------------------------------------------------------------------------

java.sql.SQLException: zumba
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:203)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:100)

at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:126)
at Employee.main(Employee.java:24)
-------------------------------------------------------------------------

This is correct, "zumba" is a name not know by my standalone system.

2) If I try the following:
-------------------------------------------------------------------------

Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@leviathan:1721:PP",
"scott", "tiger");
-------------------------------------------------------------------------

then I get:
-------------------------------------------------------------------------

F:\jdbc\73313\samples\thin>java Employee
java.sql.SQLException: Connection refused
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:203)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:100)

at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:126)
at Employee.main(Compiled Code)
-------------------------------------------------------------------------

This is correct because my service is running in port 1521 (as defined
by a service using SQL Net8 Easy Configuration)

3) If I try the following:
-------------------------------------------------------------------------

Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@leviathan:1521:PP",
"scott", "tiger");
-------------------------------------------------------------------------

then I get:
-------------------------------------------------------------------------

F:\jdbc\73313\samples\thin>java Employee
java.sql.SQLException: Refused:ROR=(CODE=12505)(EMFI=4))))

at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:203)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:100)

at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:126)
at Employee.main(Compiled Code)
-------------------------------------------------------------------------

This is correct because I have'nt any SID named "PP", my sid is the
default "ORCL".

4) Finally, if I try the normal connection (and the one I've tried
the first time before doing the 3 other tests) like this:
-------------------------------------------------------------------------

Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@leviathan:1521:ORCL",

"scott", "tiger");
-------------------------------------------------------------------------

then I get:
-------------------------------------------------------------------------

F:\jdbc\73313\samples\thin>java Employee
java.sql.SQLException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:382)
at oracle.jdbc.ttc7.TTCInBuffer.getByte(Compiled Code)
at oracle.jdbc.ttc7.TTIMsg.unmarshalSB1(TTIMsg.java:929)
at oracle.jdbc.ttc7.O3log.receive1st(Compiled Code)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:163)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:93)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:126)
at Employee.main(Compiled Code)
-------------------------------------------------------------------------

So the QUESTION is: What's happening? I used the same sample test file I

use at work (there with a "real" system connected to Internet) and
Oracle7
and Oracle8 systems ... There I have no problem!

The Full source code for the sample I'm trying to execute is:

/*
* This sample shows how to list all the names from the EMP table
*
* It uses the JDBC THIN driver. See the same program in the
* oci7 or oci8 samples directories to see how to use the other drivers.

*/

// You need to import the java.sql package to use JDBC
import java.sql.*;

class Employee
{
public static void main (String args [])
throws SQLException, ClassNotFoundException
{
// Load the Oracle JDBC driver
Class.forName ("oracle.jdbc.driver.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.
Connection conn =
DriverManager.getConnection
("jdbc:oracle:thin:@leviathan:1521:ORCL",
"scott", "tiger");

// 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));
}
}


PS: SQL*Plus connections run ok, IIS 3.0 runs ok, FTP services and
other services like telnet run ok so I suppose there isn't any problem
with MS Loopback adapter. If I try the same query using SQL*Plus and
"scott" user the result is:

SQL> select ename from emp;

ENAME
----------
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS
JAMES
FORD
MILLER

14 rows selected.

PS: PLEASE! Answer this message by e-mail too! I can't read newsgroups
every day :(

--

____________________________________________________________________

o o o MANEL Rodero Blanquez
o o o PCs Area Systems Programmer
o o o Laboratori de Calcul FIB - LCFIB
U P C Universitat Politecnica de Catalunya, Barcelona, Spain

Email: Reply to user "manel" at "fib.upc.es" (inserting @). Thanks!
____________________________________________________________________

0 new messages