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

SQLException: JZ006 IOException:JZ0EM

18 views
Skip to first unread message

Ed Trembicki-Guy

unread,
Jul 11, 2000, 3:00:00 AM7/11/00
to
While trying to learn jdbc programming, I encountered the following
exception:

java.sql.SQLException: JZ006: Caught IOException: java.io.IOException:
JZ0EM: End of data.

What was quite unnerving is that the Sybase documentation makes no
mention of either of these SQLStates.
What was more unnerving was the actual cause of the problem, once I
discovered it.

I share my experience here in hopes that it may save others some hours
of futile debugging.

The cause of the error was an incorrectly named database column in my
prepared sql statement. Why I didn't get an "unknown column name"
exception confounds me.

I was testing saving and retrieving data. The java class that I wanted
to persist has the following structure:

public class TestTypes extends PersistentObject {
private java.lang.String testString;
private Integer testInteger;
private Short testShort;
private Double testDouble;
private Long testLong;
private Float testFloat;
private Boolean testBoolean;
private java.sql.Date testDate;
private java.sql.Timestamp testTimestamp;
}

The Sybase table, TestTypes, has the following layout:
oid integer
testString varchar 255
testInteger integer
testDate date
testTimestatmp timestamp
testBit bit
testBigint bigint
testSmallint smallint
testDouble double
testFloat float

I created a class to map java class attributes to database columns.
It's used to construct such things as prepared statements, such as
"INSERT INTO <tablename> (<columnnames>) values (<?...>)", retrieving
the column names from a vector of these attribute maps. I inadvertently
set one of the attribute maps' column names to "testBoolean" instead of
"testBit", resulting in the prepared statement "INSERT INTO TestTypes
(oid, testString, testInteger, testDate, testTimestatmp, testBoolean,
testBigint, testSmallint, testDouble, testFloat) values
(?,?,?,?,?,?,?,?,?,?)", instead of "INSERT INTO TestTypes (oid,
testString, testInteger, testDate, testTimestatmp, testBit, testBigint,
testSmallint, testDouble, testFloat) values (?,?,?,?,?,?,?,?,?,?)"

That was the cause of the cryptic exception. As soon as I corrected it,
everything worked fine. Hope this helps someone.
Cheers,
Ed

eguy.vcf

abi

unread,
Aug 8, 2000, 3:00:00 AM8/8/00
to
hello every one,
i am bi from poland i wnat to work on JDBC on the platform of linux has
any one of has any driver i need mail me soon there is no ODBC in LINUX so
i need driver .

hope you will help me
abi


abi

unread,
Aug 8, 2000, 3:00:00 AM8/8/00
to
> hello again ,

sorry my last mail was bit confusing right okay now i tell u in details i am
working in JDBC and in linux there is no ODBC so that i can make a bridge
between my database and my JDBC program has any one of u has any idea how i
can do it and has any of you know about the good driver which i can use it ,
if yes pls mail me back as soon as possible, bye
abi

abi

unread,
Aug 8, 2000, 3:00:00 AM8/8/00
to
hi again
one more question do any one know the good XML,XSL,XML-QL editor which
can even handel JAVA with XML and DTD and it should be on the linux
platform i use operating system linux so do any one know the editor which i
need if mail me at my personal address "a...@itam.zabrze.pl " i will wait
for your mail

should i say thank u to all in advance for helping me don't forget to mail
me up guys i need this editor as soon as possible bye
abi


0 new messages