欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Oracle读取数据错误和hibernate几个问题

程序员文章站 2024-02-11 16:45:22
...

我在解决该反常的方式是:1.依据提醒肯定展现问题的数据类别.(过滤无须要的检验,削减耗费在该问题上的工夫淘宝商城:。看懂反常是

org.hibernate.type.NullableType nullSafeGet could not read column value from result set: CONTRIB23_35_; 无法转换为内部表示

我在解决该反常的方式是:
1.依据提醒肯定展现问题的数据类别.(过滤无须要的检验,削减耗费在该问题上的工夫淘宝商城:。看懂反常是主要问题).
2.核查数据库字段类别与POJO类的字段数据类别是否相称.
3.检验数据库字段内的value.
如:你的数据库字段类别为number那么在手动照射POJO时也许你会把它写成int类别这么本身是不曾错的(在你数据库内的值不曾超出 int的长度前).然而由于数据库的字段类别为number那么在测验时或许你会手动插入一些值.而值的长度超出int所能接纳的长度。那么在过程运行时对该字段举行get时就会展现上面的差错。这是其一。

hibernate几个问题

Excel单元格中的回车/换行 Alt+Enter

2008-2-2 9:45:13 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: Unknown column 'tjsaleresu0_.isupdate' in 'field list'
2008-2-2 9:45:13 org.hibernate.event.def.DefaultLoadEventListener onLoad
信息: Error performing load command
org.hibernate.exception.SQLGrammarException: could not load an entity: [ookj.domain.TjSaleResult#293]


--数据库中没有“isupdate”字段

2008-2-2 9:51:42 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 1052, SQLState: 23000
2008-2-2 9:51:42 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: Column 'df' in where clause is ambiguous

————find("select tsr from TjSaleResult tsr, TjItemResult tir where tsr=tir.saleResultId and tir=? and df1", new Object[]{tir});
————语句中的df不能确定是哪个表的

org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: trackDate of: ookj.domain.TjReagentTrack [from ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=? and trt.df1]; nested exception is org.hibernate.QueryException: could not resolve property: trackDate of: ookj.domain.TjReagentTrack [from ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=? and trt.df1]
Caused by: org.hibernate.QueryException: could not resolve property: trackDate of: ookj.domain.TjReagentTrack [from ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=? and trt.df1]


————问题是配置中:
private static String[][] properties={
{"getReagentTrackId","reagent_trackid","0"},
{"getReagentId","reagentid","1"},
{"getUserId","userid","1"},
{"getGuideBookId","guidebookid","1"},
{"getTrackTime","tracktime","0"}, //这里名称不对
{"trackStage","trackstage","0"},
{"getDf","df","0"}
————还有nd trt.trackDate=? 语句中的值有误。


java.lang.ClassCastException: ookj.domain.OokjDateTime

————基本的 类型转换错误

String sql = "from TjReagentTrack trt where trt.trackStage=? and trt.trackTime like ? and trt.userId=? and trt.df1";
List list_reagenttrack = srs.find(sql, new Object[]{TjReagentTrack.TRACKSTAGE_QU, "%"+new OokjDate(new Date()).toString()+"%", su});


ApplicationInstance.getActive().setFocusedComponent(textField_Register);

————Echo2焦点问题


org.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the transient instance before flushing: ookj.domain.SmDept; nested exception is org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: ookj.domain.SmDept
Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: ookj.domain.SmDept

————new了一个新对象,在未保存之前将它保存进了一个新new的对象。

问题1,quartz 1.6 配置问题。需要使用common-collection-1.3.jar

信息: could not read column value from result set: activep19_59_; could not deserialize
Exception in thread "main" org.springframework.orm.hibernate3.HibernateSystemException: could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize
Caused by: org.hibernate.type.SerializationException: could not deserialize
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:217)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240)
at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82)
at org.hibernate.type.SerializableType.get(SerializableType.java:39)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2096)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
at org.hibernate.loader.Loader.getRow(Loader.java:1206)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
at org.hibernate.loader.Loader.doQuery(Loader.java:701)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:849)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840)
at ookj.dao.pub.impl.CommonDaoImpl.find(CommonDaoImpl.java:96)
at ookj.service.impl.BasicServiceImpl.find(BasicServiceImpl.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy1.find(Unknown Source)
at ookj.ui.barcode.BarCodePerson.returnBookFromCode(BarCodePerson.java:63)
at ookj.ui.barcode.BarCodePerson.getFengMian(BarCodePerson.java:44)
at ookj.ui.barcode.BarCodePerson.main(BarCodePerson.java:28)
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.(Unknown Source)
at org.hibernate.util.SerializationHelper$CustomObjectInputStream.(SerializationHelper.java:252)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:209)
... 40 more

