自动生成form Scripts

运行脚本:

begin
            xxx_plsql_generator_pkg2.form_view_iud_p(p_block_name  =>‘CONTRACT_T‘
                                                   ,p_table_name  =>‘WPC_Contract_T‘
                                                   ,p_owner       =>‘apps‘
                                                   ,p_primary_key =>‘FConId‘);
end;

select *
        from all_tab_columns tc
       where tc.table_name = upper(‘cux_dis_return_ifc‘)
         and tc.owner = upper(‘apps‘)
         and tc.column_name = upper(‘FConId‘);

执行脚本

调用的pckage:

create or replace package xxx_plsql_generator_pkg is
  /*==================================================
    Copyright (C) LYR Consulting Co., Ltd
    All rights reserved
  ===================================================*/
  -- Author  : luoyuren
  -- Created : 2010-12-07
  -- Purpose : Auto Generat Plsql Code
  g_exception exception;

  /******************************************************************

  IN
     p_block_name  Form中数据块的名称
     p_table_name  需要进行操作的数据表
     p_owner       数据表的owner
     p_primary_key 数据表的主键

  DESCEIPTOIN
     此过程主要用来生成基于视图的数据块常用触发器ON-INSERT,
     ON-UPDATE,ON-DELETE,ON-LOCK之代码,使用时采用PL/SQL Developer
     开发工具的的Test Windows,代码执行完成后会在DBMS Output标签页
     中输出相关代码,使用时将代码Copy至Oralce Form Builder的Program
     Units中,分为Package Spec和Package Body,并在相应触发器中加入相
     应引用代码;

  ***************************************************************/
  procedure form_view_iud_p(p_block_name  in varchar2
                           ,p_table_name  in varchar2
                           ,p_owner       in varchar2
                           ,p_primary_key in varchar2);

