aspose file tools*
The moose likes JDBC and the fly likes Sybase issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Sybase issue" Watch "Sybase issue" New topic
Author

Sybase issue

Chinmay Bajikar
Ranch Hand

Joined: Dec 08, 2001
Posts: 159
Hi,
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(ErrorMessage.java:498)
at com.sybase.jdbc2.jdbc.SybConnection.checkConnection(SybConnection.jav
a:1619)
at com.sybase.jdbc2.jdbc.SybStatement.checkDead(SybStatement.java:1717)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.setString(SybPreparedState
ment.java:249)
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
http://sybooks.sybase.com/onlinebooks/group-jcarc/jcg0500e/jc_ref/@Generic__BookTextView/8757
Gives
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.
Thanks,
Chinmay


The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
 
Don't get me started about those stupid light bulbs.
 
subject: Sybase issue