1 Blob

Class Ax.sql.Blob


This objects are DataTypes. Don't extend AbstractScriptClass In memory blob holder

Constructor Summary

MethodDescription
JSBlob()
JSBlob(String name)Create a blob holder for given file name
JSBlob(byte[] data)Create a blob holder for given file name, type and data
JSBlob(String name, byte[] data)Create a blob holder for given file name, type and data
JSBlob(String name, byte[] data, String type)Create a blob holder for given file name, type and data
JSBlob(JSFile file)Create a blob holder for given file name and transfer data from file to blob TODO: keep a ref to file.

Method Summary

Modifier and TypeMethodDescription
void close(String arg0)
void free()
InputStream getBinaryStream()
InputStream getBinaryStream(long arg0, long arg1)
byte[] getBytes()
byte[] getBytes(long arg0, int arg1)
byte[] getContent()
String getContentID()
String getContentType()
String getDisposition()
String getFileName()
long getLength()
int getLimit(Object arg0)
getMetaData()
OutputStream getOutputStream()
long getRowId()
long getSeqNo()
String getStore()
String getText()
String getTextContent()
String getTextContent(String charsetName)
String getUUID()
long getVTableRowAccessAge()
long getVTableRowAccessCount()
long getVTableRowAccessTime()
long getVTableRowBuildTime()
long getVTableRowCreatedAge()
boolean hasContentType()
boolean isAttachment()
boolean isCloseable()
boolean isInline()
boolean isLocked()
boolean isOneUse()
boolean isShared()
long length()
void lock()
long position(byte[] arg0, long arg1)
long position(Blob arg0, long arg1)
OutputStream setBinaryStream(long arg0)
OutputStream setBinaryStream(long arg0)
int setBytes(long arg0, byte[] arg1)
int setBytes(long arg0, byte[] arg1, int arg2, int arg3)
JSBlob setContent(byte[] data)Adds the byte[] provided to blob content
JSBlob setContent(String text)Adds the text as UTF8 bytes to blob content
JSBlob setContent(String text, String charsetName)Adds the text as UTF8 bytes to blob content
JSBlob setContentID(String contentID)When using BLOBs to read Mail parts we can check for its contentID
void setContentType(String arg0)
JSBlob setDisposition(String disposition)When using BLOBs to read Mail parts we can check for its content disposition
void setFileName(String arg0)
void setOneUse()
void setSeqNo(int arg0)
void setShared()
void setVTableRowAccessCount()
void setVTableRowAccessTime()
String toBase64()
String toMemoryURL()Return a internal memory URL to the blob.
String toString()
VTable toVTable()
Object[] toVTableRow()
void truncate(long arg0)
boolean tryLock(int arg0, TimeUnit arg1)
void unlock()
Path writeTo(JSFile file)
Path writeTo(File arg0)

Method Detail

JSBlob

 JSBlob()

JSBlob

 JSBlob(String name)
Info:
Create a blob holder for given file name
Parameters:
name - 

JSBlob

 JSBlob(byte[] data)
Info:
Create a blob holder for given file name, type and data
Parameters:
data - 

JSBlob

 JSBlob(String name, byte[] data)
Info:
Create a blob holder for given file name, type and data
Parameters:
name - 
data - 

JSBlob

 JSBlob(String name, byte[] data, String type)
Info:
Create a blob holder for given file name, type and data
Parameters:
name - 
data - 
type - 

JSBlob

 JSBlob(JSFile file)
Info:
Create a blob holder for given file name and transfer data from file to blob TODO: keep a ref to file... TODO: keep a ref to file... TODO: keep a ref to file... TODO: keep a ref to file... TODO: keep a ref to file...
Parameters:
file - 

close

void close(String arg0)
Parameters:
arg0 - 

free

void free()

getBinaryStream

                        InputStream getBinaryStream()
Returns:

