RSS
 

Posts Tagged ‘development’

Pivot table: generic sql query and Oracle Database 11g PIVOT operator

13 Oct
1 – Definition

A pivot table is the result of the action that allows data tables to be rearranged in many ways for different views of the same data.
Technically, if we compare a table with a matrix we can think to the pivot table as a transposed matrix, where the original row can be read as a column in the resulting table.

2 – How to generate a pivot table

Immagine to have the following data set:
select practice, office, count(1)
from organization
group by practice, office
Now you want the office’s numbers to be columns.  We have 4 offices (1,2,3,4) and we want to have the following columns in our resulting pivot table: OFF_1, OFF_2, OFF_3, OFF_4.
The query to generate the desired pivot table will look like the following:
select practice,
max( decode( office, 1, cnt, null ) ) off_1,
max( decode( office, 2, cnt, null ) ) off_2,
max( decode( office, 3, cnt, null ) ) off_3,
max( decode( office, 4, cnt, null ) ) off_4
from (
select practice, office, count(1) cnt
from organization
group by practice, office
)
group by practice

CNT column has been pivoted by OFFICE across PRACTICE.
Remember that this works only if you know the domain of the column you pivote by.
 

Decompile, modify and deploy java libraries by focusing on the Oracle Identity Manager case of study

13 Oct

1 – Introduction

Lately I have been asked to solve the following problem with the ReconciliationEvent91.jar package for Oracle Identity Manager:

trace log

ERROR,06 Oct 2010 15:12:40,362,[XELLERATE.WEBAPP],Class/Method: tcActionBase/execute encounter some problems: java.util.Collections$UnmodifiableMap cannot be cast to java.util.HashMap
java.lang.ClassCastException: java.util.Collections$UnmodifiableMap cannot be cast to java.util.HashMap
        at com.oracle.oim.ocs.reconciliationEvents91.ReconciliationEventsAction.getSelectedValuesToLink(ReconciliationEventsAction.java:438)
        at com.oracle.oim.ocs.reconciliationEvents91.ReconciliationEventsAction.handleStatusButtons(ReconciliationEventsAction.java:333)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

...

Basing on the steps taken to solve this issue, I want to write down the main guidelines to decompile, modify and repackage existing jar files; I want also to put the focus on Oracle Identity Manager cause by my experience the following steps are more or less the same that should be used whenever you need to add custom backend functionalities to the product.

2 – Prerequisites

You will need the following:

- The last version of the JAVA SDK (You could need the J2EE libraries also)
- A JAVA IDE (Oracle JDeveloper 11g has been used in this case)
-  A JAVA decompiler tool (JAD has been used http://www.varaneckas.com/jad)

Read the rest of this entry »

 

How to set up a Titanium project with Eclipse and start our first mobile application

09 Oct

1 – Introduction

The business around the smartphones is raising up quickly and many developers have started to create applications for iPhone, Android and Blackberry.

Develop an application for one of the above platforms is good, but have the same application running in all of them is better.

The titanium framework helps us to define a single project to be deployed to different platforms.
This post will show how to setup a Titanium project with eclipse and will provide some tips to make the development faster.

If you want to learn more about Titanium just take a look to this video:

Read the rest of this entry »

 
2 Comments

Posted in Mobile