Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 求助sql语句
letmesee





发贴: 3
积分: 0
于 2006-04-23 22:59 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我的问题是想通过字符串匹配达到关键字查询的目的

在access中调试得到
正确查询语句为 select * from aaa where bbb like "*ccc*"

但是我改成 select * from aaa where b like '*ccc*' 放入""之间调试无任何
返回记录
public ResultSet getResult(String query) throws SQLException,
  SystemException {
  Connection con;
  con = DatabaseConnect.getConnection();
  Statement stmt = con.createStatement();
  ResultSet rs = stmt.executeQuery(query);
  return rs;
}

这是我获取记录的函数,如果不考虑其他方法的话,请问这条查询语句该怎么写呢




话题树型展开
人气 标题 作者 字数 发贴时间
10041 求助sql语句 letmesee 444 2006-04-23 22:59
7619 Re:求助sql语句 why 145 2006-04-24 00:58
7732 Re:求助sql语句 letmesee 8 2006-04-24 15:47
8582 Re:求助sql语句 why 191 2006-04-24 20:21

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923