public final class SqlFormat extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ANY |
static int |
DATE |
static int |
DEFAULT_CENTURY_BOUNDARY |
static int |
INVALID |
static int |
NETWORK |
static int |
NUMERIC |
static int |
TIME |
static int |
TS_NTZ |
static int |
TS_TZ |
static int |
TZONE |
| Constructor and Description |
|---|
SqlFormat()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkPrintModel(int model)
Check that this format can be used for printing with model
|
boolean |
checkScanModel(int model)
Check that this format can be used for parsing with model
|
String |
getErrorMsg()
Get error message
|
int |
getMaxOutputSize()
Get max output length
|
int |
getModel()
Get format model
|
SFDate |
parseDate(String str)
Parses Data
|
SFDate |
parseDate(String str,
int cenBound)
Parse date using this format (returns SFDate)
|
SFTime |
parseTime(String str)
Parse time of day using this format (returns SFTime)
|
SFTimestamp |
parseTimestamp(String str,
TimeZone tz)
Parses Timestamp string
|
SFTimestamp |
parseTimestamp(String str,
TimeZone tz,
int cenBound)
Parse timestamp using this format (returns SFTimestamp)
|
TmExt |
parseTm(String inStr)
Parses extended Timestamp string
|
TmExt |
parseTm(String inStr,
int cenBound)
Parse DATE/TIME string
|
String |
printDate(SFDate d)
Print SfDate value
|
String |
printTime(SFTime t,
int scale)
Print SfTime value with scale
|
String |
printTimestamp(SFTimestamp ts,
int scale)
Print SfTimestamp value with scale
|
String |
printTimestamp(SFTimestamp ts,
int scale,
TimeZone tz)
Print SfTimestamp value with scale
|
String |
printTm(TmExt val)
Print the decomposed timezone value using this format
|
String |
reconstructFormat()
Reconstruct the format string
(prints the canonical form)
|
String |
setFormat(int model,
String fmtStr)
Parse single format
Returns remaining format string (for multiple bar-separated formats) or
null for an error
If a singular format is required, the user must check that the output
is empty
Sets an error message
|
public static final int INVALID
public static final int NUMERIC
public static final int DATE
public static final int TIME
public static final int TZONE
public static final int TS_NTZ
public static final int TS_TZ
public static final int NETWORK
public static final int ANY
public static final int DEFAULT_CENTURY_BOUNDARY
public String getErrorMsg()
public int getModel()
public int getMaxOutputSize()
public String setFormat(int model, String fmtStr)
model - format model (see above)fmtStr - is the format stringpublic String reconstructFormat()
public boolean checkPrintModel(int model)
model - model idpublic String printTm(TmExt val)
val - TmExt valuepublic String printTimestamp(SFTimestamp ts, int scale, TimeZone tz)
ts - the timestampscale - scale for fractional secondstz - the timezone to change the timestamp to (null to use timezone from ts)public String printTimestamp(SFTimestamp ts, int scale)
ts - the timestampscale - scale for fractional secondspublic String printTime(SFTime t, int scale)
t - SFTime instancescale - scalepublic String printDate(SFDate d)
d - SFDate instancepublic TmExt parseTm(String inStr, int cenBound)
inStr - the input stringcenBound - the century boundary for YY (1970-2100)public TmExt parseTm(String inStr)
inStr - a stringpublic SFDate parseDate(String str, int cenBound)
str - The string to parsecenBound - the century boundary for YY (1970-2100)public SFDate parseDate(String str)
str - a stringpublic SFTime parseTime(String str)
str - The string to parsepublic SFTimestamp parseTimestamp(String str, TimeZone tz, int cenBound)
str - The string to parsetz - the timezone to use by defaultcenBound - the century boundary for YY (1970-2100)public SFTimestamp parseTimestamp(String str, TimeZone tz)
str - a stringtz - timezonepublic boolean checkScanModel(int model)
model - model idCopyright © 2020. All rights reserved.