forum.bitel.ru
http://forum.bitel.ru/

Получить сon в dynservice
http://forum.bitel.ru/viewtopic.php?f=19&t=12855
Страница 1 из 1

Автор:  mhollow [ 04 апр 2018, 12:22 ]
Заголовок сообщения:  Получить сon в dynservice

Привет
Переписываю класс для динамических веб-сервисов согласно http://wiki.bitel.ru/index.php/%D0%9F%D ... 0%BE%D0%B2

Вопрос!
Как из моего класса потомка веб-сервиса
public class ContractLimitServiceImpl extends ru.bitel.bgbilling.kernel.contract.limit.server.service.ContractLimitServiceImpl implements ContractLimitService { }
получить con для доступа к базе?

this.con и super.con не работают
Ну или любым другим способом получить Contract
Спасибо.

Автор:  Phricker [ 04 апр 2018, 12:24 ]
Заголовок сообщения:  Re: Получить сon в dynservice

Я вам для другой темы писал. Ну чтож отвечу тут :)
Вместе с получением соединения.

Код:
dynservice:ru.bitel.bgbilling.kernel.contract.limit.ContractLimitService=ru.ellcom.bgbilling.scripts.contract.LimitUpdateImpl

Код:
import org.apache.log4j.Logger;
import ru.bitel.bgbilling.common.BGException;
import ru.bitel.bgbilling.kernel.contract.limit.common.service.ContractLimitService;

import javax.jws.WebService;
import java.math.BigDecimal;
import java.sql.Connection;

/**
 * Перегруженный вебсервис для вывода в лог какой-то ерунды при установке временного лимита
 *
 * @author SinTeZ
 */
@WebService(endpointInterface = "ru.bitel.bgbilling.kernel.contract.limit.common.service.ContractLimitService")
public class LimitUpdateImpl
        extends ru.bitel.bgbilling.kernel.contract.limit.server.service.ContractLimitServiceImpl
        implements ContractLimitService {

    private final Logger logger = Logger.getLogger(LimitUpdateImpl.class);

    @Override
    public void updateContractLimitPeriod(int contractId, BigDecimal limit, int period, String comment) throws BGException {
        logger.info("Blablabla");
        Connection con = getConnection()
        super.updateContractLimitPeriod(contractId, limit, period, comment);
    }
}

Автор:  mhollow [ 04 апр 2018, 12:31 ]
Заголовок сообщения:  Re: Получить сon в dynservice

ага, спасибо

Страница 1 из 1 Часовой пояс: UTC + 5 часов [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/