Skip to Main Content

Java Database Connectivity (JDBC)


For appeals, questions and feedback about Oracle Forums, please email Please ask technical questions in the appropriate category. Thank you!

using sqlcl and IO Error: Got minus one from a read call

user447000Feb 14 2023


out team encountered a strange problem when using sqlcl .
"Oracle Database 19c Enterprise Edition Release - Production
in a docker container and publish the 1521 port outside.
There was no problem to connect and work with this database with sqldeveloper from outside.
However when using sqlcl (no matter which version) we got an error:
Error Message = IO Error: Got minus one from a read call (CONNECTION_ID=Lej7SLPBRFmk8mUs/tcQQQ==)
We used the TWO_TASK environment variable on connect.
It looked like

All this worked when ‘localhost’ was replaced by IP address.

We solved the problem now by setting the ENVIRONMENT-variable
export CUSTOM_JDBC=''
(this variable is read by the ‘sql’ shellscript which starts the java process)

So it worked also with localhost and without IP.

It seemed also only a problem when all this - dockerized database and sqlcl client - was running inside a linux virtual machine.
I tried to reproduce the error in a native linux environment and it worked without setting CUSTOM_JDBC. (I used the same sqlcl-version and same java-version and of course the same oracle image).

Can someone explain what mean and why is it necessary to set the property in one environment and not necessary in another? Although I now have a workaround, I still don't really understand the problem.

Best regards

Post Details
Added on Feb 14 2023