OIM API To De-Serialize Orchestration Events Exception


package com.utility;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import com.connection.DataSource;
public class DumpOrchEventException {

 public static void main(String[] args) throws Exception {

 Connection con = DataSource.getConnection();
 long orchEventKey = 1;
 Statement stmt = con.createStatement();
 String query = "select id, name, status, result from orchevents where id=" + orchEventKey;
 ResultSet rs = stmt.executeQuery(query);


 while (rs.next()) {

  System.out.println("id = " + rs.getString("id"));
  System.out.println("name = " + rs.getString("name"));
  System.out.println("status = " + rs.getString("status"));
  
  ByteArrayInputStream bais = new ByteArrayInputStream(rs
   .getBytes("result"));
  ObjectInputStream oip = new ObjectInputStream(bais);

  Object o = oip.readObject();
  Exception ex = (Exception)o;
  ex.printStackTrace();

  
  System.out.println(ex.getMessage());
 }

 stmt.close();
 rs.close();
 con.close();

 System.exit(0);

}
}

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