|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.postgresql.core.Parser
public class Parser
Basic query parser infrastructure.
| Constructor Summary | |
|---|---|
Parser()
|
|
| Method Summary | |
|---|---|
static boolean |
charTerminatesIdentifier(char c)
|
static boolean |
isDollarQuoteContChar(char c)
Checks if a character is valid as the second or later character of a dollar quoting tag. |
static boolean |
isDollarQuoteStartChar(char c)
Checks if a character is valid as the start of a dollar quoting tag. |
static boolean |
isIdentifierContChar(char c)
Checks if a character is valid as the second or later character of an identifier. |
static boolean |
isIdentifierStartChar(char c)
Checks if a character is valid as the start of an identifier. |
static boolean |
isOperatorChar(char c)
|
static boolean |
isSpace(char c)
|
static JdbcCallParseInfo |
modifyJdbcCall(String jdbcSql,
boolean stdStrings,
int serverVersion,
int protocolVersion)
Converts JDBC-specific callable statement escapes {@code { [? |
static int |
parseBlockComment(char[] query,
int offset)
Test if the / character at offset starts a block comment, and return the position of the last / character. |
static int |
parseDollarQuotes(char[] query,
int offset)
Test if the dollar character ($) at the given offset starts a dollar-quoted string and return the offset of the ending dollar character. |
static int |
parseDoubleQuotes(char[] query,
int offset)
Find the end of the double-quoted string starting at the given offset. |
static List<NativeQuery> |
parseJdbcSql(String query,
boolean standardConformingStrings,
boolean withParameters,
boolean splitStatements)
Parses JDBC query into PostgreSQL's native format. |
static int |
parseLineComment(char[] query,
int offset)
Test if the - character at offset starts a -- style line comment, and return the position of the first \r or \n character. |
static int |
parseSingleQuotes(char[] query,
int offset,
boolean standardConformingStrings)
Find the end of the single-quoted string starting at the given offset. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Parser()
| Method Detail |
|---|
public static List<NativeQuery> parseJdbcSql(String query,
boolean standardConformingStrings,
boolean withParameters,
boolean splitStatements)
query - jdbc query to parsestandardConformingStrings - whether to allow backslashes to be used as escape characters
in single quote literalswithParameters - whether to replace ?, ? with $1, $2, etcsplitStatements - whether to split statements by semicolon
public static int parseSingleQuotes(char[] query,
int offset,
boolean standardConformingStrings)
query - queryoffset - start offsetstandardConformingStrings - standard conforming strings
public static int parseDoubleQuotes(char[] query,
int offset)
query - queryoffset - start offset
public static int parseDollarQuotes(char[] query,
int offset)
query - queryoffset - start offset
public static int parseLineComment(char[] query,
int offset)
query - queryoffset - start offset
public static int parseBlockComment(char[] query,
int offset)
query - queryoffset - start offset
public static boolean isSpace(char c)
c - character
public static boolean isOperatorChar(char c)
c - character
public static boolean isIdentifierStartChar(char c)
c - the character to check
public static boolean isIdentifierContChar(char c)
c - the character to check
public static boolean charTerminatesIdentifier(char c)
c - character
public static boolean isDollarQuoteStartChar(char c)
c - the character to check
public static boolean isDollarQuoteContChar(char c)
c - the character to check
public static JdbcCallParseInfo modifyJdbcCall(String jdbcSql,
boolean stdStrings,
int serverVersion,
int protocolVersion)
throws SQLException
{ [? =] call <some_function> [(?,
[?,..])] } into the PostgreSQL format which is select <some_function> (?, [?, ...]) as
result or select * from <some_function> (?, [?, ...]) as result (7.3)
jdbcSql - sql text with JDBC escapesstdStrings - if backslash in single quotes should be regular character or escape oneserverVersion - server versionprotocolVersion - protocol version
SQLException - if given SQL is malformed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||