This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Sybase issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Sybase issue" Watch "Sybase issue" New topic

Sybase issue

Chinmay Bajikar
Ranch Hand

Joined: Dec 08, 2001
Posts: 159
I am having Sybase as my backend.
When I am inserting to table with a image column which basically stores a large string and the string to be inserted is of length 0,then it thron this exception,
java.sql.SQLException: JZ0C0: Connection is already closed.
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(
at com.sybase.jdbc2.jdbc.SybConnection.checkConnection(SybConnection.jav
at com.sybase.jdbc2.jdbc.SybStatement.checkDead(
at com.sybase.jdbc2.jdbc.SybPreparedStatement.setString(SybPreparedState
I run my code on Oracle and MS SQL and it works fine in similar conditions.
But for Sybase only I get this exception.
So I dont think there is connection being closed by my code anywhere.
The Sybase help at this link
Description: The application has already called Connection.close() on this connection object; it cannot be used any more.
Action: Fix the code so that connection object references are nulled out whenever a connection is closed.
Has anybody else faced such a problem and what was done to ensure nothing of this sort happened.

The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
I agree. Here's the link:
subject: Sybase issue
It's not a secret anymore!