private Table _getTable(String catalog, String schema, String tableName) throws SQLException {
    if (tableName == null || tableName.trim().length() == 0)
      throw new IllegalArgumentException("tableName must be not empty");
    catalog = StringHelper.defaultIfEmpty(catalog, null);
    schema = StringHelper.defaultIfEmpty(schema, null);

    Connection conn = getConnection();
    DatabaseMetaData dbMetaData = conn.getMetaData();
    ResultSet rs = dbMetaData.getTables(catalog, schema, tableName, null);
    while (rs.next()) {
      Table table = createTable(conn, rs);
      return table;
    }
    return null;
  }
  /**
   * Stores value of previously defined XML node
   *
   * @param text - value of node
   */
  public void setValue(String text) {
    readyForNewLine = false;
    tagIsEmpty = false;
    finishTag();

    if (lastTagHadAttributes) {
      writer.write(
          LF
              + WikiTableDriver.DELIM
              + WikiTableDriver.QUOTES
              + WikiTableDriver.SET_VALUE
              + WikiTableDriver.QUOTES
              + WikiTableDriver.DELIM);
      quickNodeValue = false;
    } else {
      String startTag =
          StringHelper.replace(
              writer.substring(startPointer),
              WikiTableDriver.START_NODE,
              WikiTableDriver.SET_NODE_VALUE);

      if (this.useLineSeparateBetweenTags) {
        writer.write(LF + WikiTableDriver.DELIM);
      }

      writer.setPointer(startPointer);
      writer.write(startTag);
      quickNodeValue = true;
    }

    writeText(writer, text);
    writer.write(WikiTableDriver.DELIM);
  }
 public void set_IsBuyForCombo(String value) {
   if (StringHelper.isNullOrEmpty(value)) {
     value = this._isBuyForCurrent ? Language.Buy : Language.Sell;
   }
   this._isBuyForCombo = value;
   this.setIsBuyForCurrent(value.equalsIgnoreCase(Language.Buy));
 }
  public void set_PriceInfo(DateTime timestamp, boolean priceIsQuote) {
    String info =
        StringHelper.format(
            "MakeOrderAccount.[set_PriceInfo] timestamp={0}, priceIsQuote={1}",
            new Object[] {timestamp, priceIsQuote});
    TradingConsole.traceSource.trace(TraceType.Information, info);

    this._priceTimestamp = timestamp;
    this._priceIsQuote = priceIsQuote;
  }
Exemple #5
0
 /** Set the text of an XML element, safely encode it if needed. */
 @NotNull
 public static Element setSafeXmlText(@NotNull Element element, @NotNull String text) {
   final Character first = firstCharacter(text);
   final Character last = lastCharacter(text);
   if (!StringHelper.isXmlCharacterData(text)
       || first != null && Character.isWhitespace(first)
       || last != null && Character.isWhitespace(last)) {
     element.setAttribute("encoding", "base64");
     final String encoded = new String(Base64.encodeBase64(text.getBytes()));
     element.setText(encoded);
   } else {
     element.setText(text);
   }
   return element;
 }
 public void set_LotString(String value) {
   if (StringHelper.isNullOrEmpty(value)) {
     if (this._isBuyForCurrent) {
       this._buyLot = BigDecimal.ZERO;
     } else {
       this._sellLot = BigDecimal.ZERO;
     }
   } else {
     if (this._isBuyForCurrent) {
       this._buyLot = AppToolkit.convertStringToBigDecimal(value);
     } else {
       this._sellLot = AppToolkit.convertStringToBigDecimal(value);
     }
   }
 }
 public void unbindOutstanding() {
   if (!StringHelper.isNullOrEmpty(this._outstandingKey)
       && this._bindingSourceForOutstanding != null) {
     RelationOrder.unbind(this._outstandingKey, this._bindingSourceForOutstanding);
   }
 }
Exemple #8
0
  private static boolean shouldIgnoreCase(@NotNull String pattern, boolean noSmartCase) {
    boolean sc = !noSmartCase && Options.getInstance().isSet("smartcase");
    boolean ic = Options.getInstance().isSet("ignorecase");

    return ic && !(sc && StringHelper.containsUpperCase(pattern));
  }
Exemple #9
0
 @Nullable
 private static String getSafeChildText(@NotNull Element element, @NotNull String name) {
   final Element child = element.getChild(name);
   return child != null ? StringHelper.getSafeXmlText(child) : null;
 }
Exemple #10
0
 @NotNull
 private static Element createElementWithText(@NotNull String name, @NotNull String text) {
   return StringHelper.setSafeXmlText(new Element(name), text);
 }