Search in sources :

Example 1 with EscapeParserMode

use of org.firebirdsql.jdbc.escape.FBEscapedParser.EscapeParserMode in project jaybird by FirebirdSQL.

the class FBConnection method getEscapedParser.

/**
 * Returns the FBEscapedParser instance for this connection.
 *
 * @return Instance of FBEscapedParser
 */
protected FBEscapedParser getEscapedParser() {
    if (escapedParser == null) {
        DatabaseParameterBuffer dpb = getDatabaseParameterBuffer();
        EscapeParserMode mode = dpb.hasArgument(DatabaseParameterBufferExtension.USE_STANDARD_UDF) ? EscapeParserMode.USE_STANDARD_UDF : EscapeParserMode.USE_BUILT_IN;
        escapedParser = new FBEscapedParser(mode);
    }
    return escapedParser;
}
Also used : FBEscapedParser(org.firebirdsql.jdbc.escape.FBEscapedParser) EscapeParserMode(org.firebirdsql.jdbc.escape.FBEscapedParser.EscapeParserMode) DatabaseParameterBuffer(org.firebirdsql.gds.DatabaseParameterBuffer)

Example 2 with EscapeParserMode

use of org.firebirdsql.jdbc.escape.FBEscapedParser.EscapeParserMode in project jaybird by FirebirdSQL.

the class FBStatement method nativeSQL.

protected String nativeSQL(String sql) throws SQLException {
    if (connection != null) {
        return connection.nativeSQL(sql);
    } else {
        DatabaseParameterBuffer dpb = gdsHelper.getDatabaseParameterBuffer();
        EscapeParserMode mode = dpb.hasArgument(DatabaseParameterBufferExtension.USE_STANDARD_UDF) ? EscapeParserMode.USE_STANDARD_UDF : EscapeParserMode.USE_BUILT_IN;
        return new FBEscapedParser(mode).parse(sql);
    }
}
Also used : FBEscapedParser(org.firebirdsql.jdbc.escape.FBEscapedParser) EscapeParserMode(org.firebirdsql.jdbc.escape.FBEscapedParser.EscapeParserMode) DatabaseParameterBuffer(org.firebirdsql.gds.DatabaseParameterBuffer)

Aggregations

DatabaseParameterBuffer (org.firebirdsql.gds.DatabaseParameterBuffer)2 FBEscapedParser (org.firebirdsql.jdbc.escape.FBEscapedParser)2 EscapeParserMode (org.firebirdsql.jdbc.escape.FBEscapedParser.EscapeParserMode)2