⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getproperty.java

📁 SAP这个系统的一个转换器
💻 JAVA
字号:
package com.idoc.util;

/**
 * <p>Title: IDOC Interface</p>
 * <p>Description: IDOC 转换器</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: SiChuan XinHua</p>
 * @author Richary
 * @version 1.0
 */

import com.idoc.util.Operate;
import java.util.Properties;
import java.sql.Connection;

public class GetProperty {
  /*****  连接数据库URL  *******/
//  private static String poolName = "";

  /*****  连接数据库URL  *******/
//  private static String maxConn = "";

  /*****  连接数据库URL  *******/
  private static String url = "";

  /*****  连接数据库DRIVER  *******/
  private static String driver = "";

  /*****  连接数据的用户  *******/
  private static String user = "";

  /*****  连接数据库密码  *******/
  private static String password = "";

  /*****   SAP的CLIENT *******/
  private static String client = "";

  /*****  登陆SAP的用户  *******/
  private static String userid = "";

  /*****  登陆SAP密码  *******/
  private static String passw = "";

  /*****  登陆SAP语言  *******/
  private static String language = "";

  /*****  SAP服务器的IP  *******/
  private static String host = "";

  /*****  SAP系统编号  *******/
  private static String syscode = "";

  /*****  上传销售调SAP的ABAP路径  *******/
  private static String f_sales = "";

  /*****  上传盘点调SAP的ABAP路径  *******/
  private static String f_inventory = "";

  /*****  读取下传映射目录outbound  *******/
  private static String localdown = "";

  /*****  存放上传生成的IDOC到映射目录inbound  *******/
  private static String localup = "";

  /*****  上传生成IDOC文件所需的SAP端口  *******/
  private static String sap_port = "";

  /*****  上传生成IDOC文件时控制记录行数  *******/
  private static int rowCount = 0;

  /*****  上传生成IDOC文件时控制记录行数  *******/
  private static int rowInventory = 0;

  /*****  上传时间间隔(计算方式:Minute)  *******/
  private static String upSpaceMinute = "";

  /*****  上传开始时间  *******/
  private static String upStarTime = "";

  /*****  上传结束时间  *******/
  private static String upEndTime = "";

  /*****  下传时间间隔(计算方式:Minute)  *******/
  private static String downSpaceMinute = "";

  /*****  下传开始时间  *******/
  private static String downStarTime = "";

  /*****  下传结束时间  *******/
  private static String downEndTime = "";

  /*****  第一次执行上传  *******/
  private static String upFirst = "0";

  /*****  第一次下传  *******/
  private static String downFirst = "0";

  /*****  文件保存的天数  *******/
  private static int back = 0;
  /*****    *******/

  public GetProperty() {

  }

  public void getPropertiesData() {
    try {
      Operate oper = new Operate();
      Properties properties = oper.getProperties("server.properties");
      if (properties!=null) {
        url = properties.getProperty("url").trim();
        driver = properties.getProperty("driver").trim();
        user = properties.getProperty("user").trim();
        password = properties.getProperty("password").trim();
        client = properties.getProperty("client");
        userid = properties.getProperty("userid");
        passw = properties.getProperty("passw");
        language = properties.getProperty("language");
        host = properties.getProperty("host");
        syscode = properties.getProperty("syscode");
        f_sales = properties.getProperty("f_sales");
        f_inventory = properties.getProperty("f_inventory");
        localdown = properties.getProperty("localdown");
        localup = properties.getProperty("localup");
        sap_port = properties.getProperty("sap_port");
        try {
          rowCount = Integer.valueOf(properties.getProperty("rowCount").trim()).intValue();
        }catch(Exception ex) {
          rowCount = 10;
        }

        try {
          rowInventory = Integer.valueOf(properties.getProperty("rowInventory").trim()).intValue();
        }catch(Exception ex) {
          rowCount = 10;
        }
        upSpaceMinute = properties.getProperty("upSpaceMinute");
        upStarTime = properties.getProperty("upStarTime");
        upEndTime = properties.getProperty("upEndTime");
        downSpaceMinute = properties.getProperty("downSpaceMinute");
        upStarTime = properties.getProperty("upStarTime");
        downStarTime = properties.getProperty("downStarTime");
        downEndTime = properties.getProperty("downEndTime");
        try {
          back = Integer.valueOf(properties.getProperty("back").trim()).intValue();
        }catch(Exception ex) {
          back = 10;
        }
      }

    }catch(Exception ex) {
      System.out.println("FieldData's getPropertiesData is Error!");
      ex.printStackTrace();
    }
  }

