Hi Justin, This helps but I'm still a bit uncertain as to how GeoTools will actually tie into the converters... I wrote two, one for Clobs and one for Blobs. But the converters never seem to be triggered...
On 07/07/2010 07:14 PM, Justin Deoliveira wrote: > Hi Alex, > > I would suggest you mirror the oracle case. Basically what a "converter > factory" is is sort of an extension point in order to perform conversion > between various types. Essentially teh same idea as commons converters > if you are familiar with them. > > So basically how it works is that the base SQLDialect maps CLOB and BLOB > to String and byte[] respectively. So whenever the JDBCDataStore access > a value from a result set that has the type BLOB, it will always run the > result through the "converter chain". The converter chain essentially > asks all registered converters if it can convert from type a to type b. > In the case of oracle it will ask if any can convert from > oracle.sql.BLOB to byte[]. > > Converter implementations are registered via the factory spi mechanism. > Same way datastore factories are. So probably the cleanest solution for > you would be to write a converter that converts ingres Blob and Clob > objects to byte[] and String. > > Hope that helps. > > -Justin > > On 10-07-07 4:51 PM, Alex Trofast wrote: >> Greetings all, >> >> I just converted the LOB test and ran into some issues with it. Ingres >> returns BLOBs with the type code Type.LONGVARBINARY so I mapped that to >> the Blob.class which is the type Ingres returns. Same with CLOBs, the >> mapping is Type.LONGVARCHAR to Clob.class. The test tries to cast the >> Blob.class type to a byte[] and it fails miserably :( >> >> I saw the Oracle driver had OracleBlob/ClobConverterFactory but I am >> uncertain exactly how these work. The Clob/Blob classes will work with >> the getString() method however it is not "recommended" (whatever that >> means in practice) for large streams and you should instead use the >> InputStream methods. >> >> Any help is greatly appreciated, thank you. >> > -- Alex http://bit.ly/geodb ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel