资源简介

osworkflow请假实例,使用tomcat6.0服务器,oracle数据库,导入到myeclipse中即可运行,当然需要先创建数据库。很适合osworkflow的学习

资源截图

代码片段和文件信息

package com.qiny.dao;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;

import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.DataSource;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.qiny.leave.LeaveApply;
import com.qiny.leave.LeaveApprove;

public class LeaveDAO {

  protected static DataSource ds = null;

  public LeaveDAO() {
    if (ds == null) {
      try {
        InitialContext ic = new InitialContext();
        ds = (DataSource) ic.lookup(“java:comp/env/jdbc/DefaultDS“);
        System.out.println(“<><><><><>“+ds);
      } catch (NamingException ne) {
        throw new RuntimeException(“NamingException while looking“);
      }
    }
  }

  public void addLeaveApply(LeaveApply leaveApply) {
    try {
      String exeSql = ““
          + “ INSERT INTO bus_leaveApply (applyIDapplicantreasonapplyTimedayCountwfid)“
          + “ VALUES (seq_bus_leaveApply.nextVal‘“+ leaveApply.getApplicant() + “‘‘“ + leaveApply.getReason()
          + “ ‘‘“+new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss“).format(new Date()).toString()+“‘‘“ + leaveApply.getDayCount()
          + “ ‘“ + leaveApply.getWfid() + “)“;
      Connection connection = ds.getConnection();
      Statement statement = connection.createStatement();
      statement.execute(exeSql);
      statement.close();
      connection.close();
    } catch (SQLException ex) {
      throw new RuntimeException(“DAO addLeaveApply failed!\n“ + ex.getMessage());
    }
  }

  public void addLeaveApprove(LeaveApprove leaveApproval) {
    try {
      String exeSql = ““
          + “ INSERT INTO bus_leaveApprove (approveIDapplyIDapproverapproveTimeopinion)“
          + “ VALUES (seq_bus_leaveApprove.nextVal‘“ + leaveApproval.getApplyID() + “‘‘“ + leaveApproval.getApprover()
          + “ ‘‘“+new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss“).format(new Date()).toString()+“‘“ + leaveApproval.getOpinion() + “)“;
      Connection connection = ds.getConnection();
      Statement statement = connection.createStatement();
      statement.execute(exeSql);
      statement.close();
      connection.close();
    } catch (SQLException ex) {
      throw new RuntimeException(“DAO addLeaveApprove failed!\n“ + ex.getMessage());
    }
  }

  public LeaveApply getLeaveApply(long wfid) {
    LeaveApply leaveApply = new LeaveApply();
    try {
      String querySql = ““
          + “ SELECT applyIDapplicantreasonapplyTimedayCountwfid “
          + “ FROM bus_leaveApply WHERE wfid=“ + wfid;
      Connection connection = ds.getConnection();
      Statement statement = connection.createStatement();
      ResultSet rs = statement.executeQuery(querySql);
      if (rs.next()) {
        leaveApply.setApplyID(rs.getInt(“applyID“));
        leaveApply.setApplicant(rs.getString(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-11-28 21:20  os_leave\
     文件        1391  2012-11-30 12:35  os_leave\.classpath
     目录           0  2012-12-04 14:24  os_leave\.myeclipse\
     文件         297  2012-11-28 14:26  os_leave\.mymetadata
     文件        1226  2012-11-28 14:26  os_leave\.project
     目录           0  2012-12-04 14:24  os_leave\.settings\
     目录           0  2012-11-28 14:26  os_leave\WebRoot\
     目录           0  2012-11-29 09:46  os_leave\WebRoot\meta-INF\
     文件          39  2012-11-28 14:26  os_leave\WebRoot\meta-INF\MANIFEST.MF
     文件         388  2012-11-30 09:15  os_leave\WebRoot\meta-INF\context.xml
     目录           0  2012-11-28 14:26  os_leave\WebRoot\WEB-INF\
     目录           0  2012-11-30 14:10  os_leave\WebRoot\WEB-INF\classes\
     目录           0  2012-11-30 10:16  os_leave\WebRoot\WEB-INF\classes\com\
     目录           0  2012-11-30 10:16  os_leave\WebRoot\WEB-INF\classes\com\qiny\
     目录           0  2012-11-30 10:16  os_leave\WebRoot\WEB-INF\classes\com\qiny\dao\
     文件        5426  2012-11-30 13:39  os_leave\WebRoot\WEB-INF\classes\com\qiny\dao\LeaveDAO.class
     目录           0  2012-11-30 10:16  os_leave\WebRoot\WEB-INF\classes\com\qiny\leave\
     文件        2192  2012-11-30 10:16  os_leave\WebRoot\WEB-INF\classes\com\qiny\leave\ApplyFunction.class
     文件        2157  2012-11-30 10:16  os_leave\WebRoot\WEB-INF\classes\com\qiny\leave\ApproveFunction.class
     文件        1705  2012-11-30 10:16  os_leave\WebRoot\WEB-INF\classes\com\qiny\leave\LeaveApply.class
     文件        1473  2012-11-30 10:16  os_leave\WebRoot\WEB-INF\classes\com\qiny\leave\LeaveApprove.class
     文件        5102  2012-11-30 14:10  os_leave\WebRoot\WEB-INF\classes\leave_apply.xml
     文件         217  2005-11-17 20:24  os_leave\WebRoot\WEB-INF\classes\log4j.properties
     文件        2200  2012-11-29 09:44  os_leave\WebRoot\WEB-INF\classes\osuser.xml
     文件        1606  2012-11-28 19:48  os_leave\WebRoot\WEB-INF\classes\osworkflow.xml
     文件         724  2012-11-29 09:45  os_leave\WebRoot\WEB-INF\classes\propertyset.xml
     文件         103  2007-07-11 16:00  os_leave\WebRoot\WEB-INF\classes\workflows.xml
     目录           0  2012-12-04 14:24  os_leave\WebRoot\WEB-INF\lib\
     文件         379  2012-11-28 14:26  os_leave\WebRoot\WEB-INF\web.xml
     文件         812  2012-11-29 11:07  os_leave\WebRoot\default.jsp
     文件        1301  2012-11-29 14:14  os_leave\WebRoot\leaveApply.jsp
............此处省略41个文件信息

评论

共有 条评论