  /**
   * 连接池名称
   * @return
   */
/*
    public String getPoolName() {
    return poolName;
  }
*/
  /**
   * 最大连接数
   * @return
   */
/*
  public String getMaxConn() {
    return maxConn;
  }
*/
  /**
   * 取得数据库连接的URL
   * @return
   */
  public String getUrl() {
    return url;
  }

  /**
   * 得到取数据库的驱动
   * @return
   */
  public String getDriver() {
    return driver;
  }

  /**
   * 得到登陆数据库的用户名
   * @return
   */
  public String getUser() {
    return user;
  }

  /**
   * 得到登陆数据库的密码
   * @return
   */
  public String getPassword() {
    return password;
  }

  /**
   * 登陆SAP的CLIENT
   * @return
   */
  public String getClient() {
    return client;
  }

  /**
   * 登陆SAP的用户
   * @return
   */
  public String getUserid() {
    return userid;
  }

  /**
   * 登陆SAP的用户密码
   * @return
   */
  public String getPassw() {
    return passw;
  }

  /**
   * 得到登陆的语言
   * @return
   */
  public String getLanguage() {
    return language;
  }

  /**
   * 得到SAP服务器的IP
   * @return
   */
  public String getHost() {
    return host;
  }

  /**
   * 得到SAP系统的代码
   * @return
   */
  public String getSyscode() {
    return syscode;
  }

  /**
   * 上传SAP路径销售数据,调ABAP路径
   * @return
   */
  public String getF_sales() {
    return f_sales;
  }

  /**
   * 上传SAP路径盘点数据,调ABAP路径
   * @return
   */
  public String getF_inventory() {
    return f_inventory;
  }

  /**
   * 从SAP读取文件
   * @return
   */
  public String getLocaldown() {
    return localdown;
  }

  /**
   * 存放上传数据文件的路径
   * @return
   */
  public String getLocalup() {
    return localup;
  }

  /**
   * 上传SAP的端口
   * @return
   */
  public String getSapPort() {
    return sap_port;
  }

  /**
   * 上传生成销售数据IDOC文件,每个文件的记录条数
   * @return
   */
  public int getRowCount() {
    return rowCount;
  }
  /**
   * 上传生成盘点IDOC文件,每个文件的记录条数
   * @return
   */
  public int getRowInventory() {
    return rowInventory;
  }


  /**
   * 上传时间间隔
   * @return
   */
  public String getUpSpaceMinute() {
    return upSpaceMinute;
  }


  /**
   * 上传开始时间
   * @return
   */
  public String getUpStarTime() {
    return upStarTime;
  }

  /**
   * 上传结束时间
   * @return
   */
  public String getUpEndTime() {
    return upEndTime;
  }

  /**
   * 下传时间间隔
   * @return
   */
  public String getDownSpaceMinute() {
    return downSpaceMinute;
  }

  /**
   * 下传开始时间
   * @return
   */
  public String getDownStarTime() {
    return downStarTime;
  }

  /**
   * 下传结束时间
   * @return
   */
  public String getDownEndTime() {
    return downEndTime;
  }

  /**
   * 第一次上传
   * @return
   */
  public String getUpFirst() {
    return upFirst;
  }

  /**
   * 设置第一次上传
   * @param str
   */
  public void setUpFirst(String str) {
    upFirst = str;
  }

  /**
   * 第一次下传
   * @return
   */
  public String getDownFirst() {
    return downFirst;
  }

  /**
   * 设置第一次下传
   * @param str
   */
  public void setDownFirst(String str) {
    downFirst = str;
  }

  public int getBack() {
    return back;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -