I got some problems with PostgreSQL and Orion when using blobs (oids in
the table).
I checked:
http://www.postgresql.org/users-lounge/docs/7.0/programmer/jdbc6519.htm
In the above page you can read the following example:
<snip>
To insert an image, you would use:
File file = new File("myimage.gif");
FileInputStream fis = new FileInputStream(file);
PreparedStatement ps = conn.prepareStatement("insert into images values
(?,?)");
ps.setString(1,file.getName());
ps.setBinaryStream(2,fis,file.length());
ps.executeUpdate();
ps.close();
fis.close();“
</snip>
This does a PreparedStatement.setBinaryStream(int,InputStream,int); -
Exactly what Orion did!
Here is the interesting part of the Exception.printStackTrace(); :
<snip>
> Nested exception is:
> InputStream as parameter not supported
> at java.lang.Throwable.(Throwable.java:84)
> at java.lang.Exception.(Exception.java:35)
> at java.sql.SQLException.(SQLException.java:100)
> at
> org.postgresql.util.PSQLException.(PSQLException.java:22)
> at
> org.postgresql.jdbc2.PreparedStatement.setBinaryStream(PreparedStatement
> .java:417)
> at com.evermind.sql.ao.setBinaryStream(JAX)
</snip>
So, this would lead to the conclusion, that Orion just tries to use a
standard JDBC-API. Maybe Orion uses a special subclass of InputStream
and
the JDBC-Driver doesn't correctly account for this situation. In the
JDBC
API it reads:
<snip>
Note: This stream object can either be a standard Java stream object or
your own subclass that implements the standard interface.
</snip>
This would blame the JDBC-driver then?
Yours
Armin