end xxx_plsql_generator_pkg;
/
create or replace package body xxx_plsql_generator_pkg is
  /*==================================================
    Copyright (C) LYR Consulting Co., Ltd
    All rights reserved
  ===================================================*/
  g_output_first boolean := false;
  g_cp_flag      number; -- conc program
  g_newline      varchar2(1) := chr(10);

  type column_rec_type is record(
    column_name varchar2(30),
    nullable    varchar2(1));

  type column_tbl_type is table of column_rec_type index by binary_integer;

  procedure output_msg(p_msg_data in varchar2) is
  begin
    if g_output_first = false
    then
      g_cp_flag := fnd_profile.value(‘CONC_REQUEST_ID‘);
      if g_cp_flag > 0
      then
        null;
      else
        dbms_output.enable(buffer_size => 20000000);
      end if;
    end if;

    if (g_cp_flag > 0)
    then
      fnd_file.put_line(fnd_file.log
                       ,p_msg_data);
    else
      dbms_output.put_line(p_msg_data);
    end if;
  exception
    when others then
      null;
  end output_msg;

  procedure form_view_iud_p(p_block_name  in varchar2
                           ,p_table_name  in varchar2
                           ,p_owner       in varchar2
                           ,p_primary_key in varchar2) is
    cursor c_table is
      select ‘Y‘
        from all_tables t
       where t.table_name = upper(p_table_name)
         and t.owner = upper(p_owner);

    cursor c_tabcol is
      select ‘Y‘
        from all_tab_columns tc
       where tc.table_name = upper(p_table_name)
         and tc.owner = upper(p_owner)
         and tc.column_name = upper(p_primary_key);

    cursor c_sequence is
      select ‘Y‘
        from all_objects ao
       where ao.owner = p_owner
         and ao.object_type = ‘SEQUENCE‘
         and ao.object_name = upper(p_table_name) || ‘_S‘;

    cursor c_columns is
      select tc.column_name
            ,tc.nullable
        from all_tab_columns tc
       where tc.table_name = upper(p_table_name)
         and tc.owner = upper(p_owner)
       order by tc.column_id;

    l_dummy          varchar2(1);
    l_msg_data       varchar2(4000);
    l_package_name   varchar2(100);
    l_block_name_ext varchar2(50) := ‘:‘ || upper(p_block_name) || ‘.‘;
    l_rec_ext        varchar2(30) := ‘rec.‘;

    l_column_tbl   column_tbl_type;
    l_column_count number := 0;

  begin

    if (p_block_name is null) or
       (p_table_name is null) or
       (p_owner is null) or
       (p_primary_key is null)
    then
      l_msg_data := ‘Parameter not allow null !‘;
      raise fnd_api.g_exc_error;
    end if;

    -- check table exists
    open c_table;
    fetch c_table
      into l_dummy;
    if c_table%notfound
    then
      close c_table;
      l_msg_data := ‘Table ‘ || upper(p_table_name) || ‘ not found !‘;
      raise fnd_api.g_exc_error;
    end if;
    close c_table;

    --check primary_key exists
    open c_tabcol;
    fetch c_tabcol
      into l_dummy;
    if c_tabcol%notfound
    then
      close c_tabcol;
      l_msg_data := ‘Table ‘ || upper(p_table_name) ||
                    ‘ not exists column ‘ || upper(p_primary_key) || ‘ !‘;
      raise fnd_api.g_exc_error;
    end if;
    close c_tabcol;

    --check sequence exists
    /*Open c_sequence;
    Fetch c_sequence
      Into l_dummy;
    If c_sequence%Notfound Then
      Close c_sequence;
      l_msg_data := ‘Sequence ‘ || upper(p_block_name) || ‘_S not exists !‘;
      Raise fnd_api.g_exc_error;
    End If;
    Close c_sequence;*/

    -- get columns
    for r in c_columns
    loop
      l_column_count := l_column_count + 1;
      l_column_tbl(l_column_count).column_name := r.column_name;
      l_column_tbl(l_column_count).nullable := r.nullable;
    end loop;

    if l_column_count < 1
    then
      l_msg_data := ‘Not column in table ‘ || p_table_name;
      raise fnd_api.g_exc_error;
    end if;

    l_package_name := upper(p_block_name) || ‘_PKG‘;
    -- generate package special
    l_msg_data := ‘PACKAGE ‘ || l_package_name || ‘ IS‘ || g_newline ||
                  g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘/*===============================================================‘ ||
                  g_newline ||
                  ‘*   Copyright (C) LYR Consulting Co., Ltd All rights reserved‘ ||
                  g_newline ||
                  ‘* ===============================================================‘ ||
                  g_newline || ‘*    Program Name:‘ || l_package_name;

    output_msg(l_msg_data);

    l_msg_data := ‘*    Author      :‘ || g_newline || ‘*    Date        :‘ ||
                  g_newline || ‘*    Purpose     :‘ || g_newline ||
                  ‘*    Parameters  :‘ || g_newline ||
                  ‘*    Update History‘ || g_newline ||
                  ‘*    Version    Date         Name            Description‘ ||
                  g_newline ||
                  ‘*    --------  ----------  ---------------  --------------------‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*     V1.0                                   Creation    ‘ ||
                  g_newline || ‘*‘ || g_newline ||
                  ‘  ===============================================================*/‘ ||
                  g_newline;

    output_msg(l_msg_data);

    l_msg_data := ‘  PROCEDURE insert_row;‘ || g_newline ||
                  ‘  PROCEDURE lock_row;‘ || g_newline ||
                  ‘  PROCEDURE update_row;‘ || g_newline ||
                  ‘  PROCEDURE delete_row;‘ || g_newline || g_newline ||
                  ‘END ‘ || l_package_name || ‘;‘ || g_newline;

    output_msg(l_msg_data);

    -- generate package body
    -- begin
    l_msg_data := ‘PACKAGE BODY ‘ || l_package_name || ‘ IS‘ || g_newline;
    output_msg(l_msg_data);

    -- insert row

    /*
    l_msg_data := ‘\*=====================================‘ || g_newline || ‘** PROCEDURE:  insert_row()‘ || g_newline ||
                  ‘**=====================================*\‘ || g_newline || ‘PROCEDURE insert_row IS‘ || g_newline;
                  */

    l_msg_data := ‘/*===============================================================‘ ||
                  g_newline || ‘*    Program Name:insert_row()‘ ||
                  g_newline || ‘*    Author      :‘ || g_newline ||
                  ‘*    Date        :‘ || g_newline || ‘*    Purpose     :‘ ||
                  g_newline || ‘*    Parameters  :‘ || g_newline ||
                  ‘*             In       X     --X的说明‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*             Out      Y     --Y的说明‘ || g_newline ||
                  ‘*    Update History‘ || g_newline ||
                  ‘*    Version    Date         Name            Description‘ ||
                  g_newline ||
                  ‘*    --------  ----------  ---------------  --------------------‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*     V1.0                                   Creation    ‘ ||
                  g_newline || ‘*‘ || g_newline ||
                  ‘  ===============================================================*/‘ ||
                  g_newline || ‘PROCEDURE insert_row IS‘;

    output_msg(l_msg_data);

    l_msg_data := ‘  CURSOR row_id‘ || g_newline || ‘  IS    SELECT ROWID‘ ||
                  g_newline || ‘       FROM ‘ || p_table_name || g_newline ||
                  ‘      WHERE ‘ || p_primary_key || ‘ = ‘ ||
                  l_block_name_ext || p_primary_key || ‘;‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘BEGIN‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  fnd_standard.set_who;‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  IF ‘ || l_block_name_ext || p_primary_key ||
                  ‘ IS NULL THEN‘ || g_newline || ‘    SELECT ‘ ||
                  upper(p_table_name) || ‘_S.NEXTVAL‘ || g_newline ||
                  ‘      INTO ‘ || l_block_name_ext || p_primary_key ||
                  g_newline || ‘      FROM SYS.DUAL;‘ || g_newline ||
                  ‘  END IF;‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  INSERT INTO ‘ || p_table_name || ‘ (‘;
    output_msg(l_msg_data);
    for i in 1 .. l_column_count
    loop
      if i = l_column_count
      then
        l_msg_data := ‘     ‘ || l_column_tbl(i).column_name || ‘)‘;
      else
        l_msg_data := ‘     ‘ || l_column_tbl(i).column_name || ‘,‘;
      end if;
      output_msg(l_msg_data);
    end loop;
    l_msg_data := ‘  VALUES (‘;
    output_msg(l_msg_data);
    for i in 1 .. l_column_count
    loop
      if i = l_column_count
      then
        l_msg_data := ‘     ‘ || l_block_name_ext || l_column_tbl(i)
                     .column_name || ‘);‘ || g_newline;
      else
        l_msg_data := ‘     ‘ || l_block_name_ext || l_column_tbl(i)
                     .column_name || ‘,‘;
      end if;
      output_msg(l_msg_data);
    end loop;

    l_msg_data := ‘  OPEN row_id;‘ || g_newline || ‘  FETCH row_id INTO ‘ ||
                  l_block_name_ext || ‘ROW_ID;‘ || g_newline ||
                  ‘  IF (row_id%NOTFOUND) THEN‘ || g_newline ||
                  ‘     CLOSE row_id;‘ || g_newline ||
                  ‘     RAISE NO_DATA_FOUND;‘ || g_newline || ‘  END IF;‘ ||
                  g_newline || ‘  CLOSE row_id;‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘END insert_row;‘ || g_newline;
    output_msg(l_msg_data);

    -- lock row

    --l_msg_data := ‘\*=====================================‘ || g_newline || ‘** PROCEDURE:  lock_row()‘ || g_newline ||
    --              ‘**=====================================*\‘ || g_newline || ‘PROCEDURE lock_row IS‘ || g_newline;

    l_msg_data := ‘/*===============================================================‘ ||
                  g_newline || ‘*    Program Name:lock_row()‘ || g_newline ||
                  ‘*    Author      :‘ || g_newline || ‘*    Date        :‘ ||
                  g_newline || ‘*    Purpose     :‘ || g_newline ||
                  ‘*    Parameters  :‘ || g_newline ||
                  ‘*             In       X     --X的说明‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*             Out      Y     --Y的说明‘ || g_newline ||
                  ‘*    Update History‘ || g_newline ||
                  ‘*    Version    Date         Name            Description‘ ||
                  g_newline ||
                  ‘*    --------  ----------  ---------------  --------------------‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*     V1.0                                   Creation    ‘ ||
                  g_newline || ‘*‘ || g_newline ||
                  ‘  ===============================================================*/‘ ||
                  g_newline || ‘PROCEDURE lock_row IS‘;

    output_msg(l_msg_data);

    l_msg_data := ‘  CURSOR c_row‘ || g_newline || ‘  IS SELECT *‘ ||
                  g_newline || ‘       FROM ‘ || p_table_name || g_newline ||
                  ‘      WHERE rowid = ‘ || l_block_name_ext || ‘ROW_ID‘ ||
                  g_newline || ‘      FOR UPDATE OF ‘ || p_primary_key ||
                  ‘ NOWAIT;‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  rec     c_row%rowtype;‘ || g_newline ||
                  ‘  i NUMBER := 0;‘ || g_newline || ‘BEGIN‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  LOOP‘ || g_newline || ‘    BEGIN‘;
    output_msg(l_msg_data);

    l_msg_data := ‘      i := i + 1;‘ || g_newline || ‘      OPEN c_row;‘ ||
                  g_newline || ‘      FETCH c_row INTO rec;‘;
    output_msg(l_msg_data);

    l_msg_data := ‘      IF (c_row%NOTFOUND) THEN‘ || g_newline ||
                  ‘        CLOSE c_row;‘ || g_newline ||
                  ‘        fnd_message.set_name(‘‘FND‘‘,‘‘FORM_RECORD_DELETED‘‘);‘ ||
                  g_newline || ‘        fnd_message.error;‘ || g_newline ||
                  ‘        RAISE FORM_TRIGGER_FAILURE;‘;
    output_msg(l_msg_data);

    l_msg_data := ‘      END IF;‘ || g_newline || ‘      CLOSE c_row;‘ ||
                  g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘      IF (‘;
    output_msg(l_msg_data);
    for i in 1 .. l_column_count
    loop
      if i = 1
      then
        l_msg_data := ‘              ‘;
      else
        l_msg_data := ‘          AND ‘;
      end if;
      if l_column_tbl(i).column_name = p_primary_key
      then
        l_msg_data := l_msg_data || ‘(‘ || l_rec_ext || l_column_tbl(i)
                     .column_name || ‘ = ‘ || l_block_name_ext ||
                      l_column_tbl(i).column_name || ‘)‘;
      else
        l_msg_data := l_msg_data || ‘((‘ || l_rec_ext || l_column_tbl(i)
                     .column_name || ‘ = ‘ || l_block_name_ext ||
                      l_column_tbl(i)
                     .column_name || ‘) OR‘ || g_newline ||
                      ‘               ((‘ || l_rec_ext || l_column_tbl(i)
                     .column_name || ‘ IS NULL)‘ || ‘ AND (‘ ||
                      l_block_name_ext || l_column_tbl(i)
                     .column_name || ‘ IS NULL)))‘;
      end if;
      output_msg(l_msg_data);
    end loop;

    l_msg_data := ‘      ) THEN‘ || g_newline || ‘        RETURN;‘ ||
                  g_newline || ‘      ELSE‘ || g_newline ||
                  ‘        fnd_message.set_name(‘‘FND‘‘, ‘‘FORM_RECORD_CHANGED‘‘);‘ ||
                  g_newline || ‘        fnd_message.error;‘ || g_newline ||
                  ‘        RAISE FORM_TRIGGER_FAILURE;‘ || g_newline ||
                  ‘      END IF;‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘    EXCEPTION‘ || g_newline ||
                  ‘      WHEN app_exception.record_lock_exception THEN‘ ||
                  g_newline ||
                  ‘        app_exception.record_lock_error(i);‘ ||
                  g_newline || ‘    END;‘ || g_newline || ‘  END LOOP;‘ ||
                  g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘END lock_row;‘ || g_newline;
    output_msg(l_msg_data);

    -- update row
    l_msg_data := ‘/*===============================================================‘ ||
                  g_newline || ‘*    Program Name:update_row()‘ ||
                  g_newline || ‘*    Author      :‘ || g_newline ||
                  ‘*    Date        :‘ || g_newline || ‘*    Purpose     :‘ ||
                  g_newline || ‘*    Parameters  :‘ || g_newline ||
                  ‘*             In       X     --X的说明‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*             Out      Y     --Y的说明‘ || g_newline ||
                  ‘*    Update History‘ || g_newline ||
                  ‘*    Version    Date         Name            Description‘ ||
                  g_newline ||
                  ‘*    --------  ----------  ---------------  --------------------‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*     V1.0                                   Creation    ‘ ||
                  g_newline || ‘*‘ || g_newline ||
                  ‘  ===============================================================*/‘ ||
                  g_newline || ‘PROCEDURE update_row IS‘;

    output_msg(l_msg_data);

    l_msg_data := ‘BEGIN‘ || g_newline;
    output_msg(l_msg_data);
    l_msg_data := ‘  fnd_standard.set_who;‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  UPDATE ‘ || p_table_name || ‘ SET‘;
    output_msg(l_msg_data);
    for i in 1 .. l_column_count
    loop
      l_msg_data := ‘      ‘ || rpad(l_column_tbl(i).column_name
                                    ,30) || ‘ = ‘ || l_block_name_ext ||
                    l_column_tbl(i).column_name;
      if i < l_column_count
      then
        l_msg_data := l_msg_data || ‘,‘;
      end if;
      output_msg(l_msg_data);
    end loop;
    l_msg_data := ‘  WHERE ROWID = ‘ || l_block_name_ext || ‘ROW_ID;‘ ||
                  g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  IF (SQL%NOTFOUND) THEN‘ || g_newline ||
                  ‘     RAISE NO_DATA_FOUND;‘ || g_newline || ‘  END IF;‘ ||
                  g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘END update_row;‘ || g_newline;
    output_msg(l_msg_data);

    -- delete row

    --l_msg_data := ‘\*=====================================‘ || g_newline || ‘** PROCEDURE:  delete_row()‘ || g_newline ||
    --                  ‘**=====================================*\‘ || g_newline || ‘PROCEDURE delete_row IS‘;

    l_msg_data := ‘/*===============================================================‘ ||
                  g_newline || ‘*    Program Name:delete_row()‘ ||
                  g_newline || ‘*    Author      :‘ || g_newline ||
                  ‘*    Date        :‘ || g_newline || ‘*    Purpose     :‘ ||
                  g_newline || ‘*    Parameters  :‘ || g_newline ||
                  ‘*             In       X     --X的说明‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*             Out      Y     --Y的说明‘ || g_newline ||
                  ‘*    Update History‘ || g_newline ||
                  ‘*    Version    Date         Name            Description‘ ||
                  g_newline ||
                  ‘*    --------  ----------  ---------------  --------------------‘;

    output_msg(l_msg_data);

    l_msg_data := ‘*     V1.0                                   Creation    ‘ ||
                  g_newline || ‘*‘ || g_newline ||
                  ‘  ===============================================================*/‘ ||
                  g_newline || ‘PROCEDURE delete_row IS‘;

    output_msg(l_msg_data);

    l_msg_data := ‘BEGIN‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  DELETE FROM ‘ || p_table_name || g_newline ||
                  ‘  WHERE ‘ || p_primary_key || ‘ = ‘ || l_block_name_ext ||
                  p_primary_key || ‘;‘ || g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘  IF (SQL%NOTFOUND) THEN‘ || g_newline ||
                  ‘     RAISE NO_DATA_FOUND;‘ || g_newline || ‘  END IF;‘ ||
                  g_newline;
    output_msg(l_msg_data);

    l_msg_data := ‘END delete_row;‘ || g_newline;
    output_msg(l_msg_data);

    -- end
    l_msg_data := ‘END ‘ || l_package_name || ‘;‘;
    output_msg(l_msg_data);

  exception
    when fnd_api.g_exc_error then
      output_msg(l_msg_data);
    when others then
      output_msg(sqlerrm);
  end form_view_iud_p;

