public class Jdbcs extends Object
| 构造器和说明 |
|---|
Jdbcs() |
public static DataSource getDataSource(String jndiName) throws SQLException
SQLExceptionpublic static Connection getConnection(String jndiName) throws SQLException
SQLExceptionpublic static Connection getConnection(String driver, String url, Properties info) throws SQLException
SQLExceptionpublic static Connection getConnection(String url, Properties info) throws SQLException
SQLExceptionpublic static Connection getConnection(String driver, String url, String user, String password, boolean remark) throws SQLException
SQLExceptionpublic static Connection getConnection(String driver, String url, String user, String password) throws SQLException
SQLExceptionpublic static Connection getConnection(String url, String user, String password, boolean remark) throws SQLException
SQLExceptionpublic static Connection getConnection(String url, String user, String password) throws SQLException
SQLExceptionpublic static void doWithConnection(DataSource dataSource, ThrowableExecutionWithArgs1<Connection> executable) throws Throwable
Throwablepublic static <V> V doWithConnection(DataSource dataSource, ThrowableSupplierWithArgs1<Connection,V> executable) throws Throwable
Throwablepublic static Returnee<Boolean,Throwable> doWithConnectionQuietly(DataSource dataSource, ThrowableExecutionWithArgs1<Connection> executable)
public static <V> Returnee<V,Throwable> doWithConnectionQuietly(DataSource dataSource, ThrowableSupplierWithArgs1<Connection,V> executable)
public static void doWithConnection(Callable<Connection> supplier, ThrowableExecutionWithArgs1<Connection> executable) throws Throwable
Throwablepublic static <V> V doWithConnection(Callable<Connection> supplier, ThrowableSupplierWithArgs1<Connection,V> executable) throws Throwable
Throwablepublic static Returnee<Boolean,Throwable> doWithConnectionQuietly(Callable<Connection> supplier, ThrowableExecutionWithArgs1<Connection> executable)
public static <V> Returnee<V,Throwable> doWithConnectionQuietly(Callable<Connection> supplier, ThrowableSupplierWithArgs1<Connection,V> executable)
public static <R extends AutoCloseable> void close(R r)
public static void close(Connection connection)
public static void beginTransaction(Connection connection) throws SQLException
SQLExceptionpublic static void closeTransaction(Connection connection) throws SQLException
SQLExceptionpublic static void commit(Connection connection) throws SQLException
SQLExceptionpublic static void rollback(Connection connection) throws SQLException
SQLExceptionpublic static void rollbackQuietly(Connection connection)
public static void doTransaction(Connection conn, ThrowableExecution executable) throws Throwable
Throwablepublic static <V> V doTransaction(Connection conn, ThrowableSupplier<V> callable) throws Throwable
Throwablepublic static Returnee<Boolean,Throwable> doTransactionQuietly(Connection conn, ThrowableExecution executable)
public static <V> Returnee<V,Throwable> doTransactionQuietly(Connection conn, ThrowableSupplier<V> callable) throws Throwable
Throwablepublic static void doTransaction(DataSource dataSource, ThrowableExecution executable) throws Throwable
Throwablepublic static <V> V doTransaction(DataSource dataSource, ThrowableSupplier<V> callable) throws Throwable
Throwablepublic static Returnee<Boolean,Throwable> doTransactionQuietly(DataSource dataSource, ThrowableExecution executable)
public static <V> Returnee<V,Throwable> doTransactionQuietly(DataSource dataSource, ThrowableSupplier<V> callable) throws Throwable
Throwablepublic static void doTransaction(Callable<Connection> supplier, ThrowableExecution executable) throws Throwable
Throwablepublic static <V> V doTransaction(Callable<Connection> supplier, ThrowableSupplier<V> callable) throws Throwable
Throwablepublic static Returnee<Boolean,Throwable> doTransactionQuietly(Callable<Connection> supplier, ThrowableExecution executable)
public static <V> Returnee<V,Throwable> doTransactionQuietly(Callable<Connection> supplier, ThrowableSupplier<V> callable) throws Throwable
Throwablepublic static <T> T createExecutor(Class<T> interfaceClass)
public static <T> T createExecutor(Class<T> interfaceClass, Connection connection, boolean batch)
public static <T> T query(Connection conn, SqlNode sqlNode, ResultExtractor<T> extractor) throws SQLException
SQLExceptionResultExtractorspublic static void query(Connection conn, SqlNode sqlNode, ResultSetVisitor visitor) throws SQLException
SQLExceptionResultSetVisitorspublic static <T> T query(Connection conn, SqlNode sqlNode, @Nonnull JdbcOptions options, ResultExtractor<T> extractor) throws SQLException
SQLExceptionResultExtractorspublic static void query(Connection conn, SqlNode sqlNode, @Nonnull JdbcOptions options, ResultSetVisitor visitor) throws SQLException
SQLExceptionResultSetVisitorspublic static <T> T query(Connection conn, String sql, Iterable<?> parameters, ResultExtractor<T> extractor) throws SQLException
SQLExceptionResultExtractorspublic static void query(Connection conn, String sql, Iterable<?> parameters, ResultSetVisitor visitor) throws SQLException
SQLExceptionResultSetVisitorspublic static <T> T query(Connection conn, String sql, Object[] parameters, ResultExtractor<T> extractor) throws SQLException
SQLExceptionResultExtractorspublic static void query(Connection conn, String sql, Object[] parameters, ResultSetVisitor visitor) throws SQLException
SQLExceptionResultSetVisitorspublic static <T> T query(Connection conn, String sql, ResultExtractor<T> extractor) throws SQLException
SQLExceptionResultExtractorspublic static void query(Connection conn, String sql, ResultSetVisitor visitor) throws SQLException
SQLExceptionResultSetVisitorspublic static <T> List<T> query(Connection conn, String sql, ResultRowSimpleMapper<T> mapper) throws SQLException
SQLExceptionpublic static <T> void query(Connection conn, String sql, ResultRowSimpleMapper<T> mapper, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static void queryForMapList(Connection conn, String sql, ResultVisitor<Map<String,Object>> visitor) throws SQLException
SQLExceptionpublic static void queryForMapList(Connection conn, String sql, Iterable<?> parameters, ResultVisitor<Map<String,Object>> visitor) throws SQLException
SQLExceptionpublic static void queryForMapList(Connection conn, String sql, Object[] parameters, ResultVisitor<Map<String,Object>> visitor) throws SQLException
SQLExceptionpublic static List<Map<String,Object>> queryForMapList(Connection conn, String sql) throws SQLException
SQLExceptionpublic static List<Map<String,Object>> queryForMapList(Connection conn, String sql, Iterable<?> parameters) throws SQLException
SQLExceptionpublic static List<Map<String,Object>> queryForMapList(Connection conn, String sql, Object[] parameters) throws SQLException
SQLExceptionpublic static <T> void queryForList(Connection conn, String sql, Class<T> beanType, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForList(Connection conn, String sql, Iterable<?> parameters, Class<T> beanType, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForList(Connection conn, String sql, Object[] parameters, Class<T> beanType, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForList(Connection conn, String sql, BeanMapping<T> mapping, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForList(Connection conn, String sql, Iterable<?> parameters, BeanMapping<T> mapping, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForList(Connection conn, String sql, Object[] parameters, BeanMapping<T> mapping, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> List<T> queryForList(Connection conn, String sql, Class<T> beanType) throws SQLException
SQLExceptionpublic static <T> List<T> queryForList(Connection conn, String sql, Iterable<?> parameters, Class<T> beanType) throws SQLException
SQLExceptionpublic static <T> List<T> queryForList(Connection conn, String sql, Object[] parameters, Class<T> beanType) throws SQLException
SQLExceptionpublic static <T> List<T> queryForList(Connection conn, String sql, BeanMapping<T> mapping) throws SQLException
SQLExceptionpublic static <T> List<T> queryForList(Connection conn, String sql, Iterable<?> parameters, BeanMapping<T> mapping) throws SQLException
SQLExceptionpublic static <T> List<T> queryForList(Connection conn, String sql, Object[] parameters, BeanMapping<T> mapping) throws SQLException
SQLExceptionpublic static void queryForMap(Connection conn, String sql, ResultVisitor<Map<String,Object>> visitor) throws SQLException
SQLExceptionpublic static void queryForMap(Connection conn, String sql, Iterable<?> parameters, ResultVisitor<Map<String,Object>> visitor) throws SQLException
SQLExceptionpublic static void queryForMap(Connection conn, String sql, Object[] parameters, ResultVisitor<Map<String,Object>> visitor) throws SQLException
SQLExceptionpublic static Map<String,Object> queryForMap(Connection conn, String sql) throws SQLException
SQLExceptionpublic static Map<String,Object> queryForMap(Connection conn, String sql, Iterable<?> parameters) throws SQLException
SQLExceptionpublic static Map<String,Object> queryForMap(Connection conn, String sql, Object[] parameters) throws SQLException
SQLExceptionpublic static <T> void queryForObject(Connection conn, String sql, Class<T> beanType, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForObject(Connection conn, String sql, Iterable<?> parameters, Class<T> beanType, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForObject(Connection conn, String sql, Object[] parameters, Class<T> beanType, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> T queryForObject(Connection conn, String sql, Class<T> beanType) throws SQLException
SQLExceptionpublic static <T> T queryForObject(Connection conn, String sql, Iterable<?> parameters, Class<T> beanType) throws SQLException
SQLExceptionpublic static <T> T queryForObject(Connection conn, String sql, Object[] parameters, Class<T> beanType) throws SQLException
SQLExceptionpublic static <T> void queryForMapping(Connection conn, String sql, BeanMapping<T> mapping, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForMapping(Connection conn, String sql, Iterable<?> parameters, BeanMapping<T> mapping, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForMapping(Connection conn, String sql, Object[] parameters, BeanMapping<T> mapping, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> T queryForMapping(Connection conn, String sql, BeanMapping<T> mapping) throws SQLException
SQLExceptionpublic static <T> T queryForMapping(Connection conn, String sql, Iterable<?> parameters, BeanMapping<T> mapping) throws SQLException
SQLExceptionpublic static <T> T queryForMapping(Connection conn, String sql, Object[] parameters, BeanMapping<T> mapping) throws SQLException
SQLExceptionpublic static void queryForSingle(Connection conn, String sql, ResultVisitor<Object> visitor) throws SQLException
SQLExceptionpublic static void queryForSingle(Connection conn, String sql, Iterable<?> parameters, ResultVisitor<Object> visitor) throws SQLException
SQLExceptionpublic static void queryForSingle(Connection conn, String sql, Object[] parameters, ResultVisitor<Object> visitor) throws SQLException
SQLExceptionpublic static Object queryForSingle(Connection conn, String sql) throws SQLException
SQLExceptionpublic static Object queryForSingle(Connection conn, String sql, Iterable<?> parameters) throws SQLException
SQLExceptionpublic static Object queryForSingle(Connection conn, String sql, Object[] parameters) throws SQLException
SQLExceptionpublic static <T> void queryForSingle(Connection conn, String sql, Class<T> type, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForSingle(Connection conn, String sql, Iterable<?> parameters, Class<T> type, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> void queryForSingle(Connection conn, String sql, Object[] parameters, Class<T> type, ResultVisitor<T> visitor) throws SQLException
SQLExceptionpublic static <T> T queryForSingle(Connection conn, String sql, Class<T> type) throws SQLException
SQLExceptionpublic static <T> T queryForSingle(Connection conn, String sql, Iterable<?> parameters, Class<T> type) throws SQLException
SQLExceptionpublic static <T> T queryForSingle(Connection conn, String sql, Object[] parameters, Class<T> type) throws SQLException
SQLExceptionpublic static int update(Connection conn, SqlNode sql) throws SQLException
SQLExceptionpublic static int update(Connection conn, SqlNode sql, @Nonnull JdbcOptions options) throws SQLException
SQLExceptionpublic static int update(Connection conn, SqlNode sql, @Nonnull JdbcOptions options, Object generatedKeyBinding) throws SQLException
SQLExceptionpublic static int update(Connection conn, String sql) throws SQLException
SQLExceptionpublic static int update(Connection conn, String sql, Iterable<?> parameters) throws SQLException
SQLExceptionpublic static int update(Connection conn, String sql, Object[] parameters) throws SQLException
SQLExceptionpublic static <T> T query(Connection conn, String sql, StatementPreparer preparer, ResultExtractor<T> extractor) throws SQLException
SQLExceptionpublic static void query(Connection conn, String sql, StatementPreparer preparer, ResultSetVisitor visitor) throws SQLException
SQLExceptionpublic static <T> T query(@Nonnull Connection conn, @Nonnull String sql, @Nonnull JdbcOptions options, StatementPreparer preparer, ResultExtractor<T> extractor) throws SQLException
SQLExceptionpublic static void query(@Nonnull Connection conn, @Nonnull String sql, @Nonnull JdbcOptions options, StatementPreparer preparer, ResultSetVisitor visitor) throws SQLException
SQLExceptionpublic static int update(Connection conn, String sql, StatementPreparer preparer) throws SQLException
SQLExceptionpublic static int update(@Nonnull Connection conn, @Nonnull String sql, @Nonnull JdbcOptions options, StatementPreparer preparer, Object generatedKeyBinding) throws SQLException
SQLExceptionpublic static void call(@Nonnull Connection conn, @Nonnull String sql, @Nonnull JdbcOptions options, Object[] parameters, int[] outIndexes, int[] outTypes) throws SQLException
SQLExceptionpublic static <T> T call(@Nonnull Connection conn, @Nonnull String sql, @Nonnull JdbcOptions options, Object[] parameters, int[] outIndexes, int[] outTypes, ResultExtractor<T> extractor) throws SQLException
SQLExceptionpublic static PreparedStatement prepareStatement(@Nonnull Connection conn, @Nonnull String sql, @Nonnull JdbcOptions options) throws SQLException
SQLExceptionpublic static StatementPreparer preparerOfAll(StatementPreparer... preparers)
public static StatementPreparer preparerOfParameters(Iterable<?> parameters)
public static StatementPreparer preparerOfParameters(Object[] parameters)
public static JdbcBatch updateBatch(Connection conn, SqlNode sql) throws SQLException
SQLExceptionpublic static JdbcBatch updateBatch(Connection conn, SqlNode sql, @Nonnull JdbcOptions options) throws SQLException
SQLExceptionpublic static JdbcBatch updateBatch(Connection conn, SqlNode sql, @Nonnull JdbcOptions options, Object generatedKeyBinding) throws SQLException
SQLExceptionpublic static JdbcBatch updateBatch(Connection conn, String sql) throws SQLException
SQLExceptionpublic static JdbcBatch updateBatch(Connection conn, String sql, Iterable<?> parameters) throws SQLException
SQLExceptionpublic static JdbcBatch updateBatch(Connection conn, String sql, Object[] parameters) throws SQLException
SQLExceptionpublic static JdbcBatch updateBatch(Connection conn, String sql, StatementPreparer preparer) throws SQLException
SQLExceptionpublic static JdbcBatch updateBatch(@Nonnull Connection conn, @Nonnull String sql, @Nonnull JdbcOptions options, StatementPreparer preparer, Object generatedKeyBinding) throws SQLException
SQLExceptionpublic static List<BatchResult> flushBatch() throws SQLException
SQLExceptionCopyright © 2025 fossc. All rights reserved.