String sql = "select * from category where grade = 2 and 3";grade有三级,我想把2,3级的数据全部输出来,可是为什么只能输出2级的,3的出不来
-------------------------------------------------------------------------
public List<Category> getChilds(){
List<Category>categories = new ArrayList<Category>();
Connection conn=DB.getConn();
Statement stmt = DB.getStatement(conn);
String sql = "select * from category where grade = 2 and 3";
ResultSet rs = DB.getResultSet(stmt, sql);
try{
while(rs.next()){
Category c = this.getCategoryFromRs(rs);
categories.add(c);
}
}catch(SQLException e){
e.printStackTrace();
}finally{
DB.close(conn);
DB.close(stmt);
DB.close(rs);
}
return categories;
}
-----------------------------
<%
for(int i=0;i<childs.size();i++){
Category c = childs.get(i);
%>
<a href=""><%=c.getName()%></a>
<%

%>