[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Re: read blob as byte array issue

I think I am beginning to understand what you are doing.

You have a LargeObject, but your JDBC driver is returning it as a Long (its oid) not as a Blob, but you just want the bytes. If you call getBytes() on your ResultSet the driver reads the Blob and gives you the bytes, but if getObject() is called you just get the Long oid back.

You might be able to configure something in your driver, or define your column type differently to fix this.

To workaround the driver issue in EclipseLink you could customize your DatabasePlatform, override the method,

public Object getObjectFromResultSet(ResultSet resultSet, int columnNumber, int type, AbstractSession session) throws java.sql.SQLException

If the "type" is your oid type, then call getBytes() on the ResultSet, otherwise call super.