Examples of DruidPlugin


Examples of com.jfinal.plugin.druid.DruidPlugin

  /**
   * 配置插件
   */
  public void configPlugin(Plugins me) {
    // 配置数据库连接池插件
    DruidPlugin druidPlugin = new DruidPlugin(PropertiesContent.get("jdbc.url"),
                          PropertiesContent.get("jdbc.username"),
                          PropertiesContent.get("jdbc.password")
                          ,PropertiesContent.get("jdbc.driver"));
//    WallFilter wall = new WallFilter();
//    wall.setDbType(PropertiesContent.get("jdbc.dbType"));
//    druidPlugin.addFilter(wall);
    druidPlugin.addFilter(new StatFilter());
    me.add(druidPlugin);
    // 配置ActiveRecord插件
    /**
    ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
    me.add(arp);
View Full Code Here

Examples of com.jfinal.plugin.druid.DruidPlugin

  }

  @Override
  public void initialize() throws SQLException {
    PropertiesUtils.me().loadPropertyFile(DB_CONFIG);
    druidPlugin = new DruidPlugin(
        PropertiesUtils.me().getProperty("db.default.url"),
        PropertiesUtils.me().getProperty("db.default.user"),
        PropertiesUtils.me().getProperty("db.default.password"),
        PropertiesUtils.me().getProperty("db.default.driver"));
    // StatFilter提供JDBC层的统计信息
View Full Code Here

Examples of com.jfinal.plugin.druid.DruidPlugin

        me.add(new TxByRegex(".*.save"));
    }

    @Override
    public void configPlugin(Plugins me) {
        DruidPlugin druidPlugin = new DruidPlugin("jdbc:mysql://127.0.0.1/jfinal_demo", "root", "root");

        AutoTableBindPlugin atbp = new AutoTableBindPlugin(druidPlugin).autoScan(false);
        me.add(druidPlugin);
        me.add(atbp);
    }
View Full Code Here

Examples of com.jfinal.plugin.druid.DruidPlugin

    private static DruidPlugin druidPlugin2;

    @BeforeClass
    public static void init() {
        druidPlugin = new DruidPlugin("jdbc:mysql://127.0.0.1/test", "root", "root");
        druidPlugin.start();
        druidPlugin2 = new DruidPlugin("jdbc:mysql://127.0.0.1/test2", "root", "root");
        druidPlugin2.start();
    }
View Full Code Here

Examples of com.jfinal.plugin.druid.DruidPlugin

     *
     * @throws RemoteException
     */
    public HelloImpl() throws RemoteException {
      /**plugin执行start方法后可以在非web等程序中调用数据库操作*/
      DruidPlugin druidPlugin = new DruidPlugin("jdbc:mysql://127.0.0.1/mymall?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull", "root", "123456");
      druidPlugin.start();
    // 配置ActiveRecord插件
    ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
    arp.start();
    }
View Full Code Here

Examples of com.jfinal.plugin.druid.DruidPlugin

  /**
   * 配置插件
   */
  public void configPlugin(Plugins me) {
    // 配置数据库连接池插件
    DruidPlugin druidPlugin = new DruidPlugin(PropertiesContent.get("jdbc.url"),
                          PropertiesContent.get("jdbc.username"),
                          PropertiesContent.get("jdbc.password")
                          ,PropertiesContent.get("jdbc.driver"));
//    WallFilter wall = new WallFilter();
//    wall.setDbType(PropertiesContent.get("jdbc.dbType"));
//    druidPlugin.addFilter(wall);
    druidPlugin.addFilter(new StatFilter());
    me.add(druidPlugin);
    // 配置ActiveRecord插件
    /**
    ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
    me.add(arp);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.