schedulebean.java

来自「100多M的J2EE培训内容」· Java 代码 · 共 55 行

JAVA
55
字号
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;
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?