package com.service.impl;

import com.dao.UserDao;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.beans.PropertyVetoException;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public void saveUser() {
//        jdbcTemplate = new JdbcTemplate();
//        ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource();
//        try {
//            comboPooledDataSource.setDriverClass("com.mysql.cj.jdbc.Driver");
//            comboPooledDataSource.setJdbcUrl("jdbc:mysql://47.110.156.18:3306/sczn_eshop_test?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai");
//            comboPooledDataSource.setUser("sczn");
//            comboPooledDataSource.setPassword("sczn159357");
//            this.jdbcTemplate.setDataSource(comboPooledDataSource);
//            int row = this.jdbcTemplate.update("insert into `wb_tbl_a`(company_id,status) " +
//                    "values (?,?)", 100, 100);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
        userDao.save();
    }
}
