My Oracle Support Banner

java.sql.SQLException: Stream has already been closed When Running Query In JDBC (Doc ID 832903.1)

Last updated on AUGUST 30, 2023

Applies to:

JDBC - Version and later
Information in this document applies to any platform.


An application using JDBC to connect to an Oracle database to generate ad hoc reports fails with error:

java.sql.SQLException: Stream has already been closed

The same query runs fine through SQLDeveloper.

This only appears to happen when the query includes a column with a type of Long.

For example, standalone program




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.