Monday, May 21, 2012

Important date functions in Oracle BPEL


Important date functions in Oracle BPEL:

Format-dateTime:

This function returns the formatted string of dateTime using the format provided.

xp20:format-dateTime(dateTime as string, format as string)
  •   dateTime – The dateTime to be formatted
  •    format – The format for the output
Format String:-

Format Date Time: Year

Example
Expression
2012
[Y0001]
2012
[Y]
12
[Y01]
Two Thousand and Twelve
[YWw]

Format Date Time: Month

 Example
Expression
08
[M01]
8
[M]
VIII
[MI]
August
[MNn]
AUGUST
[MN]
Aug
[MNn,*-3]
AUG
[MN,*-3]

                                      
Format Date Time: Day

Example
Expression
05
[D01]
5
[D]
5
[D1]
31st
[D1o]
Tuesday
[FNn]


Format Date Time: Hour

Example
Expression
3
[h]
9
[H]
08
[H01]

Format Date Time: Minute
Example
Expression
03
[m01]
3
[m]

Format Date Time: Second
Example
Expression
09
[s01]
9
[s]

Format Date Time: Millisecond
Example
Expression
257
[f001]

Format Date Time: AM/PM
Example
Expression
PM
[PN]
Am
[Pn]

Format Date Time: GMT
Example
Expression
GMT+02:00
[z]


Example:-

xp20:format-dateTime(xp20:current-dateTime(),"[D01]/[M01]/[Y0001] [H01]:[m01]:[s01]")



Saturday, May 19, 2012

JAXB Mapping of XML Schema Built-in Data Types

JAXB Mapping of XML Schema Built-in Data Types  


XML Schema Type
Java Data Type
xsd:string
java.lang.String
xsd:integer
java.math.BigInteger
xsd:int
int
xsd.long
long
xsd:short
short
xsd:decimal
java.math.BigDecimal
xsd:float
float
xsd:double
double
xsd:boolean
boolean
xsd:byte
byte
xsd:QName
javax.xml.namespace.QName
xsd:dateTime
java.util.Calendar
xsd:base64Binary
byte[]
xsd:hexBinary
byte[]
xsd:unsignedInt
long
xsd:unsignedShort
int
xsd:unsignedByte
short
xsd:time
java.util.Calendar
xsd:date
java.util.Calendar
xsd:anySimpleType
java.lang.String




Programmatically compile Java class


Programmatically compile Java class:

import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;

public class Main {
  public static void main(String[] args) {
    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    int result = compiler.run(null, null, null, "Hello.java");

    System.out.println("Compile result code = " + result);
  }
}