Re: Limit on LONGVARBINARY in MS JDBC driver?



Charles,
I am using SQL Server and I created the same stored procedure as you did.
My table definition matches yours. The only difference is that my sp name
is attachment_sp. I am able to get back more than 500,000 bytes. Here is
the code that I used -- see if it works for you.

The output from the run:

Trying to connect...
Connected.
please wait... retrieving file. This may take a while.
Length 1555799


The code I used:

System.out.print("Trying to connect...\n");
con = DriverManager.getConnection(url,"test", "test");
System.out.print("Connected.\n");
PreparedStatement ps = con.prepareStatement("{call attachment_sp(?)]}");
ps.setInt(1,4);
ps.execute();
r = ps.getResultSet();
r.next();
System.out.print("please wait... retrieving file. This may take a
while.\n");
byte[] data = r.getBytes(1);
int bytecount = data.length;
System.out.print(" Length " + bytecount + "\n");
con.close();


Sue
DataDirect Technologies


.


Loading