WDbairen 2017-03-07 00:43 采纳率: 0%
浏览 977
已结题

myeclipse 加载数据库图片

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show order by show_id' at line 1
public class ShowDao{
public List findAll3 () throws Exception{
List showList=new ArrayList();
Connection conn =JDBC.getConnection();
String sql="select * from show order by show_id";

  PreparedStatement pstat=conn.prepareStatement(sql);
  ResultSet rs =pstat.executeQuery();
    while(rs.next()){
    Show show=new Show();
    show.setShow_id(rs.getInt("show_id"));
    show.setShow_image(rs.getString("show_image"));
    showList.add(show);
    }
    return showList;

}
}

  • 写回答

3条回答 默认 最新

  • qq_37792177 2017-03-07 02:05
    关注

    JDBC六个步骤,你只用了5个。最后别忘了释放资源

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器