| java.lang.Object org.hsqldb.Library
Library | public class Library (Code) | | Provides the HSQLDB implementation of standard Open Group SQL CLI
Extended Scalar Functions and other public HSQLDB SQL functions.
All methods here that have a Connection parameter are dummies and should
not be called from user supplied Java procedure or trigger code. Use real
SQL functions should be called instead in these instances.
Extensively rewritten and extended in successive versions of HSQLDB.
author: Thomas Mueller (Hypersonic SQL Group) version: 1.8.0 since: Hypersonic SQL |
Method Summary | |
public static double | abs(double d) Returns the absolute value of the given double value. | public static Integer | ascii(String s) Returns the Unicode code value of the leftmost character of
s as an int . | public static Integer | bitLength(String s) Returns the number of bits in the given String . | public static int | bitand(int i, int j) Returns the bit-wise logical and of the given
integer values. | public static int | bitor(int i, int j) Returns the bit-wise logical or of the given
integer values. | public static int | bitxor(int i, int j) Returns the bit-wise logical xor of the given
integer values. | public static String | character(int code) Returns the character string corresponding to the given ASCII
(or Unicode) value. | public static String | concat(String s1, String s2) Returns a String object that is the result of an
concatenation of the given String objects. | public static double | cot(double d) Returns the cotangent of the given double value
expressed in radians. | public static Date | curdate(Connection c) Returns the current date as a date value. | public static Time | curtime(Connection c) Returns the current local time as a time value. | public static String | database(Connection conn) Returns the name of the database corresponding to this connection. | public static Long | datediff(String datepart, Timestamp d1, Timestamp d2) Returns the number of units elapsed between two dates.
The datapart parameter indicates the part to be used for computing the
difference. | public static String | dayname(Date d) Returns a character string containing the name of the day
(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday )
for the day portion of the given java.sql.Date . | public static Integer | dayofmonth(Date d) Returns the day of the month from the given date value, as an integer
value in the range of 1-31. | public static Integer | dayofweek(Date d) Returns the day of the week from the given date value, as an integer
value in the range 1-7, where 1 represents Sunday. | public static Integer | dayofyear(Date d) Returns the day of the year from the given date value, as an integer
value in the range 1-366. | public static int | difference(String s1, String s2) Returns a count of the characters that do not match when comparing
the 4 digit numeric SOUNDEX character sequences for the
given String objects. | static int | functionID(String fname) | static HashMap | getAliasMap() | public static boolean | getAutoCommit(Connection conn) Retrieves the autocommit status of this connection. | public static String | getDatabaseFullProductVersion() Retrieves the full version number of this database product. | public static int | getDatabaseMajorVersion() Retrieves the major version number of this database. | public static int | getDatabaseMinorVersion() Retrieves the major version number of this database. | public static String | getDatabaseProductName() Retrieves the name of this database product. | public static String | getDatabaseProductVersion() Retrieves the version number of this database product. | public static String | hexToRaw(String s) Converts a String of hexidecimal digit characters to a raw
binary value, represented as a String .
The given String object must consist of a sequence of
4 digit hexidecimal character substrings. If its length is not
evenly divisible by 4, null is returned. | public static Integer | hour(Time t) Returns the hour from the given time value, as an integer value in
the range of 0-23. | public static int | identity() Retrieves the last auto-generated integer indentity value
used by this connection. | public static String | insert(String s1, int start, int length, String s2) Returns a character sequence which is the result of writing the
first length number of characters from the second
given String over the first string. | static Object | invoke(int fID, Object[] params) | public static boolean | isReadOnlyConnection(Connection conn) Retrieves whether this connection is in read-only mode. | public static boolean | isReadOnlyDatabase(Connection c) Dummy method. | public static boolean | isReadOnlyDatabaseFiles(Connection c) Retrieves whether the files of this database are in read-only mode. | public static String | lcase(String s) Returns a copy of the given String , with all upper case
characters converted to lower case. | public static String | left(String s, int count) Returns the leftmost count characters from the given
String . | public static Integer | length(String s) Returns the number of characters in the given String . | public static int | locate(String search, String s, Integer start) Returns the starting position of the first occurrence of
the given search String object within
the given String object, s .
The search for the first occurrence of search begins with
the first character position in s , unless the optional
argument, start , is specified (non-null). | public static double | log10(double x) Returns the base 10 logarithm of the given double value. | public static String | ltrim(String s) Returns the characters of the given String , with the
leading spaces removed. | public static Integer | minute(Time t) Returns the minute from the given time value, as integer value in
the range of 0-59. | public static int | mod(int i1, int i2) Returns the remainder (modulus) of the first given integer divided
by the second. | public static Integer | month(Date d) Returns the month from the given date value, as an integer value in the
range of 1-12. | public static String | monthname(Date d) Returns a character string containing the name of month
(January, February, March, April, May, June, July, August,
September, October, November, December) for the month portion of
the given date value. | public static Timestamp | now(Connection c) Returns the current date and time as a timestamp value. | public static Integer | octetLength(String s) Returns the number of bytes in the given String . | public static double | pi() Returns the constant value, pi. | public static int | position(String search, String s) As locate but from start position l. | public static Integer | quarter(Date d) Returns the quarter of the year in the given date value, as an integer
value in the range of 1-4. | public static double | rand(Integer seed) Returns the next pseudorandom, uniformly distributed double value
between 0.0 and 1.0 from a single, system-wide random number generator's
sequence, optionally re-seeding (and thus resetting) the generator sequence. | public static String | rawToHex(String s) Converts a raw binary value, as represented by the given
String , to the equivalent String
of hexidecimal digit characters. | public static String | repeat(String s, Integer count) Returns a String composed of the given String ,
repeated count times. | public static String | replace(String s, String replace, String with) | public static String | right(String s, int count) Returns the rightmost count characters of the given
String , s . | public static double | round(double d, int p) Returns the given double value, rounded to the given
int places right of the decimal point. | public static double | roundMagic(double d) Retrieves a magically rounded double value produced
from the given double value. | public static String | rtrim(String s) Returns the characters of the given String , with trailing
spaces removed. | public static Integer | second(Time d) Returns the second of the given time value, as an integer value in
the range of 0-59. | public static int | sign(double d) Returns an indicator of the sign of the given double
value. | public static String | soundex(String s) Returns a four character code representing the sound of the given
String . | public static String | space(int count) Returns a String consisting of count spaces, or
null if count is less than zero. | public static String | substring(String s, int start, Integer length) Returns the characters from the given String , starting at
the indicated one-based start position and extending the
(optional) indicated length . | public static String | to_char(java.util.Date d, String format) | public static String | trim(String s, String trimstr, boolean leading, boolean trailing) Returns the character sequence s , with the leading,
trailing or both the leading and trailing occurences of the first
character of the character sequence trimstr removed. | public static double | truncate(double d, int p) Returns the given double value, truncated to
the given int places right of the decimal point. | public static String | ucase(String s) Returns a copy of the given String , with all lower case
characters converted to upper case using the default Java method. | public static String | user(Connection conn) Returns the user's authorization name (the user's name as known to this
database). | public static Integer | week(Date d) Returns the week of the year from the given date value, as an integer
value in the range of 1-53. | public static Integer | year(Date d) Returns the year from the given date value, as an integer value in
the range of 1-9999. |
ascii | final static int ascii(Code) | | |
bitLength | final static int bitLength(Code) | | |
bitand | final static int bitand(Code) | | |
bitor | final static int bitor(Code) | | |
bitxor | final static int bitxor(Code) | | |
character | final static int character(Code) | | |
concat | final static int concat(Code) | | |
curdate | final static int curdate(Code) | | |
curtime | final static int curtime(Code) | | |
database | final static int database(Code) | | |
datediff | final static int datediff(Code) | | |
dayname | final static int dayname(Code) | | |
dayofmonth | final static int dayofmonth(Code) | | |
dayofweek | final static int dayofweek(Code) | | |
dayofyear | final static int dayofyear(Code) | | |
difference | final static int difference(Code) | | |
getAutoCommit | final static int getAutoCommit(Code) | | |
getDatabaseFullProductVersion | final static int getDatabaseFullProductVersion(Code) | | |
getDatabaseMajorVersion | final static int getDatabaseMajorVersion(Code) | | |
getDatabaseMinorVersion | final static int getDatabaseMinorVersion(Code) | | |
getDatabaseProductName | final static int getDatabaseProductName(Code) | | |
getDatabaseProductVersion | final static int getDatabaseProductVersion(Code) | | |
hexToRaw | final static int hexToRaw(Code) | | |
hour | final static int hour(Code) | | |
identity | final static int identity(Code) | | |
insert | final static int insert(Code) | | |
isReadOnlyConnection | final static int isReadOnlyConnection(Code) | | |
isReadOnlyDatabase | final static int isReadOnlyDatabase(Code) | | |
isReadOnlyDatabaseFiles | final static int isReadOnlyDatabaseFiles(Code) | | |
lcase | final static int lcase(Code) | | |
left | final static int left(Code) | | |
length | final static int length(Code) | | |
locate | final static int locate(Code) | | |
log10 | final static int log10(Code) | | |
ltrim | final static int ltrim(Code) | | |
minute | final static int minute(Code) | | |
month | final static int month(Code) | | |
monthname | final static int monthname(Code) | | |
octetLength | final static int octetLength(Code) | | |
position | final static int position(Code) | | |
prefixLength | final static int prefixLength(Code) | | |
quarter | final static int quarter(Code) | | |
rand | final static int rand(Code) | | |
rawToHex | final static int rawToHex(Code) | | |
repeat | final static int repeat(Code) | | |
replace | final static int replace(Code) | | |
right | final static int right(Code) | | |
round | final static int round(Code) | | |
roundMagic | final static int roundMagic(Code) | | |
rtrim | final static int rtrim(Code) | | |
second | final static int second(Code) | | |
sign | final static int sign(Code) | | |
soundex | final static int soundex(Code) | | |
space | final static int space(Code) | | |
substring | final static int substring(Code) | | |
to_char | final static int to_char(Code) | | |
trim | final static int trim(Code) | | |
truncate | final static int truncate(Code) | | |
ucase | final static int ucase(Code) | | |
user | final static int user(Code) | | |
week | final static int week(Code) | | |
year | final static int year(Code) | | |
abs | public static double abs(double d)(Code) | | Returns the absolute value of the given double value.
Parameters: d - the number for which to determine the absolute value the absolute value of d , as a double |
ascii | public static Integer ascii(String s)(Code) | | Returns the Unicode code value of the leftmost character of
s as an int . This is the same as the
ASCII value if the string contains only ASCII characters.
Parameters: s - the String to evaluate the integer Unicode value of theleftmost character |
bitLength | public static Integer bitLength(String s)(Code) | | Returns the number of bits in the given String .
This includes trailing blanks.
Parameters: s - the String for which to determine the bit length the bit length of s , including trailing blanks since: 1.7.2 |
bitand | public static int bitand(int i, int j)(Code) | | Returns the bit-wise logical and of the given
integer values.
Parameters: i - the first value Parameters: j - the second value the bit-wise logical and ofi and j |
bitor | public static int bitor(int i, int j)(Code) | | Returns the bit-wise logical or of the given
integer values.
Parameters: i - the first value Parameters: j - the second value the bit-wise logical or ofi and j |
bitxor | public static int bitxor(int i, int j)(Code) | | Returns the bit-wise logical xor of the given
integer values.
Parameters: i - the first value Parameters: j - the second value the bit-wise logical xor ofi and j since: 1.8.0 |
character | public static String character(int code)(Code) | | Returns the character string corresponding to the given ASCII
(or Unicode) value.
Note:
In some SQL CLI
implementations, a null is returned if the range is outside 0..255.
In HSQLDB, the corresponding Unicode character is returned
unchecked.
Parameters: code - the character code for which to return a Stringrepresentation the String representation of the character |
concat | public static String concat(String s1, String s2)(Code) | | Returns a String object that is the result of an
concatenation of the given String objects.
When only one string is NULL, the result is different from that
returned by an (string1 || string2) expression:
- if both
String objects are null , return
null
- if only one string is
null , return the other
- if both
String objects are non-null, return as a
String object the character sequence obtained by listing,
in left to right order, the characters of the first string followed by
the characters of the second
Parameters: s1 - the first String Parameters: s2 - the second String s1 concatentated with s2 |
cot | public static double cot(double d)(Code) | | Returns the cotangent of the given double value
expressed in radians.
Parameters: d - the angle, expressed in radians the cotangent |
curdate | public static Date curdate(Connection c)(Code) | | Returns the current date as a date value.
Dummy mehtod.
a date value representing the current date |
curtime | public static Time curtime(Connection c)(Code) | | Returns the current local time as a time value.
Dummy mehtod.
a time value representing the current local time |
database | public static String database(Connection conn) throws HsqlException(Code) | | Returns the name of the database corresponding to this connection.
Parameters: conn - the connection for which to retrieve the database name the name of the database for the given connection throws: HsqlException - if a database access error occurs |
datediff | public static Long datediff(String datepart, Timestamp d1, Timestamp d2) throws HsqlException(Code) | | Returns the number of units elapsed between two dates.
The datapart parameter indicates the part to be used for computing the
difference. Supported types include: 'year', 'yy', 'month', 'mm'
'day', 'dd', 'hour', 'hh', 'minute', 'mi', 'second', 'ss', 'millisecond',
'ms'.
Contributed by Michael Landon
Parameters: datepart - Specifies the unit in which the interval is to be measured. Parameters: d1 - The starting datetime value for the interval. This value issubtracted from d2 to return the number ofdate-parts between the two arguments. Parameters: d2 - The ending datetime for the interval. d1 is subtractedfrom this value to return the number of date-partsbetween the two arguments.since 1.7.3 |
dayname | public static String dayname(Date d)(Code) | | Returns a character string containing the name of the day
(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday )
for the day portion of the given java.sql.Date .
Parameters: d - the date value from which to extract the day name the name of the day corresponding to the givenjava.sql.Date |
dayofmonth | public static Integer dayofmonth(Date d)(Code) | | Returns the day of the month from the given date value, as an integer
value in the range of 1-31.
Parameters: d - the date value from which to extract the day of month the day of the month from the given date value |
dayofweek | public static Integer dayofweek(Date d)(Code) | | Returns the day of the week from the given date value, as an integer
value in the range 1-7, where 1 represents Sunday.
Parameters: d - the date value from which to extract the day of week the day of the week from the given date value |
dayofyear | public static Integer dayofyear(Date d)(Code) | | Returns the day of the year from the given date value, as an integer
value in the range 1-366.
Parameters: d - the date value from which to extract the day of year the day of the year from the given date value |
difference | public static int difference(String s1, String s2)(Code) | | Returns a count of the characters that do not match when comparing
the 4 digit numeric SOUNDEX character sequences for the
given String objects. If either String object is
null , zero is returned.
Parameters: s1 - the first String Parameters: s2 - the second String the number of differences between the SOUNDEX ofs1 and the SOUNDEX of s2 |
getAutoCommit | public static boolean getAutoCommit(Connection conn)(Code) | | Retrieves the autocommit status of this connection.
Parameters: conn - the Connection object for which to retrievethe current autocommit status a boolean value representing the connection's autocommit status since: 1.7.0 |
getDatabaseFullProductVersion | public static String getDatabaseFullProductVersion()(Code) | | Retrieves the full version number of this database product.
database version number as a String object since: 1.8.0.4 |
getDatabaseMajorVersion | public static int getDatabaseMajorVersion()(Code) | | Retrieves the major version number of this database.
the database's major version as an int value since: 1.7.2 |
getDatabaseMinorVersion | public static int getDatabaseMinorVersion()(Code) | | Retrieves the major version number of this database.
the database's major version as an int value since: 1.7.2 |
getDatabaseProductName | public static String getDatabaseProductName()(Code) | | Retrieves the name of this database product.
database product name as a String object since: 1.7.2 |
getDatabaseProductVersion | public static String getDatabaseProductVersion()(Code) | | Retrieves the version number of this database product.
database version number as a String object since: 1.7.2 |
hexToRaw | public static String hexToRaw(String s)(Code) | | Converts a String of hexidecimal digit characters to a raw
binary value, represented as a String .
The given String object must consist of a sequence of
4 digit hexidecimal character substrings. If its length is not
evenly divisible by 4, null is returned. If any of
its 4 character subsequences cannot be parsed as a
4 digit, base 16 value, then a NumberFormatException is thrown.
This conversion has the effect of reducing the character count 4:1.
Parameters: s - a String of hexidecimal digit characters an equivalent raw binary value, represented as aString |
hour | public static Integer hour(Time t)(Code) | | Returns the hour from the given time value, as an integer value in
the range of 0-23.
Parameters: t - the time value from which to extract the hour of day the hour of day from the given time value |
identity | public static int identity() throws HsqlException(Code) | | Retrieves the last auto-generated integer indentity value
used by this connection.
Dummy mehtod.
the connection's the last generated integer identity value throws: HsqlException - if a database access error occurs |
insert | public static String insert(String s1, int start, int length, String s2)(Code) | | Returns a character sequence which is the result of writing the
first length number of characters from the second
given String over the first string. The start position
in the first string where the characters are overwritten is given by
start .
Note: In order of precedence, boundry conditions are handled as
follows:
- if either supplied
String is null, then the other is
returned; the check starts with the first given String .
- if
start is less than one, s1 is returned
- if
length is less than or equal to zero,
s1 is returned
- if the length of
s2 is zero, s1 is returned
- if
start is greater than the length of s1 ,
s1 is returned
- if
length is such that, taken together with
start , the indicated interval extends
beyond the end of s1 , then the insertion is performed
precisely as if upon a copy of s1 extended in length
to just include the indicated interval
Parameters: s1 - the String into which to insert s2 Parameters: start - the position, with origin one, at which to start the insertion Parameters: length - the number of characters in s1 to replace Parameters: s2 - the String to insert into s1 s2 inserted into s1 , as indicatedby start and length and adjusted forboundry conditions |
isReadOnlyConnection | public static boolean isReadOnlyConnection(Connection conn)(Code) | | Retrieves whether this connection is in read-only mode.
Dummy mehtod.
Parameters: conn - the Connection object for which to retrievethe current read-only status true if connection is read-only andfalse otherwise since: 1.7.2 |
isReadOnlyDatabase | public static boolean isReadOnlyDatabase(Connection c)(Code) | | Dummy method. Retrieves whether this database is in read-only mode.
Parameters: c - the Connection object for which to retrievethe current database read-only status true if so; false otherwise since: 1.7.2 |
isReadOnlyDatabaseFiles | public static boolean isReadOnlyDatabaseFiles(Connection c)(Code) | | Retrieves whether the files of this database are in read-only mode.
Dummy mehtod.
Parameters: c - the Connection object for which to retrievethe current database files read-only status true if so; false otherwise since: 1.7.2 |
lcase | public static String lcase(String s)(Code) | | Returns a copy of the given String , with all upper case
characters converted to lower case. This uses the default Java String
conversion.
Parameters: s - the String from which to produce a lower caseversion a lower case version of s |
left | public static String left(String s, int count)(Code) | | Returns the leftmost count characters from the given
String .
Note: boundry conditions are handled in the following order of
precedence:
- if
s is null , then null
is returned
- if
count is less than 1, then a zero-length
String is returned
- if
count is greater than the length of s ,
then a copy of s is returned
Parameters: s - the String from which to retrieve the leftmostcharacters Parameters: count - the count of leftmost characters to retrieve the leftmost count characters of s |
length | public static Integer length(String s)(Code) | | Returns the number of characters in the given String .
This includes trailing blanks.
Parameters: s - the String for which to determine length the length of s , including trailing blanks |
locate | public static int locate(String search, String s, Integer start)(Code) | | Returns the starting position of the first occurrence of
the given search String object within
the given String object, s .
The search for the first occurrence of search begins with
the first character position in s , unless the optional
argument, start , is specified (non-null). If
start is specified, the search begins with the character
position indicated by the value of start , where the
first character position in s is indicated by the value 1.
If search is not found within s , the
value 0 is returned.
Parameters: search - the String occurence to find in s Parameters: s - the String within which to find the firstoccurence of search Parameters: start - the optional character position from which to startlooking in s the one-based starting position of the first occurrence ofsearch within s , or 0 if not found |
log10 | public static double log10(double x)(Code) | | Returns the base 10 logarithm of the given double value.
Parameters: x - the value for which to calculate the base 10 logarithm the base 10 logarithm of x , as a double |
ltrim | public static String ltrim(String s)(Code) | | Returns the characters of the given String , with the
leading spaces removed. Characters such as TAB are not removed.
Parameters: s - the String from which to remove the leading blanks the characters of the given String , with the leadingspaces removed |
minute | public static Integer minute(Time t)(Code) | | Returns the minute from the given time value, as integer value in
the range of 0-59.
Parameters: t - the time value from which to extract the minute value the minute value from the given time value |
mod | public static int mod(int i1, int i2)(Code) | | Returns the remainder (modulus) of the first given integer divided
by the second.
Parameters: i1 - the numerator Parameters: i2 - the divisor i1 % i2 , as an int |
month | public static Integer month(Date d)(Code) | | Returns the month from the given date value, as an integer value in the
range of 1-12.
The sql_month database property is now obsolete.
The function always returns the SQL (1-12) value for month.
Parameters: d - the date value from which to extract the month value the month value from the given date value |
monthname | public static String monthname(Date d)(Code) | | Returns a character string containing the name of month
(January, February, March, April, May, June, July, August,
September, October, November, December) for the month portion of
the given date value.
Parameters: d - the date value from which to extract the month name a String representing the month name from the given date value |
now | public static Timestamp now(Connection c)(Code) | | Returns the current date and time as a timestamp value.
Dummy mehtod.
a timestamp value representing the current date and time |
octetLength | public static Integer octetLength(String s)(Code) | | Returns the number of bytes in the given String .
This includes trailing blanks.
Parameters: s - the String for which to determine the octet length the octet length of s , including trailing blanks since: 1.7.2 |
pi | public static double pi()(Code) | | Returns the constant value, pi.
pi as a double value |
position | public static int position(String search, String s)(Code) | | As locate but from start position l.
Parameters: search - the String occurence to find in s Parameters: s - the String within which to find the firstoccurence of search the one-based starting position of the first occurrence ofsearch within s , or 0 if not found |
quarter | public static Integer quarter(Date d)(Code) | | Returns the quarter of the year in the given date value, as an integer
value in the range of 1-4.
Parameters: d - the date value from which to extract the quarter of the year an integer representing the quater of the year from the givendate value |
rand | public static double rand(Integer seed)(Code) | | Returns the next pseudorandom, uniformly distributed double value
between 0.0 and 1.0 from a single, system-wide random number generator's
sequence, optionally re-seeding (and thus resetting) the generator sequence.
If the seed value is null , then the underlying random number
generator retrieves the next value in its current sequence, else the seed
alters the state of the generator object so as to be in exactly the same state
as if it had just been created with the seed value.
Parameters: seed - an optional parameter with which to reseed the underlyingpseudorandom number generator the next pseudorandom, uniformly distributed double value between0.0 and 1.0 |
rawToHex | public static String rawToHex(String s)(Code) | | Converts a raw binary value, as represented by the given
String , to the equivalent String
of hexidecimal digit characters.
This conversion has the effect of expanding the character count 1:4.
Parameters: s - the raw binary value, as a String an equivalent String of hexidecimal digit characters |
repeat | public static String repeat(String s, Integer count)(Code) | | Returns a String composed of the given String ,
repeated count times.
Parameters: s - the String to repeat Parameters: count - the number of repetitions the given String , repeated count times |
replace | public static String replace(String s, String replace, String with)(Code) | | Replaces all occurrences of replace in s
with the String object: with
Parameters: s - the target for replacement Parameters: replace - the substring(s), if any, in s to replace Parameters: with - the value to substitute for replace s , with all occurences of replace replaced by with |
right | public static String right(String s, int count)(Code) | | Returns the rightmost count characters of the given
String , s .
Note: boundry conditions are handled in the following order of
precedence:
- if
s is null , null is returned
- if
count is less than one, a zero-length
String is returned
- if
count is greater than the length of s ,
a copy of s is returned
Parameters: s - the String from which to retrieve the rightmostcount characters Parameters: count - the number of rightmost characters to retrieve the rightmost count characters of s |
round | public static double round(double d, int p)(Code) | | Returns the given double value, rounded to the given
int places right of the decimal point. If
the supplied rounding place value is negative, rounding is performed
to the left of the decimal point, using its magnitude (absolute value).
Parameters: d - the value to be rounded Parameters: p - the rounding place value d rounded |
roundMagic | public static double roundMagic(double d)(Code) | | Retrieves a magically rounded double value produced
from the given double value. This method provides special
handling for numbers close to zero and performs rounding only for
numbers within a specific range, returning precisely the given value
if it does not lie in this range.
Special handling includes:
- input in the interval -0.0000000000001..0.0000000000001 returns 0.0
- input outside the interval -1000000000000..1000000000000 returns
input unchanged
- input is converted to String form
- input with a
String form length greater than 16 returns
input unchaged
-
String form with last four characters of '...000x' where
x != '.' is converted to '...0000'
-
String form with last four characters of '...9999' is
converted to '...999999'
- the
java.lang.Double.doubleValue of the String
form is returned
Parameters: d - the double value for which to retrieve the magicallyrounded value the magically rounded value produced |
rtrim | public static String rtrim(String s)(Code) | | Returns the characters of the given String , with trailing
spaces removed.
Parameters: s - the String from which to remove the trailing blanks the characters of the given String , with thetrailing spaces removed |
second | public static Integer second(Time d)(Code) | | Returns the second of the given time value, as an integer value in
the range of 0-59.
Parameters: d - the date value from which to extract the second of the hour an integer representing the second of the hour from thegiven time value |
sign | public static int sign(double d)(Code) | | Returns an indicator of the sign of the given double
value. If the value is less than zero, -1 is returned. If the value
equals zero, 0 is returned. If the value is greater than zero, 1 is
returned.
Parameters: d - the value the sign of d |
soundex | public static String soundex(String s)(Code) | | Returns a four character code representing the sound of the given
String . Non-ASCCI characters in the
input String are ignored.
This method was
rewritten for HSQLDB by fredt@users to comply with the description at
http://www.nara.gov/genealogy/coding.html.
Parameters: s - the String for which to calculate the 4 characterSOUNDEX value the 4 character SOUNDEX value for the givenString |
space | public static String space(int count)(Code) | | Returns a String consisting of count spaces, or
null if count is less than zero.
Parameters: count - the number of spaces to produce a String of count spaces |
substring | public static String substring(String s, int start, Integer length)(Code) | | Returns the characters from the given String , starting at
the indicated one-based start position and extending the
(optional) indicated length . If length is not
specified (is null ), the remainder of s is
implied.
The rules for boundary conditions on s, start and length are,
in order of precedence:
1.) if s is null, return null
2.) If length is less than 1, return null.
3.) If start is 0, it is treated as 1.
4.) If start is positive, count from the beginning of s to find
the first character postion.
5.) If start is negative, count backwards from the end of s
to find the first character.
6.) If, after applying 2.) or 3.), the start position lies outside s,
then return null
7.) if length is ommited or is greated than the number of characters
from the start position to the end of s, return the remaineder of s,
starting with the start position.
Parameters: s - the String from which to produce the indicatedsubstring Parameters: start - the starting position of the desired substring Parameters: length - the length of the desired substring the indicted substring of s . |
trim | public static String trim(String s, String trimstr, boolean leading, boolean trailing)(Code) | | Returns the character sequence s , with the leading,
trailing or both the leading and trailing occurences of the first
character of the character sequence trimstr removed.
This method is in support of the standard SQL String function TRIM.
Ordinarily, the functionality of this method is accessed from SQL using
the following syntax:
<trim function> ::= TRIM <left paren> <trim operands> <right paren>
<trim operands> ::= [ [ <trim specification> ] [ <trim character> ] FROM ] <trim source>
<trim source> ::= <character value expression>
<trim specification> ::= LEADING | TRAILING | BOTH
<trim character> ::= <character value expression>
Parameters: s - the string to trim Parameters: trimstr - the character whose occurences will be removed Parameters: leading - if true, remove leading occurences Parameters: trailing - if true, remove trailing occurences s, with the leading, trailing or both the leading and trailingoccurences of the first character of trimstr removed since: 1.7.2 |
truncate | public static double truncate(double d, int p)(Code) | | Returns the given double value, truncated to
the given int places right of the decimal point.
If the given place value is negative, the given double
value is truncated to the left of the decimal point, using the
magnitude (aboslute value) of the place value.
Parameters: d - the value to truncate Parameters: p - the places left or right of the decimal point at which totruncate d , truncated |
ucase | public static String ucase(String s)(Code) | | Returns a copy of the given String , with all lower case
characters converted to upper case using the default Java method.
Parameters: s - the String from which to produce an upper caseversion an upper case version of s |
user | public static String user(Connection conn) throws HsqlException(Code) | | Returns the user's authorization name (the user's name as known to this
database).
Parameters: conn - the connection for which to retrieve the user name the user's name as known to the database throws: HsqlException - if a database access error occurs |
week | public static Integer week(Date d)(Code) | | Returns the week of the year from the given date value, as an integer
value in the range of 1-53.
Parameters: d - the date value from which to extract the week of the year an integer representing the week of the year from the givendate value |
year | public static Integer year(Date d)(Code) | | Returns the year from the given date value, as an integer value in
the range of 1-9999.
Parameters: d - the date value from which to extract the year an integer value representing the year from the givendate value |
|
|