Package | Description |
---|---|
org.dromara.hutool.db |
Hutool-db是一个在JDBC基础上封装的数据库操作工具类,通过包装,使用ActiveRecord思想操作数据库。
|
org.dromara.hutool.db.config |
数据库配置,通过统一的配置文件,提供灵活的配置来源,包括但不限于:
setting配置文件
XML配置文件
网络配置
自定义Bean
|
org.dromara.hutool.db.dialect |
数据库方言封装,包括数据库方言以及方言自动识别等
|
org.dromara.hutool.db.dialect.impl |
数据库方言实现,包括MySQL、Oracle、PostgreSQL、Sqlite3、H2、SqlServer2012等
|
org.dromara.hutool.db.ds |
数据源封装,对各类数据库连接池的封装
数据库连接池使用工厂方法模式,当有新增连接池时,实现 DSFactory 即可。 |
org.dromara.hutool.db.sql |
SQL语句和Statement构建封装
|
Modifier and Type | Field and Description |
---|---|
protected DbConfig |
AbstractDb.dbConfig |
Modifier and Type | Method and Description |
---|---|
static Db |
Db.of(DbConfig config)
创建Db
|
Constructor and Description |
---|
DialectRunner(DbConfig config,
Dialect dialect)
构造
|
Modifier and Type | Method and Description |
---|---|
DbConfig |
DbConfig.addSqlFilter(SqlFilter filter)
增加SQL过滤器
|
static DbConfig |
DbConfig.of()
创建DsConfig
|
static DbConfig |
DbConfig.of(String url,
String user,
String pass)
创建DsConfig
|
DbConfig |
SettingConfigParser.parse(String group) |
DbConfig |
ConfigParser.parse(String group)
解析,包括数据库基本连接信息、连接属性、连接池参数和其他配置项等
|
DbConfig |
DbConfig.setCaseInsensitive(boolean isCaseInsensitive)
设置是否在结果中忽略大小写
如果忽略,则在Entity中调用getXXX时,字段值忽略大小写,默认忽略 |
DbConfig |
DbConfig.setDialect(Dialect dialect)
设置自定义方言
|
DbConfig |
DbConfig.setDsFactory(DSFactory dsFactory)
设置数据源工厂
|
Modifier and Type | Method and Description |
---|---|
static Dialect |
DialectFactory.newDialect(DbConfig dbConfig)
创建方言,如果配置中用户指定了方言,则直接返回用户指定的方言,否则根据驱动名等信息自动创建方言
驱动名是不分区大小写完全匹配的 |
Modifier and Type | Field and Description |
---|---|
protected DbConfig |
AnsiSqlDialect.dbConfig |
Constructor and Description |
---|
AnsiSqlDialect(DbConfig dbConfig)
构造
|
DmDialect(DbConfig dbConfig)
构造
|
H2Dialect(DbConfig config)
构造
|
MysqlDialect(DbConfig dbConfig)
构造
|
OracleDialect(DbConfig dbConfig)
构造
|
PhoenixDialect(DbConfig dbConfig)
构造
|
PostgresqlDialect(DbConfig dbConfig)
构造
|
Sqlite3Dialect(DbConfig dbConfig)
构造
|
SqlServer2005Dialect(DbConfig dbConfig)
构造
|
SqlServer2012Dialect(DbConfig dbConfig)
构造
|
Modifier and Type | Method and Description |
---|---|
DbConfig |
DSWrapper.getDbConfig()
获取数据库配置
|
Modifier and Type | Method and Description |
---|---|
static DSWrapper |
DSUtil.createDS(DbConfig dbConfig)
根据已有配置文件,创建数据源
|
static DSWrapper |
DSWrapper.wrap(DataSource ds,
DbConfig dbConfig)
包装指定的DataSource
|
Constructor and Description |
---|
DSWrapper(DataSource ds,
DbConfig dbConfig)
构造
|
Modifier and Type | Method and Description |
---|---|
static SqlExecutor |
SqlExecutor.of(DbConfig config,
Connection conn)
创建SqlExecutor
|
static CallableStatement |
StatementUtil.prepareCall(DbConfig config,
Connection conn,
String sql,
Object... params)
|
static PreparedStatement |
StatementUtil.prepareStatement(boolean returnGeneratedKey,
DbConfig config,
Connection conn,
String sql,
Object... params)
|
static PreparedStatement |
StatementUtil.prepareStatementForBatch(DbConfig config,
Connection conn,
String sql,
Iterable<Object[]> paramsBatch)
创建批量操作的
PreparedStatement |
static PreparedStatement |
StatementUtil.prepareStatementForBatch(DbConfig config,
Connection conn,
String sql,
Object[]... paramsBatch)
创建批量操作的
PreparedStatement |
Constructor and Description |
---|
SqlExecutor(DbConfig config,
Connection conn)
构造
|
Copyright © 2025. All rights reserved.