WDbairen
WDbairen
2017-03-07 00:43

myeclipse 加载数据库图片

2
  • mysql

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条回答