You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Frank Renaers <Fr...@ikan.be> on 2004/08/19 12:00:03 UTC

MSSQL and CLOB

Hi,

 

We are using OJB1.0.0 

It seems that it's not possible to read a MSSQL TEXT column  when we use
the Jdbc CLOB datatype.

It works when we use the LONGVARCHAR datatype, but we can't use it
because we would like to support also Oracle databases.

We are using the following mappings :

Java Type : String

Jdbc Type : CLOB

Mssql Database Type : TEXT

We always get the following exception.

 

rethrown as org.apache.ojb.broker.PersistenceBrokerException: Error
reading class type:
be.ikan.lib.ojb.bo.operatingsystem.OperatingSystemBean from result set,
current read field was log: [Microsoft][SQLServer 2000 Driver for
JDBC]Unsupported data conversion.

      at
org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readValuesFrom(Un
known Source)

      at
org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObjectArrayFr
om(Unknown Source)

      at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.materializeObject(Unkno
wn Source)

      at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown
Source)

      at
org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(U
nknown Source)

      at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unk
nown Source)

      at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unknow
n Source)

      at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(
Unknown Source)

      at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(
Unknown Source)

 

Does someone have a solution for this ?

 

Thanks,

 

Frank Renaers

Ikan Software

 

 

 


RE: MSSQL and CLOB

Posted by Guillaume Nodet <gu...@deliasystems.com>.
I know that the Microsoft jdbc driver does not handle clob correctly.
Try using jtds driver on http://jtds.sourceforge.net/

Guillaume


> -----Message d'origine-----
> De : Frank Renaers [mailto:Frank.Renaers@ikan.be]
> Envoye : jeudi 19 aout 2004 12:00
> A : ojb-user@db.apache.org
> Objet : MSSQL and CLOB
> 
> 
> Hi,
> 
>  
> 
> We are using OJB1.0.0 
> 
> It seems that it's not possible to read a MSSQL TEXT column  when we use
> the Jdbc CLOB datatype.
> 
> It works when we use the LONGVARCHAR datatype, but we can't use it
> because we would like to support also Oracle databases.
> 
> We are using the following mappings :
> 
> Java Type : String
> 
> Jdbc Type : CLOB
> 
> Mssql Database Type : TEXT
> 
> We always get the following exception.
> 
>  
> 
> rethrown as org.apache.ojb.broker.PersistenceBrokerException: Error
> reading class type:
> be.ikan.lib.ojb.bo.operatingsystem.OperatingSystemBean from result set,
> current read field was log: [Microsoft][SQLServer 2000 Driver for
> JDBC]Unsupported data conversion.
> 
>       at
> org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readValuesFrom(Un
> known Source)
> 
>       at
> org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObjectArrayFr
> om(Unknown Source)
> 
>       at
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.materializeObject(Unkno
> wn Source)
> 
>       at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown
> Source)
> 
>       at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(U
> nknown Source)
> 
>       at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unk
> nown Source)
> 
>       at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unknow
> n Source)
> 
>       at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(
> Unknown Source)
> 
>       at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(
> Unknown Source)
> 
>  
> 
> Does someone have a solution for this ?
> 
>  
> 
> Thanks,
> 
>  
> 
> Frank Renaers
> 
> Ikan Software
> 
>  
> 
>  
> 
>  
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org