,infromix数据库用hibernate无法获得list值,超级诡异。
发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
求救求救,infromix数据库用hibernate无法获得list值,超级诡异。。。
这个问题郁闷三天了
问题就是hibernate不能查询到我要的数据,但是直接在数据库执行sql时可以查到,有没有童鞋遇到过,求救。。。
数据表结构如下:
create table a
(
streamnumber serial not null ,
number1 char(16),
content char(140),
primary key (streamnumber)
);
create index idx_a_1 on a
(content) using btree in table ;
数据库版本:
IBM Informix Dynamic Server Version 10.00.FC7 IDS10
sql语句:
select a.streamnumber , a.number1 , a.content from a where a.number1='13812345678' and a.content='2010122302164447';
(该sql语句其实就是hibernate的实际sql,拿到数据库执行没问题的)
hibernate方法:其中number1="13812345678" content为2010122302164447
public A getContent(String content,String number1) {
List<A> list = getHibernateTemplate().find(
"from A as item where item.number1=? and item.content=?",
new Object[] {number1,content});
logger.info("list size="+list.size());
logger.info(list.toString());
if(list==null ||list.size() <= 0 ){
return null;
}
else{
return list.get(0);
}
}
最后,hibernate中的log日志打印如下:
list size=0
[]
------解决方案--------------------
hibernate没用过。
运作sql时应该有个session和informix连接,问问DBA你的在运作SQL,看看对不对。
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
asp 连接informix出错
asp 连接informix出错。odbc test connection成功。
出错提示:
“Microsoft OLE DB Provider for ODBC...
-
如何提高查询效率
表架构:
主表+明细表,明细数据按月存储,即:
主表:wamia 明细:wamia201001 wamia201002 ……
目标:
1、...
-
询问下informix的价格
想问下关于windows下informix choice版11.5和11.7的价格大概是多少啊?按CPU算的
------解决方案----------...
-
informix与db2
informix与db2,应该学哪个?
------解决方案--------------------
那要看你工作的需要了。
以及以后客户的需要...
-
sqexplain.out 如何分析?
SQL code
Table map :
----------------------------
Internal name Table name
---------...
-
informix建表
有个时间想取系统当前时间 怎么设啊?
SQL code
create table s (
start time --想要是系统当前时间,怎么设置?
)
---...
-
informix -271错误
1、谁有 informix 授权号啊,能不能帮忙送一个啊??先借我用一下啊!!邮箱是:lymusic2007@126.com
万分感激!!!
或者请...
-
急!急!在线等答案,送分,关于Informix SQL 字符转ASCII码
各位高手,在Informix数据库中,怎样把char字符获取它的ASCII码值?看起来好像很简...
-
请教informix存储过程调用远端数据库方法
我现在想实现从另一台机器上的informix数据库的表中取数,插入到本地的表中,
数据量大概...
-
informix 存储过程中数据类型问题,急。。。。
目的想实现的是从数据库中把数据取出来放到一个单元格中查出来,每条记录用","格开。
...