public static void closeResultSet(@Nullable ResultSet rs) {
        if (rs != null) {
            try {
                rs.close();
            } catch (SQLException var2) {
                log.trace("Could not close JDBC ResultSet", var2);
            } catch (Throwable var3) {
                log.trace("Unexpected exception on closing JDBC ResultSet", var3);
            }
        }

    }
Test database connection

@param url database connection
@param userName username
@param password password
@param dbType database type
@return
chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/util/JdbcUtils.java