end xxx_plsql_generator_pkg;
/

自动生成form Scripts

时间: 2024-11-09 00:31:07

自动生成form Scripts的相关文章

kvm一键shell自动生成 windows 虚拟机,无人值守操作方案(step1)

kvm一键shell自动生成 windows 虚拟机,无人值守操作方案分为四个步骤来联合完成: 第一步:开机启动脚本编写,使机器在一启动的时候能够执行该脚本,完成所有需要完成的基本操作(诸如设置密码,绑定Ip,加域,激活),这一步在单独一台机器上反复测试反复编写: 第二步:制定自动应答文件,使其能够无人自动安装,不需要人为干预:也就是消除机器第一次启动时候,需要人工选择<安装语言>,<接受许可协议>等等这些步骤: 第三步:完成以上几步,剩下就需要linux 通过virt-copy-

[原创]超强C#图片上传,加水印,自动生成缩略图源代码

<%@ Page Language=“C#“ AutoEventWireup=“true“ %> <%@ Import Namespace=“System“ %> <%@ Import Namespace=“System.IO“ %> <%@ Import Namespace=“System.Net“ %> <%@ Import NameSpace=“System.Web“ %> <%@ Import NameSpace=“Legalsof

java自动生成代码

看到这个标题,如果你以为真的可以完全自动生成,那你就太Naive啦 我这里想介绍的是,利用模板生成我们需要的代码 一.模板 首先来说说模板,常见的java模板有:FreeMarker.Velocity.Jamon.JByte等等. 不熟悉的可以百度下,其实我了解也不多,哈哈. 二.原理 其实就是利用模板,填充数据,得到我们需要的代码.即:输出=模板+数据 三.实例 实例利用FreeMarker来做的,所以你需要先导入freemarker的jar包 假设我们需要自动生成一个java bean,那么

