mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -498,13 +498,7 @@ public abstract class AbstractDb<R extends AbstractDb<R>> extends DefaultConnect
|
||||
* @throws DbRuntimeException SQL执行异常
|
||||
*/
|
||||
public <T> T find(final Collection<String> fields, final Entity where, final RsHandler<T> rsh) throws DbRuntimeException {
|
||||
Connection conn = null;
|
||||
try {
|
||||
conn = this.getConnection();
|
||||
return runner.find(conn, Query.of(where).setFields(fields), rsh);
|
||||
} finally {
|
||||
this.closeConnection(conn);
|
||||
}
|
||||
return find(Query.of(where).setFields(fields), rsh);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -13,7 +13,12 @@ public class DefaultConnectionHolder implements ConnectionHolder {
|
||||
|
||||
protected final DataSource ds;
|
||||
|
||||
public DefaultConnectionHolder(DataSource ds) {
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
* @param ds {@link DataSource}
|
||||
*/
|
||||
public DefaultConnectionHolder(final DataSource ds) {
|
||||
this.ds = ds;
|
||||
}
|
||||
|
||||
|
@@ -118,7 +118,7 @@ public class StatementUtil {
|
||||
*
|
||||
* @param conn 数据库连接
|
||||
* @param sql SQL语句,使用"?"做为占位符
|
||||
* @param params "?"对应参数列表
|
||||
* @param params "?"对应参数列表或者Map表示命名参数
|
||||
* @return {@link PreparedStatement}
|
||||
* @throws SQLException SQL异常
|
||||
* @since 3.2.3
|
||||
|
@@ -115,9 +115,18 @@ public class SqlBuilder implements Builder<String> {
|
||||
private QuoteWrapper quoteWrapper;
|
||||
|
||||
// --------------------------------------------------------------- Constructor start
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*/
|
||||
public SqlBuilder() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
* @param quoteWrapper 包装器
|
||||
*/
|
||||
public SqlBuilder(final QuoteWrapper quoteWrapper) {
|
||||
this.quoteWrapper = quoteWrapper;
|
||||
}
|
||||
|
Reference in New Issue
Block a user