Class 1:Employee
Class 2:Document
one employee to many document
content is one of document's property
when content type is String,every thing is right
as ms sqlserver 2000 is used,if column content's type is the varchar(8000),it is not enough,it should be text type.
now,change the type of property content as java.sql.Clob,generate database table is yet right,the columns type is now text, but when insert document,an errror raise as this:
11:24:44,037 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: HY01011:24:44,037 ERROR JDBCExceptionReporter:46 - [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.11:24:44,037 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: HY01011:24:44,037 ERROR JDBCExceptionReporter:46 - [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.11:24:44,077 ERROR JDBCExceptionReporter:38 - could not load: [com.jieshun.jsproject.entity.Employee#030082]java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:216) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:216) at net.sf.hibernate.type.StringType.get(StringType.java:18) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53) at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66) at net.sf.hibernate.loader.Loader.hydrate(Loader.java:611) at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:552) at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:511) at net.sf.hibernate.loader.Loader.getRow(Loader.java:426) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:209) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:831) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:851) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:57) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:49) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2081) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1955) at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1884) at com.jieshun.jsproject.entity.Employee.getInstance(Employee.java:220) at com.jieshun.jsproject.entity.Document.main(Document.java:604)com.jieshun.jsproject.ProjectException: net.sf.hibernate.JDBCException: could not load: [com.jieshun.jsproject.entity.Employee#030082]
can anybody here give me a hand?
Regards
|