ScheduleBean.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:2k
源码类别:
Java编程
开发平台:
Java
- package slsbsample;
- import javax.ejb.*;
- import java.util.*;
- public class ScheduleBean implements SessionBean {
- SessionContext sessionContext;
- public void ejbCreate() throws CreateException {
- /**@todo Complete this method*/
- }
- public void ejbRemove() {
- /**@todo Complete this method*/
- }
- public void ejbActivate() {
- /**@todo Complete this method*/
- }
- public void ejbPassivate() {
- /**@todo Complete this method*/
- }
- public void setSessionContext(SessionContext sessionContext) {
- this.sessionContext = sessionContext;
- }
- public java.util.Vector searchByCourseTitle(String title)throws ScheduleDAOException {
- Vector schedList = new Vector(20);
- System.out.println(" *** In ScheduleEJB -- searchByCourseTitle ");
- try {
- ScheduleDAO scheduleDAO = new ScheduleDAO();
- schedList = (Vector) scheduleDAO.searchByCourseTitle(title);
- System.out.println(" *** In ScheduleEJB- after calling scheduleDAO ");
- }
- catch (ScheduleDAOException se) {
- throw new ScheduleDAOException("SearchByCourseTitle exception =" +se.getMessage());
- }
- System.out.println("ScheduleEJB -- searchByCourseTitle returning Vector ");
- return schedList;
- }
- public slsbsample.ScheduleVO searchByScheduleID(String id) throws ScheduleDAOException {
- System.out.println("In ScheduleEJB -- searchByScheduleID ");
- ScheduleVO schedule = null;
- try {
- ScheduleDAO scheduleDAO = new ScheduleDAO();
- System.out.println(" *** In ScheduleEJB - after calling scheduleDAO ");
- schedule = (ScheduleVO) scheduleDAO.searchByScheduleID(id);
- System.out.println("In ScheduleEJB - got schedule ");
- if (schedule == null)
- System.out.println(" ScheduleEJB -- schedule is null!");
- }
- catch (ScheduleDAOException se) {
- throw new ScheduleDAOException(" *** SearchByCourseID exception =" +
- se.getMessage());
- }
- System.out.println(" *** ScheduleEJB -- searchByCourseID returning schedule ");
- return schedule;
- }
- }