jTDS trucates the data returned for an out paramter of type varbinary(max) to 8,000 bytes. This has been observed when calling a stored procdure in SQL Server 2005 and SQL Server 2008 R2. It may also occur with other databases and versions. The stored procedure is called via a CallableStatement. No error is provided in the logging output of jTDS. It silently truncates the data.
Here's an example of a stored procedure signature:
procedure [User].[pTest]
@data varbinary(max) out
,@name nvarchar(max) = null
,@date datetime
In this example, the @data stored procedure parameter will usually contain ~10,000 bytes after the procedure executes. Using SQL Server Management Studio to call the stored procedure via EXEC, all ~10,000 bytes will be in @data after executing. From the logs, jTDS returns only 8,000 bytes. Can you please confirm this is a reproducible issue? Do any other details need to be provided? Thanks.