API to get Orchestration Event Exception from ORCHEVENTS table

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.massiveGaze.orchestration;

import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import com.massiveGaze.connection.DataSource;

public class DumpOrchEventException {
 public static void main(String[] args) throws Exception {
  long orchEventKey = 10;
  // Connect to the database
  
  Connection con = DataSource.getConnection();    
  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