package ppp.uc002;
import java.sql.Connection;
import java.util.List;
import ppp.common.ConnectionManager;
import ppp.dao.CustomerSelectDAO;
import ppp.exception.AppRuntimeException;
import ppp.exception.AppSQLException;
import ppp.vo.CustomerVO;
public class LoginService {
boolean servicePerform
(String customerId,
String password
) throws AppRuntimeException
{ Object[] params
= {customerId, password
}; List<CustomerVO> list = null;
ConnectionManager cm = new ConnectionManager();
try {
conn = cm.getConnection();
CustomerSelectDAO dao = new CustomerSelectDAO(conn);
list = dao.select(params);
} catch (AppSQLException e) {
throw new AppRuntimeException("ItemVOリストの取得に失敗しました", e);
} finally {
cm.closeConnection();
}
if (list != null) {
for (CustomerVO customer : list) {
System.
out.
println(customer.
toString()); }
}
if (list.size() > 0) {
return true;
} else {
return false;
}
}
public static void main
(String[] args
) { LoginService service = new LoginService();
service.servicePerform("000001", "a1a1a1a1");
}
}
最終更新:2013年06月08日 15:44