Search in sources :

Example 1 with BasePostgreResponse

use of com.platform.quartza.entity.BasePostgreResponse in project platform-base by SummerWindL.

the class BaseTask method test3.

// @Scheduled(fixedRate = 3 * SECOND)
public void test3() {
    BasePostgreResponse basePostgreResponse = postgreSqlNotifyService.pgNotifyTest();
    // BasePostgreResponse basePostgreResponse = postgreSqlNotifyService.jdbcPgNofifyTest();
    LOGGER.info("响应:{}", basePostgreResponse);
}
Also used : BasePostgreResponse(com.platform.quartza.entity.BasePostgreResponse)

Example 2 with BasePostgreResponse

use of com.platform.quartza.entity.BasePostgreResponse in project platform-base by SummerWindL.

the class PostgreSqlNotifyService method jdbcPgNofifyTest.

@DS("slave_1")
public BasePostgreResponse jdbcPgNofifyTest() {
    BasePostgreResponse resp = new BasePostgreResponse();
    List<BasePostgreResponse> query = jdbcTemplate.query("select * from f_test_pg_notify('1')", new RowMapper<BasePostgreResponse>() {

        @Override
        public BasePostgreResponse mapRow(ResultSet resultSet, int i) throws SQLException {
            resp.setRetcode(resultSet.getInt("retcode"));
            resp.setRetvalue(resultSet.getString("retvalue"));
            return resp;
        }
    });
    return !CollectionUtils.isEmpty(query) ? query.get(0) : new BasePostgreResponse();
}
Also used : BasePostgreResponse(com.platform.quartza.entity.BasePostgreResponse) SQLException(java.sql.SQLException) ResultSet(java.sql.ResultSet) DS(com.baomidou.dynamic.datasource.annotation.DS)

Aggregations

BasePostgreResponse (com.platform.quartza.entity.BasePostgreResponse)2 DS (com.baomidou.dynamic.datasource.annotation.DS)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1