package com.ruoyi.business.utils;

import com.ruoyi.business.domain.vo.DatabaseVo;
import org.springframework.stereotype.Component;

@Component
public class MysqlJdbc {

    public String getClassName() {
        return "com.mysql.cj.jdbc.Driver";
    }

    public String getUrl(DatabaseVo dataBaseVo) {
        //"jdbc:mysql://localhost:3306/test_demo?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC"
        return "jdbc:mysql://" + dataBaseVo.getDbip() + ":" + dataBaseVo.getDbport() + "/" + dataBaseVo.getDbname() +
                "?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=UTF-8";
    }
}
