Showing posts with label JDeveloper. Show all posts
Showing posts with label JDeveloper. Show all posts

Tuesday, November 09, 2010

Convert Gregorian Date to JD Edwards Date in XSLT

Q: How to convert Gregorian Date to JDE Date in XSLT?

The format is C-YY-DDD, which is used by JD Edwards software: the century after 1900, the year in that century and the Julian date within that year.  Here are a few examples:

Checkout JDE Julian Date Converter tool by David Macek.

Important: Make sure you declare the XSLT version 2.0!
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0">
...
<ns1:JDEDateNumber>
<xsl:variable name="InStringDate" select="'2010-11-09'"/>
<xsl:variable name="Year" select="substring($InStringDate,1,4)"/>
<xsl:variable name="ShortYear" select="substring($InStringDate,3,2)"/>
<xsl:variable name="StartOfYear" select='concat($Year,"-01-01")'/>
<xsl:value-of select="concat('1', $ShortYear, format-number(days-from-duration((xsd:date($InStringDate) - xsd:date($StartOfYear))) + 1, '000'))"/>
</ns1:JDEDateNumber>
...
</xsl:stylesheet>

Thursday, October 28, 2010

Configuring JDeveloper 11g with AS400

The following steps is a guide on how to connect to an AS400 database using JDBC and JDeveloper 11g for design-time. Where my local JDeveloper installation is at C:\Oracle\sqldeveloper and my JDE server name is JDEEnt1.
  1. Download/extract IBM Toolkit for Java/JTOpen.
  2. Copy the jt400.jar to C:\Oracle\sqldeveloper\jdbc\lib\jt400.jar
  3. Navigate to Tools > Preferences > Database > JDBC Driver Options
  4. Add a new JDBC Driver, calling the driver class as "com.ibm.as400.access.AS400JDBCDriver"
  5. For the Library definition, click Browse
  6. Name the Library as "AS400 JDBC"
  7. Add entry to the class path, referencing the jar file in step (2)
  8. Your new AS400 JDBC Driver should look like this
  9. Back to your SOA composite, simple use the Database Adapter
  10. The Database Adapter wizard will prompt you to create a new connection.
  11. Select Connection Type as "Generic JDBC" and Driver Class as "com.ibm.as400.access.AS400JDBCDriver"
  12. Now test the connection

  13. Done!