示例#1
0
 public DbConfig getDevDbConfig() {
   String ip = "";
   int port = 1521;
   if (getDbIp().indexOf(":") > 0) {
     ip = getDbIp().split(":")[0];
     port = Integer.parseInt(getDbIp().split(":")[1]);
   } else {
     ip = getDbIp();
     port = getDriverType().getDefPort();
   }
   DbConfig config =
       new DbConfig(
           getDriverType(), ip, port, getDbUserName(), getDbPasswd(), getDriverType().getDefSID());
   if (!CheckUtils.isEmpty(getDbName())) config.setConnSID(getDbName());
   return config;
 }
示例#2
0
  public DbConfig getProjDbConfig() {
    if (null == getCurrentPj()) return null;
    String dbType = getCurrentPj().getDbType();
    DbConfig config = null;
    if (DBType.ORACLE.getText().equalsIgnoreCase(dbType))
      config =
          new DbConfig(
              DriverType.ORACLE,
              getCurrentPj().getDbIp(),
              getCurrentPj().getDbUser(),
              getCurrentPj().getDbPasswd());
    else
      config =
          new DbConfig(
              DriverType.SQLSERVER,
              getCurrentPj().getDbIp(),
              getCurrentPj().getDbUser(),
              getCurrentPj().getDbPasswd());

    if (!CheckUtils.isEmpty(getCurrentPj().getDbName()))
      config.setConnSID(getCurrentPj().getDbName());
    return config;
  }