Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Aurora bug with DataInput.readFully ?
Hello,
I have a Java stored function that use the readFully method from the class DataInputStream to fetch a long row of 5Mb. However it seems that Aurora can't handle readFully for arrays larger than 32767 (2^15-1). In the following example, if I change the length of raw[] to 32768, i get an EOFException :
java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java)
at java.io.DataInputStream.readFully(DataInputStream.java)
at rftest.readFullyTest(rftest:22)
The same program, when running outside Oracle, works correctly. So i suppose this is a bug in the Oracle JavaVM.
Has anyone an idea to fetch more than 32k data ?
Emmanuel BOURG
import java.io.*;
import java.sql.*;
import oracle.jdbc.driver.*;
public class rftest
{
public static int readFullyTest() throws SQLException {
Connection con = null; Statement stmt; byte raw[] = new byte[32767]; con = new OracleDriver().defaultConnection(); stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT bin FROM data WHERE id=1"); rs.next(); try { DataInputStream dis = new DataInputStream(rs.getBinaryStream(1)); dis.readFully(raw); dis.close(); stmt.close(); } catch (IOException e) { System.err.println(e.getMessage());e.printStackTrace(); }
return 1;
}
}
Received on Wed Aug 18 1999 - 11:29:03 CDT