From my read of the Sybase ASE docs, it looks like we should be using count_big() which returns a bigint (which we map to Long in Java) instead of just count().