PowerDesigner中表名过长,自动生成的主键名截取的问题

在PowerDesinger中,若表名过长,自动生成的主键名会被自动截取. 解决如下:DataBase/Edit Current DBMS/Scripts/Objects/PKey/ConstName中找到Value的值,默认是 PK_%.U27:TABLE%,U27表示截取27个字符.改成PK_%TABLE%主键名就不会被截取了. 同理,对生成的约束名常常因为截断字符串而导致重名错误,可以放开. DataBase/Edit Current DBMS/Scripts/Objects/Refere

在MyEclipse的web项目/java项目中,使用Hibernate-tools中的hbm2java和hbm2ddl工具,根据hbm文件自动生成pojo和数据库脚本

     首先,我一定要吐槽下,这个Ant管理部署项目的工具,以及hibernate刚刚学习,导入我这一个简单的问题整了一天多,实在效率有点低下.在这两天中,①了解了Ant,知道了在Ant中很灵活的步骤项目的情况,知道了build.xml文件的一些基本写法.②还学习了在MyEclipse这样的集成工具中完成项目部署.③以及在这两种情况中,利用hibernateTools中的hbm2java和hbm2ddl工具,根据对象关系映射文件,自动生成POJO以及SQL文件(就是数据表). 一,在web项目

《音乐商店》第4集:自动生成StoreManager控制器

