Package org.firebirdsql.jdbc.escape
Class FBEscapedFunctionHelper
java.lang.Object
org.firebirdsql.jdbc.escape.FBEscapedFunctionHelper
Helper class for escaped functions.
- Author:
- Roman Rokytskyy, Mark Rotteveel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringProduce a function call for theabsUDF function.static StringProduce a function call for theacosUDF function.static StringProduce a function call for theasinUDF function.static StringProduce a function call for theatanUDF function.static StringProduce a function call for theatan2UDF function.static StringProduce a function call for theceilingUDF function.static StringconvertTemplate(String functionCall, FBEscapedParser.EscapeParserMode mode) Convert escaped function call using function template.static StringProduce a function call for thecosUDF function.static StringProduce a function call for thecotUDF function.static StringProduce a function call for thefloorUDF function.static StringProduce a function call for thelog10UDF function.static StringProduce a function call for themodUDF function.parseArguments(String functionCall) Extract function arguments from the function call.static StringparseFunction(String functionCall) Extract function name from the function call.static StringProduce a function call for thepiUDF function.static StringProduce a function call for therandUDF function.static StringProduce a function call for thesignUDF function.static StringProduce a function call for thesinUDF function.static StringProduce a function call for thesqrtUDF function.static StringProduce a function call for thetan UDF function.
-
Constructor Details
-
FBEscapedFunctionHelper
public FBEscapedFunctionHelper()
-
-
Method Details
-
parseFunction
Extract function name from the function call.- Parameters:
functionCall- escaped function call.- Returns:
- name of the function.
- Throws:
FBSQLParseException- if parse error occurs.
-
parseArguments
Extract function arguments from the function call. This method parses escaped function call string and extracts function parameters from it.- Parameters:
functionCall- escaped function call.- Returns:
- list of parameters of the function.
- Throws:
FBSQLParseException- if parse error occurs.
-
convertTemplate
public static String convertTemplate(String functionCall, FBEscapedParser.EscapeParserMode mode) throws FBSQLParseException Convert escaped function call using function template.- Parameters:
functionCall- escaped function call.- Returns:
- server-side representation of the function call or
nullif no template found. - Throws:
FBSQLParseException- if escaped function call has incorrect syntax.
-
abs
Produce a function call for theabsUDF function. The syntax of theabsfunction is{fn abs(number)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
acos
Produce a function call for theacosUDF function. The syntax of theacosfunction is{fn acos(float)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
asin
Produce a function call for theasinUDF function. The syntax of theasinfunction is{fn asin(float)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
atan
Produce a function call for theatanUDF function. The syntax of theatanfunction is{fn atan(float)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
atan2
Produce a function call for theatan2UDF function. The syntax of theatan2function is{fn atan2(float1, float2)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
ceiling
Produce a function call for theceilingUDF function. The syntax of theceilingfunction is{fn ceiling(number)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
cos
Produce a function call for thecosUDF function. The syntax of thecosfunction is{fn cos(float)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
cot
Produce a function call for thecotUDF function. The syntax of thecotfunction is{fn cot(float)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
floor
Produce a function call for thefloorUDF function. The syntax of thefloorfunction is{fn floor(number)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
log10
Produce a function call for thelog10UDF function. The syntax of thelog10function is{fn log10(number)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
mod
Produce a function call for themodUDF function. The syntax of themodfunction is{fn mod(integer1, integer2)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
pi
Produce a function call for thepiUDF function. The syntax of thepifunction is{fn pi()}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
rand
Produce a function call for therandUDF function. The syntax for therandfunction is{fn rand()}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
sign
Produce a function call for thesignUDF function. The syntax for thesignfunction is{fn sign(number)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
sin
Produce a function call for thesinUDF function. The syntax for thesinfunction is{fn sin(float)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
sqrt
Produce a function call for thesqrtUDF function. The syntax for thesqrtfunction is{fn sqrt(number)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
tan
Produce a function call for thetan UDF function. The syntax for thetanfunction is{fn tan(float)}.- Parameters:
params- The parameters to be used in the call- Throws:
FBSQLParseException- if there is an error with the parameters
-
getSupportedNumericFunctions
- Returns:
- Set of JDBC numeric functions supported (as defined in appendix D.1 of JDBC 4.1)
-
getSupportedStringFunctions
- Returns:
- Set of JDBC string functions supported (as defined in appendix D.2 of JDBC 4.1)
-
getSupportedTimeDateFunctions
- Returns:
- Set of JDBC time and date functions supported (as defined in appendix D.3 of JDBC 4.1)
-
getSupportedSystemFunctions
- Returns:
- Set of JDBC system functions supported (as defined in appendix D.4 of JDBC 4.1)
-