getBinaryStream

                        InputStream getBinaryStream(long arg0, long arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

getBytes

byte[] getBytes()
Returns:

getBytes

byte[] getBytes(long arg0, int arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

getContent

byte[] getContent()
Returns:

getContentID

                        String getContentID()
Returns:

getContentType

                        String getContentType()
Returns:

getDisposition

                        String getDisposition()
Returns:

getFileName

                        String getFileName()
Returns:

getLength

long getLength()
Returns:

getLimit

int getLimit(Object arg0)
Parameters:
arg0 - 
Returns:

getMetaData

K getMetaData()
Returns:

getOutputStream

                        OutputStream getOutputStream()
Returns:

getRowId

long getRowId()
Returns:

getSeqNo

long getSeqNo()
Returns:

getStore

                        String getStore()
Returns:

getText

                        String getText()
Returns:

getTextContent

                        String getTextContent()
Returns:

getTextContent

                        String getTextContent(String charsetName)
Parameters:
charsetName - 
Returns:

getUUID

                        String getUUID()
Returns:

getVTableRowAccessAge

long getVTableRowAccessAge()
Returns:

getVTableRowAccessCount

long getVTableRowAccessCount()
Returns:

getVTableRowAccessTime

long getVTableRowAccessTime()
Returns:

getVTableRowBuildTime

long getVTableRowBuildTime()
Returns:

getVTableRowCreatedAge

long getVTableRowCreatedAge()
Returns:

hasContentType

boolean hasContentType()
Returns:

isAttachment

boolean isAttachment()
Returns:

isCloseable

boolean isCloseable()
Returns:

isInline

boolean isInline()
Returns:

isLocked

boolean isLocked()
Returns:

isOneUse

boolean isOneUse()
Returns:

isShared

boolean isShared()
Returns:

length

long length()
Returns:

lock

void lock()

position

long position(byte[] arg0, long arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

position

long position(Blob arg0, long arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

setBinaryStream

                        OutputStream setBinaryStream(long arg0)
Parameters:
arg0 - 
Returns:

setBinaryStream

                        OutputStream setBinaryStream(long arg0)
Parameters:
arg0 - 
Returns:

setBytes

int setBytes(long arg0, byte[] arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

setBytes

int setBytes(long arg0, byte[] arg1, int arg2, int arg3)
Parameters:
arg0 - 
arg1 - 
arg2 - 
arg3 - 
Returns:

setContent

                        JSBlob setContent(byte[] data)
Info:
Adds the byte[] provided to blob content
Parameters:
data - 
Returns:

setContent

                        JSBlob setContent(String text)
Info:
Adds the text as UTF8 bytes to blob content
Parameters:
text - 
Returns:

setContent

                        JSBlob setContent(String text, String charsetName)
Info:
Adds the text as UTF8 bytes to blob content
Parameters:
text - 
charsetName - 
Returns:

setContentID

                        JSBlob setContentID(String contentID)
Info:
When using BLOBs to read Mail parts we can check for its contentID
Parameters:
contentID - 
Returns:

setContentType

void setContentType(String arg0)
Parameters:
arg0 - 

setDisposition

                        JSBlob setDisposition(String disposition)
Info:
When using BLOBs to read Mail parts we can check for its content disposition
Parameters:
disposition - 
Returns:

setFileName

void setFileName(String arg0)
Parameters:
arg0 - 

setOneUse

void setOneUse()

setSeqNo

void setSeqNo(int arg0)
Parameters:
arg0 - 

setShared

void setShared()

setVTableRowAccessCount

void setVTableRowAccessCount()

setVTableRowAccessTime

void setVTableRowAccessTime()

toBase64

                        String toBase64()
Returns:

toMemoryURL

                        String toMemoryURL()
Info:
Return a internal memory URL to the blob. It can be used for internal applications like "internal" apps like FOP, barcode, etc that need to access a blob without going to http
Returns:

toString

                        String toString()
Returns:

toVTable

                        VTable toVTable()
Returns:

toVTableRow

                        Object[] toVTableRow()
Returns:

truncate

void truncate(long arg0)
Parameters:
arg0 - 

tryLock

boolean tryLock(int arg0, TimeUnit arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

unlock

void unlock()

writeTo

                        Path writeTo(JSFile file)
Parameters:
file - 
Returns:

writeTo

                        Path writeTo(File arg0)
Parameters:
arg0 - 
Returns:

2 Date

Class Ax.sql.Date


This objects are DataTypes. Don't extend AbstractScriptClass Operation add/set on this object return a new Date object this leaving this object immutable. This allows the object date passed as a reference in a loop like:

Constructor Summary

MethodDescription
JSDate()
JSDate(int y, int m, int d)
JSDate(int y, int m, int d, int hh, int mm)
JSDate(int y, int m, int d, int hh, int mm, int ss)
JSDate(int y, int m, int d, int hh, int mm, int ss, String timezone)java.
JSDate(Object argument)

Method Summary

Modifier and TypeMethodDescription
long UTC(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5)
JSDate add(int field, int amount)
JSDate addDay(int amount)
JSDate addHour(int amount)
JSDate addMillisecond(int amount)
JSDate addMinute(int amount)
JSDate addMonth(int amount)
JSDate addSecond(int amount)
JSDate addYear(int amount)
boolean after(Date arg0)
boolean before(Date arg0)
JSDate clearTime()Clear the time part (hours to millisecond) from date
Object clone()
int compareTo(Date arg0)
JSDate convertTimeZone(String from, String to)
long days(JSDate d1, JSDate d2)
Duration duration(JSDate d1, JSDate d2)
boolean equals(Object arg0)
String format(String format)
String format(String format, String language)
Date from(Instant arg0)
int getDate()
int getDateFullYear(Object date)
int getDateFullYear(Date date)
int getDateFullYear(JSDate date)
int getDay()
int getFullYear()
int getHours()
long getMillisOf(Date arg0)
int getMinutes()
int getMonth()
int getSeconds()
long getTime()
String getTimeZone()
int getTimezoneOffset()
int getYear()
int getYear()
int hashCode()
long hours(JSDate d1, JSDate d2)
long millis(JSDate d1, JSDate d2)
long minutes(JSDate d1, JSDate d2)
long months(JSDate d1, JSDate d2)
JSDate parse(String format, String text)
JSDate parse(String format, String text, String language)
long parse(String arg0)
long seconds(JSDate d1, JSDate d2)
JSDate set(int field, int value)
JSDate setConnection(JSConnection conn)Setups the connection to format date
void setDate(int arg0)
void setHours(int arg0)
void setMinutes(int arg0)
void setMonth(int arg0)
void setSeconds(int arg0)
void setTime(long arg0)
JSDate setTimeZone(String to)
void setYear(int arg0)
Calendar toCalendar()
String toGMTString()
String toHumanReadable(Duration d)
String toISOString()
Instant toInstant()
LocalDate toLocalDate()
String toLocaleString()
String toSQLQueryString()
String toString()Java: Thu Feb 07 12:53:45 CET 2019 Javascript: Thu Feb 07 2019 12:53:45 GMT+0100 (CET) Informix: MDY(m,d,y)
String toString()
long weeks(JSDate d1, JSDate d2)
long years(JSDate d1, JSDate d2)

Method Detail

JSDate

 JSDate()

JSDate

 JSDate(int y, int m, int d)
Parameters:
y - the year
m - 1- based month
d - 1

JSDate

 JSDate(int y, int m, int d, int hh, int mm)
Parameters:
y - 
m - 
d - 
hh - 
mm - 

JSDate

 JSDate(int y, int m, int d, int hh, int mm, int ss)
Parameters:
y - 
m - 
d - 
hh - 
mm - 
ss - 

JSDate

 JSDate(int y, int m, int d, int hh, int mm, int ss, String timezone)
Info:
java.util.Date represents a time instant without timezone information. By default, if you print timezone information, it will always print the system’s current timezone.
Parameters:
y - 
m - 
d - 
hh - 
mm - 
ss - 
timezone - 

JSDate

 JSDate(Object argument)
Parameters:
argument - 

UTC

long UTC(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5)
Parameters:
arg0 - 
arg1 - 
arg2 - 
arg3 - 
arg4 - 
arg5 - 
Returns:

add

                        JSDate add(int field, int amount)
Parameters:
field - 
amount - 
Returns:

addDay

                        JSDate addDay(int amount)
Parameters:
amount - 
Returns:

addHour

                        JSDate addHour(int amount)
Parameters:
amount - 
Returns:

addMillisecond

                        JSDate addMillisecond(int amount)
Parameters:
amount - 
Returns:

addMinute

                        JSDate addMinute(int amount)
Parameters:
amount - 
Returns:

addMonth

                        JSDate addMonth(int amount)
Parameters:
amount - 
Returns:

addSecond

                        JSDate addSecond(int amount)
Parameters:
amount - 
Returns:

addYear

                        JSDate addYear(int amount)
Parameters:
amount - 
Returns:

after

boolean after(Date arg0)
Parameters:
arg0 - 
Returns:

before

boolean before(Date arg0)
Parameters:
arg0 - 
Returns:

clearTime

                        JSDate clearTime()
Info:
Clear the time part (hours to millisecond) from date
Returns:

clone

                        Object clone()
Returns:

compareTo

int compareTo(Date arg0)
Parameters:
arg0 - 
Returns:

convertTimeZone

                        JSDate convertTimeZone(String from, String to)
Parameters:
from - 
to - 
Returns:

days

long days(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the difference in days between two dates

duration

                        Duration duration(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the Duration between two dates

equals

boolean equals(Object arg0)
Parameters:
arg0 - 
Returns:

format

                        String format(String format)
Parameters:
format - 
Returns:

format

                        String format(String format, String language)
Parameters:
format - 
language - 
Returns:

from

                        Date from(Instant arg0)
Parameters:
arg0 - 
Returns:

getDate

int getDate()
Returns:

getDateFullYear

int getDateFullYear(Object date)
Parameters:
date - 
Returns:

getDateFullYear

int getDateFullYear(Date date)
Parameters:
date - 
Returns:

getDateFullYear

int getDateFullYear(JSDate date)
Parameters:
date - 
Returns:

getDay

int getDay()
Returns:

getFullYear

int getFullYear()
Returns:

getHours

int getHours()
Returns:

getMillisOf

long getMillisOf(Date arg0)
Parameters:
arg0 - 
Returns:

getMinutes

int getMinutes()
Returns:

getMonth

int getMonth()
Returns:

getSeconds

int getSeconds()
Returns:

getTime

long getTime()
Returns:

getTimeZone

                        String getTimeZone()
Returns:
the timezone data is represented. By default system timezone but can be set by specific consrtructor or changed.

getTimezoneOffset

int getTimezoneOffset()
Returns:

getYear

int getYear()
Returns:

getYear

int getYear()
Returns:

hashCode

int hashCode()
Returns:

hours

long hours(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the difference in hours between two dates

millis

long millis(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the difference in seconds between two dates

minutes

long minutes(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the difference in minutes between two dates

months

long months(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the difference in months between two dates

parse

                        JSDate parse(String format, String text)
Parameters:
format - 
text - 
Returns:

parse

                        JSDate parse(String format, String text, String language)
Parameters:
format - 
text - 
language - 
Returns:

parse

long parse(String arg0)
Parameters:
arg0 - 
Returns:

seconds

long seconds(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the difference in seconds between two dates

set

                        JSDate set(int field, int value)
Parameters:
field - 
value - 
Returns:

setConnection

                        JSDate setConnection(JSConnection conn)
Info:
Setups the connection to format date
Parameters:
conn - 
Returns:

setDate

void setDate(int arg0)
Parameters:
arg0 - 

setHours

void setHours(int arg0)
Parameters:
arg0 - 

setMinutes

void setMinutes(int arg0)
Parameters:
arg0 - 

setMonth

void setMonth(int arg0)
Parameters:
arg0 - 

setSeconds

void setSeconds(int arg0)
Parameters:
arg0 - 

setTime

void setTime(long arg0)
Parameters:
arg0 - 

setTimeZone

                        JSDate setTimeZone(String to)
Parameters:
to - 
Returns:

setYear

void setYear(int arg0)
Parameters:
arg0 - 

toCalendar

                        Calendar toCalendar()
Returns:

toGMTString

                        String toGMTString()
Returns:

toHumanReadable

                        String toHumanReadable(Duration d)
Parameters:
d - 
Returns:
the duration as string with format like "2 d 20:14:56" or "20:14:56" when days are 0.

toISOString

                        String toISOString()
Returns:
the date formated as ISO_8601 ("yyyy-MM-dd") without time part

toInstant

                        Instant toInstant()
Returns:

toLocalDate

                        LocalDate toLocalDate()
Returns:

toLocaleString

                        String toLocaleString()
Returns:

toSQLQueryString

                        String toSQLQueryString()
Returns:
the date formated as the SQL agent requires Informix: MDY(m,d,y)

toString

                        String toString()
Info:
Java: Thu Feb 07 12:53:45 CET 2019 Javascript: Thu Feb 07 2019 12:53:45 GMT+0100 (CET) Informix: MDY(m,d,y)
Returns:

toString

                        String toString()
Returns:

weeks

long weeks(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the difference in weeks between two dates

years

long years(JSDate d1, JSDate d2)
Parameters:
d1 - 
d2 - 
Returns:
the difference in days between two dates

3 Time

Class Ax.sql.Time


A SQL time wrapper. SQL time has no year component!

Constructor Summary

MethodDescription
JSSQLTime(long time)
JSSQLTime(int hour, int minute, int second)

Method Summary

Modifier and TypeMethodDescription
long UTC(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5)
boolean after(Date arg0)
boolean before(Date arg0)
Object clone()
int compareTo(Date arg0)
boolean equals(Object arg0)
Date from(Instant arg0)
int getDate()
int getDate()
int getDay()
int getDay()
int getHours()
long getMillisOf(Date arg0)
int getMinutes()
int getMonth()
int getMonth()
int getSeconds()
long getTime()
int getTimezoneOffset()
int getYear()
int getYear()
int hashCode()
long parse(String arg0)
void setDate(int arg0)
void setDate(int arg0)
void setHours(int arg0)
void setMinutes(int arg0)
void setMonth(int arg0)
void setMonth(int arg0)
void setSeconds(int arg0)
void setTime(long arg0)
void setTime(long arg0)
void setYear(int arg0)
void setYear(int arg0)
String toGMTString()
Instant toInstant()
Instant toInstant()
LocalTime toLocalTime()
String toLocaleString()
String toString()
String toString()
Time valueOf(String arg0)
Time valueOf(LocalTime arg0)

Method Detail

JSSQLTime

 JSSQLTime(long time)
Parameters:
time - 

JSSQLTime

 JSSQLTime(int hour, int minute, int second)
Parameters:
hour - 
minute - 
second - 

UTC

long UTC(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5)
Parameters:
arg0 - 
arg1 - 
arg2 - 
arg3 - 
arg4 - 
arg5 - 
Returns:

after

boolean after(Date arg0)
Parameters:
arg0 - 
Returns:

before

boolean before(Date arg0)
Parameters:
arg0 - 
Returns:

clone

                        Object clone()
Returns:

compareTo

int compareTo(Date arg0)
Parameters:
arg0 - 
Returns:

equals

boolean equals(Object arg0)
Parameters:
arg0 - 
Returns:

from

                        Date from(Instant arg0)
Parameters:
arg0 - 
Returns:

getDate

int getDate()
Returns:

getDate

int getDate()
Returns:

getDay

int getDay()
Returns:

getDay

int getDay()
Returns:

getHours

int getHours()
Returns:

getMillisOf

long getMillisOf(Date arg0)
Parameters:
arg0 - 
Returns:

getMinutes

int getMinutes()
Returns:

getMonth

int getMonth()
Returns:

getMonth

int getMonth()
Returns:

getSeconds

int getSeconds()
Returns:

getTime

long getTime()
Returns:

getTimezoneOffset

int getTimezoneOffset()
Returns:

getYear

int getYear()
Returns:

getYear

int getYear()
Returns:

hashCode

int hashCode()
Returns:

parse

long parse(String arg0)
Parameters:
arg0 - 
Returns:

setDate

void setDate(int arg0)
Parameters:
arg0 - 

setDate

void setDate(int arg0)
Parameters:
arg0 - 

setHours

void setHours(int arg0)
Parameters:
arg0 - 

setMinutes

void setMinutes(int arg0)
Parameters:
arg0 - 

setMonth

void setMonth(int arg0)
Parameters:
arg0 - 

setMonth

void setMonth(int arg0)
Parameters:
arg0 - 

setSeconds

void setSeconds(int arg0)
Parameters:
arg0 - 

setTime

void setTime(long arg0)
Parameters:
arg0 - 

setTime

void setTime(long arg0)
Parameters:
arg0 - 

setYear

void setYear(int arg0)
Parameters:
arg0 - 

setYear

void setYear(int arg0)
Parameters:
arg0 - 

toGMTString

                        String toGMTString()
Returns:

toInstant

                        Instant toInstant()
Returns:

toInstant

                        Instant toInstant()
Returns:

toLocalTime

                        LocalTime toLocalTime()
Returns:

toLocaleString

                        String toLocaleString()
Returns:

toString

                        String toString()
Returns:

toString

                        String toString()
Returns:

valueOf

                        Time valueOf(String arg0)
Parameters:
arg0 - 
Returns:

valueOf

                        Time valueOf(LocalTime arg0)
Parameters:
arg0 - 
Returns:

4 QBE

Class Ax.sql.QBE


Constructor Summary

MethodDescription
JSQBE(JSConnection conn)

Method Summary

Modifier and TypeMethodDescription
JSQBE addColumn(String tableColumnName, String value)Add a full qualified database column
JSQBE addColumn(String colname, int sqltype, String value)Add a column name of specified SQL type
String toString()

Method Detail

JSQBE

 JSQBE(JSConnection conn)
Parameters:
conn - 

addColumn

                        JSQBE addColumn(String tableColumnName, String value)
Info:
Add a full qualified database column
Parameters:
tableColumnName - 
value - 
Returns:

addColumn

                        JSQBE addColumn(String colname, int sqltype, String value)
Info:
Add a column name of specified SQL type
Parameters:
colname - 
sqltype - 
value - 
Returns:

toString

                        String toString()
Returns:

5 Struct

Class Ax.sql.Struct


Emulate a database Struct var pie = new Ax.sql.Struct('pie', 'jan', 10, 'feb', 20, 'march', 30, 'april', 40, 'may', 60, 'june', 60, 'july', 70, 'aug', 80, 'sept', 85, 'oct', 90, 'nov', 95, 'dec', 100); var vbar = new Ax.sql.Struct('vbar', 'jan', 10, 'feb', 20, 'march', 30, 'april', 40, 'may', 60, 'june', 60, 'july', 70, 'aug', 80, 'sept', 85, 'oct', 90, 'nov', 95, 'dec', 100);

Constructor Summary

MethodDescription
JSStruct(Object[] attributes)

Method Summary

Modifier and TypeMethodDescription
Object[] getAttributes()
Object[] getAttributes(Map<StringClass> map)
String getSQLTypeName()
String toString()

Method Detail

JSStruct

 JSStruct(Object[] attributes)
Parameters:
attributes - 

getAttributes

                        Object[] getAttributes()
Returns:

getAttributes

                        Object[] getAttributes(Map<StringClass> map)
Parameters:
map - 
Returns:

getSQLTypeName

                        String getSQLTypeName()
Returns:

toString

                        String toString()
Returns:

6 Type and Types

Defines the constants that are used to identify generic SQL types, called JDBC types.

JDBCType documentation page.