//第一种直接执行sql
Java.lang.StringBuffer Sql = new java.lang.StringBuffer ( ) ;
Sql.append ( “select CFPURCHASESTATUS bb from CT_OFS_OfficeSuppliesEntry where FPARENTID=’”+billid+”’ and CFPURCHASESTATUS>5”) ;
java . sql . Connection con = com . kingdee . bos . framework . ejb . EJBFactory . getConnection ( __bosContext ) ;
java . sql . Statement st = con . createStatement ( ) ;
java . sql . ResultSet rs = st . executeQuery ( Sql . toString ( ) ) ;
if(rs . next ( ) ){
.....
}else{
.....
}
rs.close();
st.close();
con.close();
//第二种调用自己写的后台方法,方法里必须要带__bosContext(工作流自带的上下文参数)参数才能操作数据库
purchaseAgent=com . kingdee . eas . hans. util . KGCommAppUtil . getOffSuppliesPurchaseAgeByPid(__bosContext , billid).getId();
cg = com . kingdee . eas . hans. util . KGCommAppUtil . getEmpByPersonId ( __bosContext , purchaseAgent);