Problem with binary columns longer than 127

Valentin Todorov valentin.todorov at sea.ericsson.se
Fri Mar 24 11:30:11 EST 2000


I do not know if this is a known problem, but I could not find anything by 
searching this mailing list.

OS: NT4
JDK: 1.1.8
DBMS: MS SQL 7.0

When quering a table which has binary column(s) longer than 127, 
ResultSet.next() throws an exception NegativeArraySizeException. For 
varbinary columns the length as specified in CREATE TABLE does not matter, 
but the same happens if there is data longer than 127 bytes stored in the 
column.

To test this one can use t0017 - change the length of the column mybinary.
Here is the output:


Test all the SQLServer datatypes in Statement and PreparedStatement
!!!Note- This test is not fully implemented yet!!!
java.lang.NegativeArraySizeException
        at com.internetcds.jdbc.tds.TdsComm.getBytes(Compiled Code)
        at com.internetcds.jdbc.tds.Tds.getRow(Compiled Code)
        at com.internetcds.jdbc.tds.Tds.processSubPacket(Tds.java:1281)
        at com.internetcds.jdbc.tds.ResultSet.next(Compiled Code)
        at t0017.main(t0017.java:168)

Valentin




More information about the FreeTDS mailing list