org.firebirdsql.jdbc

Class FBEscapedFunctionHelper


public class FBEscapedFunctionHelper
extends java.lang.Object

Helper class for escaped functions.
Author:
Roman Rokytskyy

Method Summary

static String
_char(String[] params)
Produce a function call for the char UDF function.
static String
abs(String[] params)
Produce a function call for the abs UDF function.
static String
acos(String[] params)
Produce a function call for the acos UDF function.
static String
ascii(String[] params)
Produce a function call for the ascii UDF function.
static String
asin(String[] params)
Produce a function call for the asin UDF function.
static String
atan(String[] params)
Produce a function call for the atan UDF function.
static String
atan2(String[] params)
Produce a function call for the atan2 UDF function.
static String
ceiling(String[] params)
Produce a function call for the ceiling UDF function.
static String
convertTemplate(String functionCall, int mode)
Convert escaped function call using function template.
static String
cos(String[] params)
Produce a function call for the cos UDF function.
static String
cot(String[] params)
Produce a function call for the cot UDF function.
static String
floor(String[] params)
Produce a function call for the floor UDF function.
static String
lcase(String[] params)
Produce a function call for the lcase UDF function.
static String
length(String[] params)
Produce a function call for the length UDF function.
static String
log(String[] params)
Produce a function call for the log UDF function.
static String
log10(String[] params)
Produce a function call for the log10 UDF function.
static String
ltrim(String[] params)
Produce a function call for the ltrim UDF function.
static String
mod(String[] params)
Produce a function call for the mod UDF function.
static List
parseArguments(String functionCall)
Extract function arguments from the function call.
static String
parseFunction(String functionCall)
Extract function name from the function call.
static String
pi(String[] params)
Produce a function call for the pi UDF function.
static String
rand(String[] params)
Produce a function call for the rand UDF function.
static String
rtrim(String[] params)
Produce a function call for the rtrim UDF function.
static String
sign(String[] params)
Produce a function call for the sign UDF function.
static String
sin(String[] params)
Produce a function call for the sin UDF function.
static String
sqrt(String[] params)
Produce a function call for the sqrt UDF function.
static String
tan(String[] params)
Produce a function call for the tan UDF function.

Method Details

_char

public static String _char(String[] params)
            throws FBSQLParseException
Produce a function call for the char UDF function. The syntax of the char function is {fn char(integer)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

abs

public static String abs(String[] params)
            throws FBSQLParseException
Produce a function call for the abs UDF function. The syntax of the abs function 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

public static String acos(String[] params)
            throws FBSQLParseException
Produce a function call for the acos UDF function. The syntax of the acos function is {fn acos(float)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

ascii

public static String ascii(String[] params)
            throws FBSQLParseException
Produce a function call for the ascii UDF function. The syntax of the ascii function is {fn ascii(string)}
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

asin

public static String asin(String[] params)
            throws FBSQLParseException
Produce a function call for the asin UDF function. The syntax of the asin function 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

public static String atan(String[] params)
            throws FBSQLParseException
Produce a function call for the atan UDF function. The syntax of the atan function 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

public static String atan2(String[] params)
            throws FBSQLParseException
Produce a function call for the atan2 UDF function. The syntax of the atan2 function 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

public static String ceiling(String[] params)
            throws FBSQLParseException
Produce a function call for the ceiling UDF function. The syntax of the ceiling function is {fn ceiling(number)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

convertTemplate

public static String convertTemplate(String functionCall,
                                     int mode)
            throws FBSQLParseException
Convert escaped function call using function template.
Parameters:
functionCall - escaped function call.
Returns:
server-side representation of the function call or null if no template found.
Throws:
FBSQLParseException - if escaped function call has incorrect syntax.

cos

public static String cos(String[] params)
            throws FBSQLParseException
Produce a function call for the cos UDF function. The syntax of the cos function 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

public static String cot(String[] params)
            throws FBSQLParseException
Produce a function call for the cot UDF function. The syntax of the cot function 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

public static String floor(String[] params)
            throws FBSQLParseException
Produce a function call for the floor UDF function. The syntax of the floor function is {fn floor(number)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

lcase

public static String lcase(String[] params)
            throws FBSQLParseException
Produce a function call for the lcase UDF function. The syntax of the lcase function is {fn lcase(string)}
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

length

public static String length(String[] params)
            throws FBSQLParseException
Produce a function call for the length UDF function. The syntax of the length function is {fn length(string)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

log

public static String log(String[] params)
            throws FBSQLParseException
Produce a function call for the log UDF function. The syntax of the log function is {fn log(number)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

log10

public static String log10(String[] params)
            throws FBSQLParseException
Produce a function call for the log10 UDF function. The syntax of the log10 function is {fn log10(number)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

ltrim

public static String ltrim(String[] params)
            throws FBSQLParseException
Produce a function call for the ltrim UDF function. The syntax of the ltrim function is {fn ltrim(string)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

mod

public static String mod(String[] params)
            throws FBSQLParseException
Produce a function call for the mod UDF function. The syntax of the mod function 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

parseArguments

public static List parseArguments(String functionCall)
            throws FBSQLParseException
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.

parseFunction

public static String parseFunction(String functionCall)
            throws FBSQLParseException
Extract function name from the function call.
Parameters:
functionCall - escaped function call.
Returns:
name of the function.
Throws:
FBSQLParseException - if parse error occurs.

pi

public static String pi(String[] params)
            throws FBSQLParseException
Produce a function call for the pi UDF function. The syntax of the pi function is {fn pi()}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

rand

public static String rand(String[] params)
            throws FBSQLParseException
Produce a function call for the rand UDF function. The syntax for the rand function is {fn rand()}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

rtrim

public static String rtrim(String[] params)
            throws FBSQLParseException
Produce a function call for the rtrim UDF function. The syntax of the rtrim function is {fn rtrim(string)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

sign

public static String sign(String[] params)
            throws FBSQLParseException
Produce a function call for the sign UDF function. The syntax for the sign function 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

public static String sin(String[] params)
            throws FBSQLParseException
Produce a function call for the sin UDF function. The syntax for the sin function 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

public static String sqrt(String[] params)
            throws FBSQLParseException
Produce a function call for the sqrt UDF function. The syntax for the sqrt function 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

public static String tan(String[] params)
            throws FBSQLParseException
Produce a function call for the tan UDF function. The syntax for the tan function is {fn tan(float)}.
Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

Copyright B) 2001 David Jencks and other authors. All rights reserved.