首页>代码>java多线程调用Perl脚本操作数据仓库>/MultiRunPerlByJava/src/com/asiainfo/model/Param.java
package com.asiainfo.model;

import java.io.Serializable;
import java.util.Properties;

import com.asiainfo.util.StringUtil;

public class Param implements Serializable {

	private static final long serialVersionUID = 3341409342393688120L;

	private String cmdName = "perl";
	private String path;
	private String fileName;
	private String host;
	private String port;
	private String dataBaseName;
	private String username;
	private String password;

	public Param(String cmdName, String fileName, String host, String port, String dataBaseName, String username, String password) {
		this.cmdName = cmdName;
		this.path = getCurrentPath();
		this.fileName = fileName;
		this.host = host;
		this.port = port;
		this.dataBaseName = dataBaseName;
		this.username = username;
		this.password = password;
	}

	public String getCmdName() {
		return cmdName;
	}

	public void setCmdName(String cmdName) {
		this.cmdName = cmdName;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getDataBaseName() {
		return dataBaseName;
	}

	public void setDataBaseName(String dataBaseName) {
		this.dataBaseName = dataBaseName;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getCurrentPath() {
		// 取得根目录路径
		String parentPath = getClass().getResource("../").getFile().toString();
		Properties prop = System.getProperties();
		String os = prop.getProperty("os.name");
		if (StringUtil.isNotEmpty(os) && os.startsWith("Win")) {
			parentPath = parentPath.replace("/", "\\");
		}else{
			parentPath = "/" + parentPath;
		}
		return parentPath.substring(parentPath.indexOf("\\") + 1, parentPath.length()) + "perl\\";
	}

	@Override
	public String toString() {
		return "Param [cmdName=" + cmdName + ", path=" + path + ", fileName=" + fileName + ", host=" + host + ", port=" + port + ", dataBaseName=" + dataBaseName + ", username=" + username + ", password=" + password + "]";
	}

}
最近下载更多
wangjinglin  LV1 2019年12月9日
liuyishi  LV6 2019年4月6日
blazing  LV2 2019年2月19日
a1351328329  LV1 2018年6月25日
jic499  LV27 2018年4月13日
人工智能4708  LV11 2018年3月13日
sdxrh2005  LV1 2018年1月20日
shenkang10086  LV6 2017年5月11日
wyj11www  LV1 2016年12月28日
WwZQ  LV15 2016年4月8日
最近浏览更多
liqing1  LV1 2023年12月28日
zw050256  LV7 2022年10月10日
dongzhan  LV12 2021年12月15日
歪歪歪  LV8 2021年9月5日
肥波先生  LV12 2021年8月10日
fgy9826  LV5 2021年3月22日
xiongfan  LV6 2021年3月15日
LiXin1994  LV1 2020年12月9日
866521  LV2 2020年9月7日
2687772871  LV1 2020年8月29日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友