From 42bed2e7d9843173b32d7851818c1955e84917fb Mon Sep 17 00:00:00 2001 From: landawn <16568599+landawn@users.noreply.github.com> Date: Tue, 26 Jan 2021 00:16:18 -0800 Subject: [PATCH] --- .../com/landawn/abacus/util/SQLExecutor.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/com/landawn/abacus/util/SQLExecutor.java b/src/main/java/com/landawn/abacus/util/SQLExecutor.java index 8060a677..b25c685e 100644 --- a/src/main/java/com/landawn/abacus/util/SQLExecutor.java +++ b/src/main/java/com/landawn/abacus/util/SQLExecutor.java @@ -37,6 +37,7 @@ import com.landawn.abacus.DirtyMarker; import com.landawn.abacus.EntityId; import com.landawn.abacus.IsolationLevel; +import com.landawn.abacus.annotation.Beta; import com.landawn.abacus.core.DirtyMarkerUtil; import com.landawn.abacus.exception.DuplicatedResultException; import com.landawn.abacus.exception.UncheckedSQLException; @@ -504,6 +505,31 @@ public SQLExecutor(final DataSource dataSource, final JdbcSettings jdbcSettings, _defaultIsolationLevel = defaultIsolationLevel; } + /** + * + * @param url + * @param user + * @param password + * @return + */ + @Beta + public static SQLExecutor create(final String url, final String user, final String password) { + return new SQLExecutor(JdbcUtil.createHikariDataSource(url, user, password)); + } + + /** + * + * @param driverClass + * @param url + * @param user + * @param password + * @return + */ + @Beta + public static SQLExecutor create(final DataSource dataSource) { + return new SQLExecutor(dataSource); + } + /** * * @return