Package com.impossibl.postgres.jdbc.SQLTextTree

Examples of com.impossibl.postgres.jdbc.SQLTextTree.StringLiteralPiece


    escape.removeAll(WhitespacePiece.class, false);

    checkSize(escape, 2);

    StringLiteralPiece dateLit = getNode(escape, 1, StringLiteralPiece.class);

    Date date;
    try {
      date = Date.valueOf(dateLit.getText());
    }
    catch (Exception e1) {
      throw new SQLException("invalid date format in escape (" + escape.getStartPos() + ")");
    }
View Full Code Here


    escape.removeAll(WhitespacePiece.class, false);

    checkSize(escape, 2);

    StringLiteralPiece timeLit = getNode(escape, 1, StringLiteralPiece.class);

    Time time;
    try {
      time = Time.valueOf(timeLit.toString());
    }
    catch (Exception e1) {
      throw new SQLException("invalid time format in escape (" + escape.getStartPos() + ")");
    }
View Full Code Here

    escape.removeAll(WhitespacePiece.class, false);

    checkSize(escape, 2);

    StringLiteralPiece tsLit = getNode(escape, 1, StringLiteralPiece.class);

    Timestamp timestamp;
    try {
      timestamp = Timestamp.valueOf(tsLit.toString());
    }
    catch (Exception e) {
      throw new SQLException("invalid timestamp format in escape (" + escape.getStartPos() + ")");
    }
View Full Code Here

  static Node literal(Number val) {
    return new NumericLiteralPiece(val.toString(), -1);
  }

  static Node literal(String text) {
    return new StringLiteralPiece(text, -1);
  }
View Full Code Here

      if (lookAhead(sql, ndx) == '$') {
        final String ident = sql.substring(start, ndx + 2);
        final int pos = sql.indexOf(ident, ndx + 2);
        if (pos != -1) {
          String quotedText = sql.substring(ndx + 2, pos);
          parent.add(new StringLiteralPiece(quotedText, ident, start));
          return pos + ident.length();
        }
        else {
          ++ndx;
          break;
View Full Code Here

      }

      ++ndx;
    } while (true);

    StringLiteralPiece literalPiece = new StringLiteralPiece(sql.substring(start, ndx), start);
    parent.add(literalPiece);

    return ndx + 1;
  }
View Full Code Here

TOP

Related Classes of com.impossibl.postgres.jdbc.SQLTextTree.StringLiteralPiece

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.