Wednesday, October 5, 2016

Run query form java code using OIM Client login

import Thor.API.Security.XLClientSecurityAssociation;
import com.thortech.xl.client.dataobj.tcDataBaseClient;
import com.thortech.xl.dataaccess.tcClientDataAccessException;
import com.thortech.xl.dataaccess.tcDataProvider;
import com.thortech.xl.dataaccess.tcDataSet;
import com.thortech.xl.dataaccess.tcDataSetException;
import com.thortech.xl.orb.dataaccess.tcDataAccessException;

public void connectOIMDB(OIMClient oimClient){
XLClientSecurityAssociation.setClientHandle(oimClient);
tcDataProvider dataProvider = new tcDataBaseClient() ;        
        String query ="SELECT * FROM USR WHERE USR_LOGIN = 'XELSYSADM'";        
  tcDataSet dataSet = new tcDataSet();
  dataSet.setQuery(dataProvider, query);
  dataSet.executeQuery();
  System.out.println("Login ID: "+dataSet.getString("USR_LOGIN"));

}

Saturday, April 16, 2016

Event Handler to update Display Name

public EventResult execute(long processId, long eventId, Orchestration orchestration) {

HashMap<String, Serializable> parameters = orchestration.getParameters();
HashMap<String, Object> mapAttrs = new HashMap<String, Object>();

String firstName = (String)parameters.get(UserManagerConstants.AttributeName.FIRSTNAME.getId());
String lastName = (String)parameters.get(UserManagerConstants.AttributeName.LASTNAME.getId());


mapAttrs.put("base", "Mr."+firstName+" "+lastName);


orchestration.addParameter("Display Name", mapAttrs);

return new EventResult();
}

Thursday, April 14, 2016

Table contains all the Schedule tasks

QRTZ92_JOB_DETAILS - contains list of all schedule task
JOB_HISTORY- Contains the details about the execution history

Thursday, January 7, 2016

SQL: Put more than 1000 items inside an IN Clause

some time we need to provide more than 1000 items inside IN clause.  To achieve this, we need to split values across multiple INs using OR

Sample Query:

select * from USR where usr_key in (1,2,3,----1000) OR usr_key in (1001,1002,...,2000)