guhe10 2009-12-03 10:41
浏览 242
已采纳

sql 语句

Hibernate:
select
tbgroups0_.id as id5_,
tbgroups0_.name as name5_,
tbgroups0_.description as descript3_5_,
tbgroups0_.status as status5_,
tbgroups0_.note as note5_,
tbgroups0_.group_ou as group6_5_
from
odss.tb_groups tbgroups0_
where
(
tbgroups0_.name=3453dd192
)
order by
tbgroups0_.id desc
[WARN,JDBCExceptionReporter,http-8080-4] SQL Error: 1054, SQLState: 42S22
[ERROR,JDBCExceptionReporter,http-8080-4] Unknown column '3453dd192' in 'where clause'
2009-12-3 10:22:56 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet dispatherContext threw exception
java.sql.SQLException: Unknown column '3453dd192' in 'where clause'

很郁闷 比如 name属性值全 数字能 查到 一换带 字母的 就不行 莫名奇妙了 。。。。。
sql 语句 是直接用 string拼起来的 没用占位符 有关系吗?
帮忙看看 谢谢
[b]问题补充:[/b]
Hibernate:
select
tbgroups0_.id as id5_,
tbgroups0_.name as name5_,
tbgroups0_.description as descript3_5_,
tbgroups0_.status as status5_,
tbgroups0_.note as note5_,
tbgroups0_.group_ou as group6_5_
from
odss.tb_groups tbgroups0_
where
(
tbgroups0_.name=197
)
order by
tbgroups0_.id desc

解析的这条是没错的 不是粗心啊 您再看看 就 值 197 数字改了一下 带了字母 查不到没什么 报错就不对了啊 谢谢 各位帮忙看看

  • 写回答

4条回答 默认 最新

  • CaiHuajiang 2009-12-03 10:50
    关注

    tbgroups0_.name='3453dd192',粗心

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?