How to Find LookUp Values in OIM

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.massiveGaze.lookup;
import Thor.API.tcResultSet;
import Thor.API.tcUtilityFactory;
import Thor.API.Operations.tcLookupOperationsIntf;

import com.massiveGaze.connection.OIMConnection;
import com.massiveGaze.util.OIMUtils;

public class FindLookupValues {

 public static void main(String[] args) throws Exception {
  String lookupCode = "Lookup.OID.Group";

  tcUtilityFactory factory = new tcUtilityFactory(OIMConnection.getEnvironment(), "xelsysadm","Welcome1");
  tcLookupOperationsIntf lookupIntf = (tcLookupOperationsIntf) factory.getUtility("Thor.API.Operations.tcLookupOperationsIntf");

  tcResultSet rs = lookupIntf.getLookupValues(lookupCode);

  OIMUtils.printResultSet(rs);
  
  factory.close();
  System.exit(0);
 }
}
Another way using SQL query :
public class GetLookUpValues {
 
 public List getLookupCodes(String lkvKey){
  List list = new ArrayList();
  Connection con = DataSource.getConnection();
  try {
   Statement stmt = con.createStatement();
   String query ="select * from LKV where lku_key="+lkvKey;
   ResultSet rs = stmt.executeQuery(query);
   while (rs.next()) {
    list.add(rs.getString("lkv_encoded"));
   }
  } catch (SQLException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
  System.out.println("Size"+ list.size());
  return list;
 }
 public static void main(String[] args) throws Exception {
  System.out.println(new GetLookUpValues().getLookupCodes("1592"));
  
 }
}

No comments:

Post a Comment

About OIM

Oracle Identity Management enables organizations to effectively manage the end - to - end life - cycle of user ide...

Popular Posts