www.pudn.com > shop.rar > QueryAllDTO.java
package com.soft136.shop.model;
import java.sql.SQLException;
import java.util.ArrayList;
import oracle.jdbc.rowset.OracleCachedRowSet;
import com.soft136.shop.DAO.LookOrderDetailDao;
import com.soft136.shop.DAO.QueryAllDao;
import com.soft136.shop.DAO.QueryFirstStatusDao;
import com.soft136.shop.DAO.QuerySecondStatusDao;
import com.soft136.shop.DAO.QueryThirdStatusDao;
public class QueryAllDTO {
public ArrayList queryAll() throws SQLException, ClassNotFoundException{
OracleCachedRowSet crs=new QueryAllDao().queryAll();
if(crs!=null){
ArrayList list = new ArrayList();
while (crs.next()) {
list.add(new OrdersBean(crs.getString(1),crs.getString(2),crs.getInt(3),crs.getString(4),crs.getString(5),crs.getFloat(6),crs.getString(7),crs.getInt(8)));
}
return list;
}
return null;
}
public ArrayList queryFirst() throws SQLException, ClassNotFoundException{
OracleCachedRowSet crs=new QueryFirstStatusDao().queryFirst();
if(crs!=null){
ArrayList list = new ArrayList();
while (crs.next()) {
list.add(new OrdersBean(crs.getString(1),crs.getString(2),crs.getInt(3),crs.getString(4),crs.getString(5),crs.getFloat(6),crs.getString(7),crs.getInt(8)));
}
return list;
}
return null;
}
public ArrayList querySecond() throws SQLException, ClassNotFoundException{
OracleCachedRowSet crs=new QuerySecondStatusDao().querySecond();
if(crs!=null){
ArrayList list = new ArrayList();
while (crs.next()) {
list.add(new OrdersBean(crs.getString(1),crs.getString(2),crs.getInt(3),crs.getString(4),crs.getString(5),crs.getFloat(6),crs.getString(7),crs.getInt(8)));
}
return list;
}
return null;
}
public ArrayList queryThird() throws SQLException, ClassNotFoundException{
OracleCachedRowSet crs=new QueryThirdStatusDao().queryThird();
if(crs!=null){
ArrayList list = new ArrayList();
while (crs.next()) {
list.add(new OrdersBean(crs.getString(1),crs.getString(2),crs.getInt(3),crs.getString(4),crs.getString(5),crs.getFloat(6),crs.getString(7),crs.getInt(8)));
}
return list;
}
return null;
}
public ArrayList lookDetail(String orderid) throws SQLException, ClassNotFoundException{
OracleCachedRowSet crs=new LookOrderDetailDao().lookDetail(orderid);
if(crs!=null){
ArrayList list = new ArrayList();
while (crs.next()) {
list.add(new Order_detailBean(crs.getString(1),crs.getInt(2),crs.getString(3),crs.getDouble(4),crs.getInt(5)));
}
return list;
}
return null;
}
}