package com.njcn.gather.systemops.database.support.mysql;

import com.njcn.gather.systemops.database.pojo.po.DatabaseConnection;

/**
 * MySQL JDBC URL 构造工具。
 */
public final class MysqlJdbcUrlUtil {

    private MysqlJdbcUrlUtil() {
    }

    public static String build(DatabaseConnection connection) {
        return "jdbc:mysql://" + connection.getHost() + ":" + connection.getPort() + "/" + connection.getDatabaseName()
                + "?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai"
                + "&useCursorFetch=true&connectTimeout=5000&socketTimeout=30000";
    }
}