++++++++++
============
org.hibernate.type.SerializationException could not deserialize;

我用的数据库是mysql,,在通过pojo类自动生成的类中,未为字段指定type,hibernate对自动为其指定,如果它所生成的type不能被反序列化,就会抛出java.util.ServilizableException

比如我产生异常的原因是我建立了一个string[]类型的字段,但在对应的.hbm.xml文件中我没有显式定义它的类型,hibernate自动为其指定了类型,该类型不能被反序列化。


2008-1-29 14:06:31 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: Invalid value for getInt() - '2008-01-18 12:12:12' in column 24
2008-1-29 14:06:32 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2008-1-29 14:06:32 org.springframework.jdbc.support.SQLErrorCodesFactory
信息: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]

+++++++++
=======


Expected positional parameter count: 1, actual parameters: [] [select m from TjMedicalName m, TjSaleResult s where s.guideBookId = ? and s.df1 and s.saleItemId.medicalGroup.medicalId=m.medicalId]


++++bs.find("select m from TjMedicalName m, TjSaleResult s where s.guideBookId = ? and s.df1 and s.saleItemId.medicalGroup.medicalId=m.medicalId");+++
====bs.find("select m from TjMedicalName m, TjSaleResult s where s.guideBookId = ? and s.df1 and s.saleItemId.medicalGroup.medicalId=m.medicalId", new Object[]{sgb});===


严重: line 1:143: expecting IDENT, found '.'
2008-2-3 0:41:01 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet tijianServlet threw exception
org.springframework.orm.hibernate3.HibernateQueryException: expecting IDENT, found '.' near line 1, column 143 [select t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and t.saleItemId.medicalGroup.block=? and t.saleItemId..medicalGroup.df1]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '.' near line 1, column 143 [select t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and t.saleItemId.medicalGroup.block=? and t.saleItemId..medicalGroup.df1]
Caused by: org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '.' near line 1, column 143 [select t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and t.saleItemId.medicalGroup.block=? and t.saleItemId..medicalGroup.df1]

_____多了一个点

java.net.SocketException: java.net.ConnectException: Connection refused: connect


————数据库未启动


严重: Servlet.service() for servlet tijianServlet threw exception
java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based!


————忘了怎么解决的了,反正不是大问题。

严重: Servlet.service() for servlet tijianServlet threw exception
java.lang.NoSuchMethodError: ookj.service.SendReagentService.saveTjSendReagent(Lookj/domain/TjReagent;Lookj/domain/SaleGuideBook;)[Ljava/lang/String;

————Tomcat\Java虚拟集中代码未跟上,不能保持同步,重启虚拟机就好了。

严重: Unknown column 'tjsendreag0_.tj_sendreagent' in 'field list'
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'tjsendreag0_.tj_sendreagent' in 'field list'


————配置文件hbr.xml中写的tj_sendreagent字段,在数据库中找不到。

1,TextField控件textField_Maker.setEnabled(false);为禁用true为可用。

2,
GroupBox groupBox_GeRenJiHuo = new GroupBox();
groupBox_GeRenJiHuo.setWidth(new Extent(300, Extent.PX));
groupBox_GeRenJiHuo.setTitle("个人预约激活");
RowLayoutData groupBox_GeRenJiHuoLayoutData = new RowLayoutData();
groupBox_GeRenJiHuoLayoutData.setInsets(new Insets(new Extent(20,
Extent.PX)));
groupBox_GeRenJiHuo.setLayoutData(groupBox_GeRenJiHuoLayoutData);
row_JiHuo.add(groupBox_GeRenJiHuo);
GroupBox groupBox_TuanDuiJiHuo = new GroupBox();
groupBox_TuanDuiJiHuo.setWidth(new Extent(300, Extent.PX));
groupBox_TuanDuiJiHuo.setTitle("团队预约激活");
groupBox_TuanDuiJiHuo.setInsets(new Insets(new Extent(20, Extent.PX)));
row_JiHuo.add(groupBox_TuanDuiJiHuo);


第二个是内部20的间隙。第一个没表现。

Oracle读取数据错误和hibernate几个问题