目录
本节目录收起
  • 示例
  • 参考DEMO
  • 场景示例

    示例

    import java.sql.Connection;

    import java.sql.Statement;

    import com.runqian.report4.usermodel.input.AbstractInputSaver;

    public class InputSaverDemo extends AbstractInputSaver {

             /**
              * arg0:参数数组,系统根据用户在更新属性中的设置,将所需要的参数以数组的方式传送过来
              */

             public void save(Object[] arg0) throws Exception {

                      Connection con = null;

                       Statement stmt = null;

                       try {

                                // 获取缺省数据库连接

                                con = context.getConnectionFactory(context.getDefDataSourceName()).getConnection();

                                stmt = con.createStatement();

                                // 更新雇员表中的数据

                                String sql = "update  demo_employee set 姓氏 = '" + arg0[1].toString()+ "',名字 = '" + arg0[2].toString() + "' WHERE 雇员id ="+ arg0[0].toString();

                                stmt.executeUpdate(sql);

                       } finally {

                                try {

                                         if (stmt != null)

                                                   stmt.close();

                                         if (con != null)

                                                   con.close();

                                } catch (Exception e) {

                                }

                       }

             }

    }

    参考DEMO

    \客户化示例\3报表运算客户化\填报更新类