Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/6tail/nlf-mini-plugin-druid
nlf-mini的druid连接池插件
https://github.com/6tail/nlf-mini-plugin-druid
Last synced: about 8 hours ago
JSON representation
nlf-mini的druid连接池插件
- Host: GitHub
- URL: https://github.com/6tail/nlf-mini-plugin-druid
- Owner: 6tail
- License: mit
- Created: 2023-05-17T13:44:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-08T04:48:01.000Z (10 months ago)
- Last Synced: 2024-01-08T05:55:23.359Z (10 months ago)
- Language: Java
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nlf-mini-plugin-druid [![License](https://img.shields.io/badge/license-MIT-4EB1BA.svg?style=flat-square)](https://github.com/6tail/nlf-mini-plugin-druid/blob/master/LICENSE)
nlf-mini-plugin-druid是 [nlf-mini](https://github.com/6tail/nlf-mini) 的插件,引入后可支持druid连接池。
### Maven
```xml
cn.6tail
nlf-mini
${nlf-mini.version}cn.6tail
nlf-mini-plugin-druid
1.0.0
com.alibaba
druid
${druid.version}mysql
mysql-connector-java
${mysql.version}```
### 下载jar
[Download](https://github.com/6tail/nlf-mini-plugin-druid/releases)
### 配置文件示例
db.alias=a
db.alias.a.dbtype=mysql
db.alias.a.server=localhost
db.alias.a.port=3306
db.alias.a.dbname=mysql
db.alias.a.user=root
db.alias.a.password=
# type 为 druid
db.alias.a.type=druid
db.alias.a.initialSize=1
db.alias.a.minIdle=1
db.alias.a.maxActive=20
db.alias.a.maxWait=60000
db.alias.a.timeBetweenEvictionRunsMillis=60000
db.alias.a.minEvictableIdleTimeMillis=300000
db.alias.a.testWhileIdle=true
db.alias.a.testOnBorrow=false
db.alias.a.testOnReturn=false
db.alias.a.poolPreparedStatements=true
db.alias.a.maxPoolPreparedStatementPerConnectionSize=20
db.alias.a.filters=stat### 使用示例
import com.nlf.mini.extend.dao.sql.ISqlDao;
import com.nlf.mini.extend.dao.sql.SqlDaoFactory;
public class Demo {
public static void main(String[] args){
ISqlDao dao = SqlDaoFactory.getDao();
int count = dao.getSelecter().table("user").count();
System.out.println(count);
dao.close();
}
}