一.自动生成StoreManager控制器 二.查看 StoreManager 控制器的代码 现在,Store Manager 控制器中已经包含了一定数量的代码,我们从头到尾重新过一下. 1.访问数据库代码 首先,在控制器中包含了标准的 MVC 控制器的代码,为了使用方便,还可以引用我们的模型类所在的命名空间 MvcMusicStore.Models.控制器还拥有了一个私有的 MusicStoreDBContext的私有成员,以方便控制器中的每个 Action 访问数据库. using Syst

MySQL数据库自动生成并修改随机root密码的脚本

在MySQL数据库部署的过程中,在安装了MySQL软件,并配置了my.cnf配置文件后,需要创建MySQL实例. MySQL 5.5实例创建完成了,默认会有登陆用户名和密码为空的用户,一般需要修改root用户密码,并删除无效用户,然后才能提供给应用使用. 这个过程可以通过shell脚本自动完成实例创建,启动,自动生成密码,修改root用户密码,删除无效用户. shell脚本有多种编写方法,我编写的shell脚本如下: #!/bin/bash # this scripts used to init

PDF目录标签自动生成示范 《Handbook.of.Applied.Cryptography》(Alfred.J..Menezes).pdf

利用JavaScript自动生PDF书签目录 使用软件版本 Acrobat XI 大多数的扫描版PDF电子图书都可以在官网或者各大网上书店找到目录,很多都是带有页码的. 通过脚本可以将目录自动转化为书签,添加到PDF中. 把目录数据复制粘贴到一个文本文件中,确保每一行都是一条书签,然后合并成一行内容,并将所有换行符用 "\n" 字符替换作为 JavaScript 的转义字符,放入 Bookmark.js 的 data 变量中. 然后把Bookmark.js文件保存到Acrobat安装目

java自动生成验证码

代码结构: web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="