# 2.5 configPlugin

This method is used to configure JFinal's Plugin. The code below sets up the Druid database connection pool plugin and the ActiveRecord database access plugin. With this configuration, you can easily operate the database in the application using ActiveRecord.

public void configPlugin(Plugins me) {
    DruidPlugin dp = new DruidPlugin(jdbcUrl, userName, password);
    me.add(dp);
    
    ActiveRecordPlugin arp = new ActiveRecordPlugin(dp);
    arp.addMapping("user", User.class);
    me.add(arp);
}
1
2
3
4
5
6
7
8

JFinal's plugin architecture is one of its main extension methods, allowing for easy creation and application of plugins in projects.

Last Updated: 9/17/2023, 5:34:57 AM