SortedSet

Hello.
I need some help. I have to store some data (type : object) in sortedset, but I have no idea on how to implement it. In my object, it has a parameter unique ID in type double. and I would like it sorted based on this unique ID. Could anyone tell me how could I do this ? How to implement the comparable, compareTo, etc. I would be very happy also, if someone could provide some small example. Thank you very much.

The example below demonstrates creating 10 objects of the type you describe, in any order, and using SortedSet to store them / retrieve them in order.
import java.util.Iterator;
import java.util.SortedSet;
import java.util.TreeSet;
public class MyComparable implements Comparable
        static java.util.Random ran = new java.util.Random();
        double d = ran.nextDouble();
        public int compareTo(Object o)
                MyComparable other = (MyComparable) o;
                if(d < other.d) return -1;
                else if(d > other.d) return 1;
                else return 0;
        public boolean equals(Object o)
                return compareTo(o) == 0;
        public String toString()
                StringBuffer sb = new StringBuffer();
                sb.append("<MyComparable ");
                sb.append(d);
                sb.append(">");
                return sb.toString();
        public static void main(String [] as)
                SortedSet ss = new TreeSet();
                for(int i=0; i<10; i++)
                        MyComparable myComp = new MyComparable();
                        System.out.println(" created " + myComp);
                        ss.add(myComp);
                Iterator it = ss.iterator();
                while(it.hasNext())
                        System.out.println(it.next());
[D:/Skrabacz/Devel/try/forum] java MyComparable
created <MyComparable 0.7677724511588107>
created <MyComparable 0.46700033841632393>
created <MyComparable 0.2133779399400303>
created <MyComparable 0.9617326444195208>
created <MyComparable 0.5790019143376731>
created <MyComparable 0.8958425738672053>
created <MyComparable 0.5299211773413368>
created <MyComparable 0.7813779119080679>
created <MyComparable 0.5814540188890048>
created <MyComparable 0.4691780946123787>
<MyComparable 0.2133779399400303>
<MyComparable 0.46700033841632393>
<MyComparable 0.4691780946123787>
<MyComparable 0.5299211773413368>
<MyComparable 0.5790019143376731>
<MyComparable 0.5814540188890048>
<MyComparable 0.7677724511588107>
<MyComparable 0.7813779119080679>
<MyComparable 0.8958425738672053>
<MyComparable 0.9617326444195208>
[D:/Skrabacz/Devel/try/forum]

Similar Messages

  • What is the difference of HashMap,HashTable,SortedSet ?

    what is the difference of HashMap,HashTable,SortedSet ?
    and Is it possible to sort key descending with SortedMap or others
    Thank in advance

    http://java.sun.com/docs/books/tutorial/collections/index.html

  • SortedSet with objects

    Say I have a list of objects with the following params:
    1. Name
    2. Age
    3. Address
    I don't want to have any duplication with the address argument.
    Question, using a sortedSet how can I avoid this duplication, so the list will eventually contain only unique addresses?
    Thanks
    peter

    Maintain a set of addresses previously used. If yourSet.contains( testAddress ), do not insert and handle as appropriate.
    � {�                                                                                                                                                                                                                                                               

  • SortedSet thread-safe howto?

    Hello,
    i m trying to acces SortedSet with multiple thread, but i can't
    here is my code :
    public class Test {
    static SortedSet queue = Collections.synchronizedSortedSet((SortedSet) new TreeSet());
    static Vector v = new Vector();
    public static Vector getV() { return v;}
    public static SortedSet getQueue () {
    return queue;
    public static void main(String[] args) throws Exception {
    launchFrame();
    for (int i=0; i<2; i++) {
    new SimpleThread2("thread"+i).start();
    public static void end() {
    System.out.println(v.size()+" lalala "+queue.size());
    class SimpleThread2 extends Thread {
    int j = 0;
    public SimpleThread2(String str) {
    super(str);
    public void run() {
    for (int i = 0; i < 10; i++) {
    try {
    SortedSet s = Test.getQueue();
    synchronized (s) {
    s.add(new String(""+i));
    Test.getV().add(""+i);
    } catch (Exception ex) {ex.printStackTrace();}
    Test.end();
    here is my result :
    10 lalala 10
    20 lalala 10
    as u can see Vector is thread safe but SortedSet not....

    That has nothing to do with Thread-safe or not. A Set be it sorted or not always only contains at most one reference to a specific Object as long as equals() and compareTo() are implemented properly.
    In the second run you add identical Strings to both the SortedSet and the Vector. In the SortedSet, they replace the old entries and in the Vector, they are appended as the Vector is a List and allows multiple identical entries.

  • SortedSet String into a String[]

    Hello, I would like convert a SortedSet< String > into a String[], is it possible?
    I would like to do it because I want to do a binary search on it? is it a good way converting it or I can use another way as well?
    thanks,

    mickey0 wrote:
    Hello, I would like convert a SortedSet< String > into a String[], is it possible?
    I would like to do it because I want to do a binary search on it? is it a good way converting it or I can use another way as well?A SortedSet already does an implicit form of a binary search for you when it has to find an entry in the set.
    kind regards,
    Jos

  • SortedSet/TreeMap ...

    am writing code for Displaying data in ascending order using a TreeMap(). And am in a fix to
    resolve it. The scenario is like this i am calling java classes in my application from another
    application whic is fetching data for me from their database where i can't intervene. From
    thisapplication I am calling a class color.java in which objects are defined as string . And I need
    to get the data and display the same using my servlet in its ascending order based on its color
    number.Like this
    ColorNumber Location Qty Price
    100 C422 100 20
    150 A1100 0575 15
    200 D3760 130 500
    Also While making call to color.java i get data of following types
    colorlocation - Varchar
    colornumber - number.
    colorqty - number
    colorPrice. - number
    The piece of java code in my file details.java is like this
    Color[] Range= colorenquiry.getColordata();
    SortedSet ColorMap = new TreeMap();
    for (int i=0; i<Range.length(); i++){
    ColorMap.put(Range.colornumber, Range[i].colorlocation.toString()+""+
    Range[i].colorqty.toString()+""+Range[i].colorprice.toString());
    System.out.println(ColorMap.keySet());
    System.out.println(ColorMap.values());
    System.out.println(ColorMap.entrySet());
    Now the Problem is for few querries iam getting the sorted output as above but for queries where
    data is like 50- 60 rows am finding sorted data in patches like its 100,150, 200, 300, 500, 350,
    600 700 425, 800, 900, 1000, 1100, 1200, 1500,250....
    Please advise or have any such working examples where i can refer.
    Thanks & Regards,
    I tried with a Comparator to avoid natural order of sorting pls see the code below but still geting
    a Clascast exception. Is there any problem with this code too?
    Overall if there is any other approach to resolve sorting of rows in ascening order. Please
    suggest or any other working code which i can look into.
    int[] s1;
    bolean[] s2;
    public void CompareAscOrder(int[] s1, boolean[] s2){
    if (s1.length != s2.length){
    throw new IllegalArgumentException("Wrong length...");
    this.s1=s1;
    this.s2=s2;
    final Comparator C2 = new Comparator() {
    public int compare(Object o1, Object o2) {
    Object rowa[] = (Object[]) a;
    Object rowb[] = (Object[]) b;
    for(int i=0; i<s1.length; i++)
    int col = s1[i];
    int result=((Comparable)rowa[col].compareTo(rowb[col]);
    if (result !=0){
    if(s2[i]) return result;
    else return -result;
    return 0;

    Well, the code you post still doesn't compile and still isn't in [code ][code ] brackets, but the following does compile and does do something sensible -- specifically, the comparator will sort MyColor object according to the field called "num" (and sort them numerically, so "100" comes after "99"). Whether that's what you want it to do, I don't know. Some hints:
    (a) watch your capitalization - use initial caps for classnames only
    (b) there's already a class called "Color" in java.awt -- rename your Color if you can.
    (c) to re-emphasize something I said earlier, a SortedMap sorts on its keys, so the comparatory is always passed two keys (which in your original example were strings, not colors).import java.util.Comparator;
    class MyColor {
        String num;
        String loc;
        String qty;
        String price;
        final static Comparator c1 = new Comparator(){
                public int compare(Object a, Object b){
                    MyColor col1 =(MyColor) a;
                    MyColor col2 =(MyColor) b;
                    int d1 = Integer.parseInt(col1.num);
                    int d2 = Integer.parseInt(col2.num);
                    return  d1 - d2;
    }

  • Regarding Set and SortedSet

    In the collection API, SortedSet implements Collection and Set interfaces. Why does it implement Collection when Set is already a subclass of Collection ?

    in your first post, you said
    In the collection API, SortedSet implements Collection and Set interfaces. Why does it
    implement Collection when Set is already a subclass of Collection ?Set interface extends Collection...
    SortedSet interface extends Set and it is not implementing Collection.
    here is the title of the SoretedSet interface (javadoc 1.5):
    java.util
    Interface SortedSet<E>
    All Superinterfaces:
        Collection<E>, Iterable<E>, Set<E>
    All Known Implementing Classes:
        TreeSet SortedSet inherits Collection methods by Set interface...

  • SortedSet unique key problem

    i want a SortedSet of patients. each has a unique id and a current heartRate .
    i want to sort them by heartRate .
    i am getting duplicate entries when the id is constant but the heartRate changes.
    please consider this:
    SortedSet<Patient>();
    public class Patient {
      public int id;
      public int heartBeat;
    public class PatientComparator implements Comparator {
      public int compare(Object obj1, Object obj2) {
        Patient p1 = (Patient) obj1; // <------- this downcast works... downcasts are illegal
        Patient p2 = (Patient) obj2; // yet how else can i write the Comparator? i don't get it.
        if(p1.heartBeat > p2.heartBeat) { return(1); }
        if(p1.heartBeat < p2.heartBeat) { return(-1); }
        return(0);
      public boolean equals(Object obj1, Object obj2) {
        Patient p1 = (Patient) obj1;
        Patient p2 = (Patient) obj2;
        return(p1.id == p2.id);
    summary :
    each time the same patient id has heartRate change, i get a new entry in the SortedSet .
    the related issue, how could you write a Comparator without a downcast?

    The equals method must be implemented in Patient class, not in PatientComparatori am still getting multiple entries even with this implementation:
    public class Patient extends Object {
      public int id;
      public int heartBeat;
      public boolean equals(Object obj) {
        return(true);  // <---
    }further, i am also implementing Comparator this way:
    public class PatientComparator implements Comparator<Patient> {
      public boolean equals(Patient p1, Patient p2) {
        return(true); // <---
    }and i still get multiple entries.
    so, what method() does a Set use to guarantee that there are no duplicate entries?
    and what key is used to uniquely identify an object in the Collection ?
    when mySet.add((MyObj) myObj); i think the process should be:
    (1) if myObj already exists in mySet remove it.
    (2) add myObj to mySet .
    for me, either step #1 is not happening, or there is something wrong with the keys .
    i want to make the key patient.id .

  • Trouble removing some elements of a TreeSet/SortedSet

    I've been stuck with this for quite a while, having been able to work around it, but now it's really getting annoying.
    I'm using a TreeSet (using a SortedSet to have it synchronized) containing a list of nodes. Each node has a priority value, which is used as a key to sort the set.
    I can use this successfully but after some time, when I want to remove a certain node, the call to remove doesn't succeed in removing the element from the set, the element is still in the set after the call. I checked my comparator manytimes, and everything seems to work fine there, I tracked the call and although my node is in the set, when the comparator is called, all the elements of the set don't seem to be tested, and the actual position of the node in the set "ignored" as several other elements.
    in fact, I use two TreeSets, but they aren't not using the same comparator, so I don't think I have a conflit in there.
    here is a very light version of the node class and the comparators (won't run, but give you an idea of what I'm doing)
    Node Class
    public class Node {
         protected double priority1;
         protected double priority2;
         int nodeID;
    Comparators
    private class Comparator1 implements Comparator
      public int compare(Object o1, Object o2)
        Node t1 = (Node)o1;
        Node t2 = (Node)o2;
        if (t1.nodeID == t2.nodeID)
          return 0;
        int diff = (int) (PRIORITY_SAMPLING * (t1.priority1 - t2.priority1));
        if (diff == 0)
          return t1.nodeID - t2.nodeID;
        else
          return diff;
    private class Comparator2 implements Comparator
      public int compare(Object o1, Object o2)
        Node t1 = (Node)o1;
        Node t2 = (Node)o2;
        if (t1.nodeID == t2.nodeID)
          return 0;
        int diff = (int) (PRIORITY_SAMPLING * (t1.priority2 - t2.priority2));
        if (diff == 0)
          return t1.nodeID - t2.nodeID;
        else
          return diff;
    }at some point, I use the following code to access my sets and exploit their data, having various treatments and stuff
    maxPriority1Node = (Node) Queue1.last();
    minPriority2Node = (Node) Queue2.first();
    while (maxPriority1Node.priority1 > minPriority2Node.priority2)
      if (Count > desiredCount)
        minPriority2Node.merge();
      else
        maxPriority1Node.split();
        maxPriority1Node = (Node) Queue1.last();
        minPriority2Node = (Node) Queue2.first();
    }at some point, I'm in the case : Count > desiredCount so I call the merge part, which adds the current node to the Queue1 while removing it from Queue2, but the removal is never done, so the node is still present in Queue2. When I get back from the call, the minPriority2Node is still the same node because it's still in the list, and I end up stuck in an infinite loop.
    Can someone help me with this, or explain me what exactly happen when I try to remove the node from the set, which would explain why the node is still in the list after I tried to remove it ?
    if you need some more details to understand my problem, just ask, I'll try to give you more informations then.

    thanks for you help but, as you have guessed, merge and split do much more things than just dealing with the queues.
    But I've found where the problem was.
    I had wrongly assuming that the value returned by the comparator was used by the TreeSet, wether in fact, it's only the sign of it which is useful.
    In my code, I was using a constant called PRIORITY_SAMPLING, which was an arbitrary int (0xFFFFFF) to convert my double values (the double values could be any value, not just normalized 0.0 to 1.0 values, so I could not use a bigger int value). This constant was used to convert my double value to an int, trying to have enough precision to differenciate approaching value. In fact, the precision of this constant was not sufficient.
    now, I don't use the constant, which, in fact, was useless. Because what is important in the comparator result is not the value but the sign, so I can do a simple test between my double values and return -1 or 1.
    I had to had a special case for nodes whose priority are equal, so that they get sorted by ID, which is consistent over time.
    here are the new comparators :
    private class Comparator1 implements Comparator
         public int compare(Object o1, Object o2)
              Node t1 = (Node)o1;
              Node t2 = (Node)o2;
              if (t1.nodeID == t2.nodeID)
                   return 0;
              if (t1.priority1 == t2.priority1)
                   return t1.nodeID - t2.nodeID;
              else if (t1.priority1 < t2.priority1)
                   return -1;
              else
                   return 1;
    private class Comparator2 implements Comparator
         public int compare(Object o1, Object o2)
              Node t1 = (Node)o1;
              Node t2 = (Node)o2;
              if (t1.nodeID == t2.nodeID)
                   return 0;
              if (t1.priority2 == t2.priority2)
                   return t1.nodeID - t2.nodeID;
              else if (t1.priority2 < t2.priority2)
                   return -1;
              else
                   return 1;
    }

  • Remove and SortedSet

    Hi all,
    I'm just trying to remove the first item from a sorted set yet for some reason I'm having no luck. Here's the code
    public class Main
        static  private Comparator smallestDistanceo = new Comparator ()
            public int compare (Object v, Object u)
               return compare ((Integer) v, (Integer) u);
            public int compare (Integer v, Integer u)
                int results = v.intValue () -  u.intValue ();
                if(results == 0)
                    return -1;
                else
                    return results;
        static SortedSet test = new TreeSet (smallestDistanceo);
        public static void main (String[] args)
            test.add (new Integer(3));
            test.add (new Integer(1));
            test.add (new Integer(2));
            for(Iterator i = test.iterator (); i.hasNext ();)
                Integer curr=(Integer)i.next ();
                System.out.print (curr.intValue ());
            if(test.remove(first))
                System.out.print("\nRemoved\n");
            else
                System.out.print("\nNot Removed\n");
            for(Iterator i = test.iterator (); i.hasNext ();)
                Integer curr=(Integer)i.next ();
                System.out.print (curr.intValue ());
    }Yet for some reason the list just keeps coming back with nothing removed.
    I'm sure it just something simple but can't see it for the life of me. Any ideas?

    Yet for some reason the list just keeps coming back with nothing
    removed. I'm sure it just something simple but can't see it for the life
    of me. Any ideas?Your Comparator is broken: even if two objects are equal, you
    return -1 indicating that the left operand object is smaller than the right
    operand object, iow: your comparator never treats two objects as equal.
    Even more: if you populate your SortedSet with Integers, you
    don't need a user supplied Comparator at all; Integers know perfectly
    well how to compare themselves against other integers.
    The solution is simple: remove your Comparator and let the built-in
    Integer comparator do the rest together with the SortedSet.
    kind regards,
    Jos

  • How to create a SortedSet?

    Hi, I am fresh to Java. Will someone help me pls, my question is:
    1, May I create a sortedset with each elements being a 2dimmensional array. e.g., array A[], A[0] be employee id, A[1] be employee wages?
    2, If it is possible, how should I do? ( I want to sort the elements by wages.)
    thank you very much in advance.

    userid123 wrote:
    e.g., array A[], A[0] be employee id, A[1] be employee wages?The first thing you should do is write an Employee class that encapsulates those two attributes, so that you just have a 1D array of Employees.
    2, If it is possible, how should I do? ( I want to sort the elements by wages.) The TreeSet is a sorted Set, but you'd need to implement either Comparable or Comparator for your Employee class.
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/TreeSet.html
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Comparable.html

  • Iterating SortedSet

    I am delving into the ins and outs of SortedSets, and I've encountered a problem.
    At times, it is useful to know the index of the set, such as when manipulating an array, we might declare i as an index, and use that value for a whole bunch of reasons.
    I've fudged something by converting my SortedSet to an Array, and manipulating the Array as usual. I've also fudged an index value to achieve the same thing.
    I've noted that List has a .get() method which (appears) to take an int value just like an array index.
    What I'd really like to do is be able to grap a specific element out of my SortedSet based on some index value. For example:
    if s is a SortedSet...
    for (int i = 0; i < s.size(); i++){
        // do some stuff based on "i" like get the i-th value in s
    }I've been reading about wrappers, collections, and so on, but I can't figure out how to do this. Is it even possible?

    If you're doing it in a loop from 0 to size(), then you should be using an Iterator. This is true for all collections.
    for (Iterator iter = theSet.iter(); iter.hasNext(); ) {
        MyThingie thing = (MyThingie)iter.next();
        // do stuff with thing
    or, using the enhanced for loop of 5.0: for (MyThingie thing : theSet) {
    // do stuff with thing
    If you just want to randomly access a one or a few of the elements, then the easiest thing to do would be to put the contents of the set into an array (using Set's toArray method) or into an ArrayList (using ArrayList c'tor that takes a Collection as an arg).
    Sets don't have a get(i) method because unlike Lists, Sets to not have an inherent order. They're more like a box full of things. It seems like it would make sense for SortedSet to have get(i) though, since sorting implies an order. I don't know why it doesn't.

  • ...is not abstract and does not override abstract method compare

    Why am I getting the above compile error when I am very clearly overriding abstract method compare (ditto abstract method compareTo)? Here is my code -- which was presented 1.5 code and I'm trying to retrofit to 1.4 -- followed by the complete compile time error. Thanks in advance for your help (even though I'm sure this is an easy question for you experts):
    import java.util.*;
       This program sorts a set of item by comparing
       their descriptions.
    public class TreeSetTest
       public static void main(String[] args)
          SortedSet parts = new TreeSet();
          parts.add(new Item("Toaster", 1234));
          parts.add(new Item("Widget", 4562));
          parts.add(new Item("Modem", 9912));
          System.out.println(parts);
          SortedSet sortByDescription = new TreeSet(new
             Comparator()
                public int compare(Item a, Item b)   // LINE CAUSING THE ERROR
                   String descrA = a.getDescription();
                   String descrB = b.getDescription();
                   return descrA.compareTo(descrB);
          sortByDescription.addAll(parts);
          System.out.println(sortByDescription);
       An item with a description and a part number.
    class Item implements Comparable     
          Constructs an item.
          @param aDescription the item's description
          @param aPartNumber the item's part number
       public Item(String aDescription, int aPartNumber)
          description = aDescription;
          partNumber = aPartNumber;
          Gets the description of this item.
          @return the description
       public String getDescription()
          return description;
       public String toString()
          return "[descripion=" + description
             + ", partNumber=" + partNumber + "]";
       public boolean equals(Object otherObject)
          if (this == otherObject) return true;
          if (otherObject == null) return false;
          if (getClass() != otherObject.getClass()) return false;
          Item other = (Item) otherObject;
          return description.equals(other.description)
             && partNumber == other.partNumber;
       public int hashCode()
          return 13 * description.hashCode() + 17 * partNumber;
       public int compareTo(Item other)   // OTHER LINE CAUSING THE ERROR
          return partNumber - other.partNumber;
       private String description;
       private int partNumber;
    }Compiler error:
    TreeSetTest.java:25: <anonymous TreeSetTest$1> is not abstract and does not over
    ride abstract method compare(java.lang.Object,java.lang.Object) in java.util.Com
    parator
                public int compare(Item a, Item b)
                           ^
    TreeSetTest.java:41: Item is not abstract and does not override abstract method
    compareTo(java.lang.Object) in java.lang.Comparable
    class Item implements Comparable
    ^
    2 errors

    According to the book I'm reading, if you merely take
    out the generic from the code, it should compile and
    run in v1.4 (assuming, of course, that the class
    exists in 1.4). I don't know what book you are reading but that's certainly incorrect or incomplete at least. I've manually retrofitted code to 1.4, and you'll be inserting casts as well as replacing type references with Object (or the erased type, to be more precise).
    These interfaces do exist in 1.4, and
    without the generics.Exactly. Which means compareTo takes an Object, and you should change your overriding method accordingly.
    But this raises a new question: how does my 1.4
    compiler know anything about generics? It doesn't and it can't. As the compiler is telling you, those interfaces expect Object. Think about it, you want to implement one interface which declares a method argument type of Object, in several classes, each with a different type. Obviously all of those are not valid overrides.

  • Questions on filtering and sorting an arraylist

    Hello All,
    I'm trying to figure out a better way to do this code, but what I'm doing is taking an arrayList and filtering it using iter.remove(), based on a criteria I have, then take the results and sort them. The code below works, but I was seeing class cast exceptions when I tried to do a ss.addAll(list);
    , but it worked when I just added the set object. Why is this and is there a better way to do all this?
    Set set = new HashSet();
    List retList = new ArrayList();
    SortedSet ss = new TreeSet();
    for(Iterator iter = list.iterator(); iter.hasNext();){
    .//More code...
    iter.remove();
    //Remove duplicates.
    set.addAll(list);
    ss.add(set);
    retList.addAll(set);
    return retList;

    Your current code is adding the set (the hash set) as one element (the only element?) of the sorted set. Is this what you want to do? Would you rather add each element of the set to the sorted set?
    I don't know about the class cast exceptions. If you want somebody's comment on this part, you may consider posting code and stack trace.
    I think I'd rely on Collections.sort() for sorting rather than TreeSet. If you prefer TreeSet, why not skip the hash set in between?
    Hope this helps.
    Please remember the code button/tags.

  • Dmtreedemo.java error

    hi,
    i got error in the following programme in java named dmdemotree.java the code and the error are as mentioned below
    i have installed oracle 10g r2 and i have used JDK 1.4.2 softwares , i have set classpath for jdm.jar and ojdm_api.jar available in oracle 10g r2 software ,successfully compiled but at execution stage i got error as
    F:\Mallari\DATA MINING demos\java\samples>java dmtreedemo localhost:1521:orcl scott tiger
    --- Build Model - using cost matrix ---
    javax.datamining.JDMException: Generic Error.
    at oracle.dmt.jdm.resource.OraExceptionHandler.createException(OraExcept
    ionHandler.java:142)
    at oracle.dmt.jdm.resource.OraExceptionHandler.createException(OraExcept
    ionHandler.java:91)
    at oracle.dmt.jdm.OraDMObject.createException(OraDMObject.java:111)
    at oracle.dmt.jdm.base.OraTask.saveObjectInDatabase(OraTask.java:204)
    at oracle.dmt.jdm.OraMiningObject.saveObjectInDatabase(OraMiningObject.j
    ava:164)
    at oracle.dmt.jdm.resource.OraPersistanceManagerImpl.saveObject(OraPersi
    stanceManagerImpl.java:245)
    at oracle.dmt.jdm.resource.OraConnection.saveObject(OraConnection.java:3
    83)
    at dmtreedemo.executeTask(dmtreedemo.java:622)
    at dmtreedemo.buildModel(dmtreedemo.java:304)
    at dmtreedemo.main(dmtreedemo.java:199)
    Caused by: java.sql.SQLException: Unsupported feature
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBEr
    ror.java:690)
    at oracle.jdbc.driver.OracleCallableStatement.setString(OracleCallableSt
    atement.java:1337)
    at oracle.dmt.jdm.utils.OraSQLUtils.createCallableStatement(OraSQLUtils.
    java:126)
    at oracle.dmt.jdm.utils.OraSQLUtils.executeCallableStatement(OraSQLUtils
    .java:532)
    at oracle.dmt.jdm.scheduler.OraProgramJob.createJob(OraProgramJob.java:7
    7)
    at oracle.dmt.jdm.scheduler.OraJob.saveJob(OraJob.java:107)
    at oracle.dmt.jdm.scheduler.OraProgramJob.saveJob(OraProgramJob.java:85)
    at oracle.dmt.jdm.scheduler.OraProgramJob.saveJob(OraProgramJob.java:290
    at oracle.dmt.jdm.base.OraTask.saveObjectInDatabase(OraTask.java:199)
    ... 6 more
    SO PLZ HELP ME OUT IN THIS , I WILL BE VERY THANK FULL
    ===========================================================
    the sample code is
    // Copyright (c) 2004, 2005, Oracle. All rights reserved.
    // File: dmtreedemo.java
    * This demo program describes how to use the Oracle Data Mining (ODM) Java API
    * to solve a classification problem using Decision Tree (DT) algorithm.
    * PROBLEM DEFINITION
    * How to predict whether a customer responds or not to the new affinity card
    * program using a classifier based on DT algorithm?
    * DATA DESCRIPTION
    * Data for this demo is composed from base tables in the Sales History (SH)
    * schema. The SH schema is an Oracle Database Sample Schema that has the customer
    * demographics, purchasing, and response details for the previous affinity card
    * programs. Data exploration and preparing the data is a common step before
    * doing data mining. Here in this demo, the following views are created in the user
    * schema using CUSTOMERS, COUNTRIES, and SUPPLIMENTARY_DEMOGRAPHICS tables.
    * MINING_DATA_BUILD_V:
    * This view collects the previous customers' demographics, purchasing, and affinity
    * card response details for building the model.
    * MINING_DATA_TEST_V:
    * This view collects the previous customers' demographics, purchasing, and affinity
    * card response details for testing the model.
    * MINING_DATA_APPLY_V:
    * This view collects the prospective customers' demographics and purchasing
    * details for predicting response for the new affinity card program.
    * DATA MINING PROCESS
    * Prepare Data:
    * 1. Missing Value treatment for predictors
    * See dmsvcdemo.java for a definition of missing values, and the steps to be
    * taken for missing value imputation. SVM interprets all NULL values for a
    * given attribute as "sparse". Sparse data is not suitable for decision
    * trees, but it will accept sparse data nevertheless. Decision Tree
    * implementation in ODM handles missing predictor values (by penalizing
    * predictors which have missing values) and missing target values (by simple
    * discarding records with missing target values). We skip missing values
    * treatment in this demo.
    * 2. Outlier/Clipping treatment for predictors
    * See dmsvcdemo.java for a discussion on outlier treatment. For decision
    * trees, outlier treatment is not really necessary. We skip outlier treatment
    * in this demo.
    * 3. Binning high cardinality data
    * No data preparation for the types we accept is necessary - even for high
    * cardinality predictors. Preprocessing to reduce the cardinality
    * (e.g., binning) can improve the performance of the build, but it could
    * penalize the accuracy of the resulting model.
    * The PrepareData() method in this demo program illustrates the preparation of the
    * build, test, and apply data. We skip PrepareData() since the decision tree
    * algorithm is very capable of handling data which has not been specially
    * prepared. For this demo, no data preparation will be performed.
    * Build Model:
    * Mining Model is the prime object in data mining. The buildModel() method
    * illustrates how to build a classification model using DT algorithm.
    * Test Model:
    * Classification model performance can be evaluated by computing test
    * metrics like accuracy, confusion matrix, lift and ROC. The testModel() or
    * computeTestMetrics() method illustrates how to perform a test operation to
    * compute various metrics.
    * Apply Model:
    * Predicting the target attribute values is the prime function of
    * classification models. The applyModel() method illustrates how to
    * predict the customer response for affinity card program.
    * EXECUTING DEMO PROGRAM
    * Refer to Oracle Data Mining Administrator's Guide
    * for guidelines for executing this demo program.
    // Generic Java api imports
    import java.math.BigDecimal;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.text.DecimalFormat;
    import java.text.MessageFormat;
    import java.util.Collection;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Stack;
    // Java Data Mining (JDM) standard api imports
    import javax.datamining.ExecutionHandle;
    import javax.datamining.ExecutionState;
    import javax.datamining.ExecutionStatus;
    import javax.datamining.JDMException;
    import javax.datamining.MiningAlgorithm;
    import javax.datamining.MiningFunction;
    import javax.datamining.NamedObject;
    import javax.datamining.SizeUnit;
    import javax.datamining.algorithm.tree.TreeHomogeneityMetric;
    import javax.datamining.algorithm.tree.TreeSettings;
    import javax.datamining.algorithm.tree.TreeSettingsFactory;
    import javax.datamining.base.AlgorithmSettings;
    import javax.datamining.base.Model;
    import javax.datamining.base.Task;
    import javax.datamining.data.AttributeDataType;
    import javax.datamining.data.CategoryProperty;
    import javax.datamining.data.CategorySet;
    import javax.datamining.data.CategorySetFactory;
    import javax.datamining.data.ModelSignature;
    import javax.datamining.data.PhysicalAttribute;
    import javax.datamining.data.PhysicalAttributeFactory;
    import javax.datamining.data.PhysicalAttributeRole;
    import javax.datamining.data.PhysicalDataSet;
    import javax.datamining.data.PhysicalDataSetFactory;
    import javax.datamining.data.SignatureAttribute;
    import javax.datamining.modeldetail.tree.TreeModelDetail;
    import javax.datamining.modeldetail.tree.TreeNode;
    import javax.datamining.resource.Connection;
    import javax.datamining.resource.ConnectionFactory;
    import javax.datamining.resource.ConnectionSpec;
    import javax.datamining.rule.Predicate;
    import javax.datamining.rule.Rule;
    import javax.datamining.supervised.classification.ClassificationApplySettings;
    import javax.datamining.supervised.classification.ClassificationApplySettingsFactory;
    import javax.datamining.supervised.classification.ClassificationModel;
    import javax.datamining.supervised.classification.ClassificationSettings;
    import javax.datamining.supervised.classification.ClassificationSettingsFactory;
    import javax.datamining.supervised.classification.ClassificationTestMetricOption;
    import javax.datamining.supervised.classification.ClassificationTestMetrics;
    import javax.datamining.supervised.classification.ClassificationTestMetricsTask;
    import javax.datamining.supervised.classification.ClassificationTestMetricsTaskFactory;
    import javax.datamining.supervised.classification.ClassificationTestTaskFactory;
    import javax.datamining.supervised.classification.ConfusionMatrix;
    import javax.datamining.supervised.classification.CostMatrix;
    import javax.datamining.supervised.classification.CostMatrixFactory;
    import javax.datamining.supervised.classification.Lift;
    import javax.datamining.supervised.classification.ReceiverOperatingCharacterics;
    import javax.datamining.task.BuildTask;
    import javax.datamining.task.BuildTaskFactory;
    import javax.datamining.task.apply.DataSetApplyTask;
    import javax.datamining.task.apply.DataSetApplyTaskFactory;
    // Oracle Java Data Mining (JDM) implemented api imports
    import oracle.dmt.jdm.algorithm.tree.OraTreeSettings;
    import oracle.dmt.jdm.resource.OraConnection;
    import oracle.dmt.jdm.resource.OraConnectionFactory;
    import oracle.dmt.jdm.modeldetail.tree.OraTreeModelDetail;
    public class dmtreedemo
    //Connection related data members
    private static Connection m_dmeConn;
    private static ConnectionFactory m_dmeConnFactory;
    //Object factories used in this demo program
    private static PhysicalDataSetFactory m_pdsFactory;
    private static PhysicalAttributeFactory m_paFactory;
    private static ClassificationSettingsFactory m_clasFactory;
    private static TreeSettingsFactory m_treeFactory;
    private static BuildTaskFactory m_buildFactory;
    private static DataSetApplyTaskFactory m_dsApplyFactory;
    private static ClassificationTestTaskFactory m_testFactory;
    private static ClassificationApplySettingsFactory m_applySettingsFactory;
    private static CostMatrixFactory m_costMatrixFactory;
    private static CategorySetFactory m_catSetFactory;
    private static ClassificationTestMetricsTaskFactory m_testMetricsTaskFactory;
    // Global constants
    private static DecimalFormat m_df = new DecimalFormat("##.####");
    private static String m_costMatrixName = null;
    public static void main( String args[] )
    try
    if ( args.length != 3 ) {
    System.out.println("Usage: java dmsvrdemo <Host name>:<Port>:<SID> <User Name> <Password>");
    return;
    String uri = args[0];
    String name = args[1];
    String password = args[2];
    // 1. Login to the Data Mining Engine
    m_dmeConnFactory = new OraConnectionFactory();
    ConnectionSpec connSpec = m_dmeConnFactory.getConnectionSpec();
    connSpec.setURI("jdbc:oracle:thin:@"+uri);
    connSpec.setName(name);
    connSpec.setPassword(password);
    m_dmeConn = m_dmeConnFactory.getConnection(connSpec);
    // 2. Clean up all previuosly created demo objects
    clean();
    // 3. Initialize factories for mining objects
    initFactories();
    m_costMatrixName = createCostMatrix();
    // 4. Build model with supplied cost matrix
    buildModel();
    // 5. Test model - To compute accuracy and confusion matrix, lift result
    // and ROC for the model from apply output data.
    // Please see dnnbdemo.java to see how to test the model
    // with a test input data and cost matrix.
    // Test the model with cost matrix
    computeTestMetrics("DT_TEST_APPLY_OUTPUT_COST_JDM",
    "dtTestMetricsWithCost_jdm", m_costMatrixName);
    // Test the model without cost matrix
    computeTestMetrics("DT_TEST_APPLY_OUTPUT_JDM",
    "dtTestMetrics_jdm", null);
    // 6. Apply the model
    applyModel();
    } catch(Exception anyExp) {
    anyExp.printStackTrace(System.out);
    } finally {
    try {
    //6. Logout from the Data Mining Engine
    m_dmeConn.close();
    } catch(Exception anyExp1) { }//Ignore
    * Initialize all object factories used in the demo program.
    * @exception JDMException if factory initalization failed
    public static void initFactories() throws JDMException
    m_pdsFactory = (PhysicalDataSetFactory)m_dmeConn.getFactory(
    "javax.datamining.data.PhysicalDataSet");
    m_paFactory = (PhysicalAttributeFactory)m_dmeConn.getFactory(
    "javax.datamining.data.PhysicalAttribute");
    m_clasFactory = (ClassificationSettingsFactory)m_dmeConn.getFactory(
    "javax.datamining.supervised.classification.ClassificationSettings");
    m_treeFactory = (TreeSettingsFactory) m_dmeConn.getFactory(
    "javax.datamining.algorithm.tree.TreeSettings");
    m_buildFactory = (BuildTaskFactory)m_dmeConn.getFactory(
    "javax.datamining.task.BuildTask");
    m_dsApplyFactory = (DataSetApplyTaskFactory)m_dmeConn.getFactory(
    "javax.datamining.task.apply.DataSetApplyTask");
    m_testFactory = (ClassificationTestTaskFactory)m_dmeConn.getFactory(
    "javax.datamining.supervised.classification.ClassificationTestTask");
    m_applySettingsFactory = (ClassificationApplySettingsFactory)m_dmeConn.getFactory(
    "javax.datamining.supervised.classification.ClassificationApplySettings");
    m_costMatrixFactory = (CostMatrixFactory)m_dmeConn.getFactory(
    "javax.datamining.supervised.classification.CostMatrix");
    m_catSetFactory = (CategorySetFactory)m_dmeConn.getFactory(
    "javax.datamining.data.CategorySet" );
    m_testMetricsTaskFactory = (ClassificationTestMetricsTaskFactory)m_dmeConn.getFactory(
    "javax.datamining.supervised.classification.ClassificationTestMetricsTask");
    * This method illustrates how to build a mining model using the
    * MINING_DATA_BUILD_V dataset and classification settings with
    * DT algorithm.
    * @exception JDMException if model build failed
    public static void buildModel() throws JDMException
    System.out.println("---------------------------------------------------");
    System.out.println("--- Build Model - using cost matrix ---");
    System.out.println("---------------------------------------------------");
    // 1. Create & save PhysicalDataSpecification
    PhysicalDataSet buildData =
    m_pdsFactory.create("MINING_DATA_BUILD_V", false);
    PhysicalAttribute pa = m_paFactory.create("CUST_ID",
    AttributeDataType.integerType, PhysicalAttributeRole.caseId );
    buildData.addAttribute(pa);
    m_dmeConn.saveObject("treeBuildData_jdm", buildData, true);
    //2. Create & save Mining Function Settings
    // Create tree algorithm settings
    TreeSettings treeAlgo = m_treeFactory.create();
    // By default, tree algorithm will have the following settings:
    // treeAlgo.setBuildHomogeneityMetric(TreeHomogeneityMetric.gini);
    // treeAlgo.setMaxDepth(7);
    // ((OraTreeSettings)treeAlgo).setMinDecreaseInImpurity(0.1, SizeUnit.percentage);
    // treeAlgo.setMinNodeSize( 0.05, SizeUnit.percentage );
    // treeAlgo.setMinNodeSize( 10, SizeUnit.count );
    // ((OraTreeSettings)treeAlgo).setMinDecreaseInImpurity(20, SizeUnit.count);
    // Set cost matrix. A cost matrix is used to influence the weighting of
    // misclassification during model creation (and scoring).
    // See Oracle Data Mining Concepts Guide for more details.
    String costMatrixName = m_costMatrixName;
    // Create ClassificationSettings
    ClassificationSettings buildSettings = m_clasFactory.create();
    buildSettings.setAlgorithmSettings(treeAlgo);
    buildSettings.setCostMatrixName(costMatrixName);
    buildSettings.setTargetAttributeName("AFFINITY_CARD");
    m_dmeConn.saveObject("treeBuildSettings_jdm", buildSettings, true);
    // 3. Create, save & execute Build Task
    BuildTask buildTask = m_buildFactory.create(
    "treeBuildData_jdm", // Build data specification
    "treeBuildSettings_jdm", // Mining function settings name
    "treeModel_jdm" // Mining model name
    buildTask.setDescription("treeBuildTask_jdm");
    executeTask(buildTask, "treeBuildTask_jdm");
    //4. Restore the model from the DME and explore the details of the model
    ClassificationModel model =
    (ClassificationModel)m_dmeConn.retrieveObject(
    "treeModel_jdm", NamedObject.model);
    // Display model build settings
    ClassificationSettings retrievedBuildSettings =
    (ClassificationSettings)model.getBuildSettings();
    if(buildSettings == null)
    System.out.println("Failure to restore build settings.");
    else
    displayBuildSettings(retrievedBuildSettings, "treeBuildSettings_jdm");
    // Display model signature
    displayModelSignature((Model)model);
    // Display model detail
    TreeModelDetail treeModelDetails = (TreeModelDetail) model.getModelDetail();
    displayTreeModelDetailsExtensions(treeModelDetails);
    * Create and save cost matrix.
    * Consider an example where it costs $10 to mail a promotion to a
    * prospective customer and if the prospect becomes a customer, the
    * typical sale including the promotion, is worth $100. Then the cost
    * of missing a customer (i.e. missing a $100 sale) is 10x that of
    * incorrectly indicating that a person is good prospect (spending
    * $10 for the promo). In this case, all prediction errors made by
    * the model are NOT equal. To act on what the model determines to
    * be the most likely (probable) outcome may be a poor choice.
    * Suppose that the probability of a BUY reponse is 10% for a given
    * prospect. Then the expected revenue from the prospect is:
    * .10 * $100 - .90 * $10 = $1.
    * The optimal action, given the cost matrix, is to simply mail the
    * promotion to the customer, because the action is profitable ($1).
    * In contrast, without the cost matrix, all that can be said is
    * that the most likely response is NO BUY, so don't send the
    * promotion. This shows that cost matrices can be very important.
    * The caveat in all this is that the model predicted probabilities
    * may NOT be accurate. For binary targets, a systematic approach to
    * this issue exists. It is ROC, illustrated below.
    * With ROC computed on a test set, the user can see how various model
    * predicted probability thresholds affect the action of mailing a promotion.
    * Suppose I promote when the probability to BUY exceeds 5, 10, 15%, etc.
    * what return can I expect? Note that the answer to this question does
    * not rely on the predicted probabilities being accurate, only that
    * they are in approximately the correct rank order.
    * Assuming that the predicted probabilities are accurate, provide the
    * cost matrix table name as input to the RANK_APPLY procedure to get
    * appropriate costed scoring results to determine the most appropriate
    * action.
    * In this demo, we will create the following cost matrix
    * ActualTarget PredictedTarget Cost
    * 0 0 0
    * 0 1 1
    * 1 0 8
    * 1 1 0
    private static String createCostMatrix() throws JDMException
    String costMatrixName = "treeCostMatrix";
    // Create categorySet
    CategorySet catSet = m_catSetFactory.create(AttributeDataType.integerType);
    // Add category values
    catSet.addCategory(new Integer(0), CategoryProperty.valid);
    catSet.addCategory(new Integer(1), CategoryProperty.valid);
    // Create cost matrix
    CostMatrix costMatrix = m_costMatrixFactory.create(catSet);
    // ActualTarget PredictedTarget Cost
    costMatrix.setValue(new Integer(0), new Integer(0), 0);
    costMatrix.setValue(new Integer(0), new Integer(1), 1);
    costMatrix.setValue(new Integer(1), new Integer(0), 8);
    costMatrix.setValue(new Integer(1), new Integer(1), 0);
    //save cost matrix
    m_dmeConn.saveObject(costMatrixName, costMatrix, true);
    return costMatrixName;
    * This method illustrates how to compute test metrics using
    * an apply output table that has actual and predicted target values. Here the
    * apply operation is done on the MINING_DATA_TEST_V dataset. It creates
    * an apply output table with actual and predicted target values. Using
    * ClassificationTestMetricsTask test metrics are computed. This produces
    * the same test metrics results as ClassificationTestTask.
    * @param applyOutputName apply output table name
    * @param testResultName test result name
    * @param costMatrixName table name of the supplied cost matrix
    * @exception JDMException if model test failed
    public static void computeTestMetrics(String applyOutputName,
    String testResultName, String costMatrixName) throws JDMException
    if (costMatrixName != null) {
    System.out.println("---------------------------------------------------");
    System.out.println("--- Test Model - using apply output table ---");
    System.out.println("--- - using cost matrix table ---");
    System.out.println("---------------------------------------------------");
    else {
    System.out.println("---------------------------------------------------");
    System.out.println("--- Test Model - using apply output table ---");
    System.out.println("--- - using no cost matrix table ---");
    System.out.println("---------------------------------------------------");
    // 1. Do the apply on test data to create an apply output table
    // Create & save PhysicalDataSpecification
    PhysicalDataSet applyData =
    m_pdsFactory.create( "MINING_DATA_TEST_V", false );
    PhysicalAttribute pa = m_paFactory.create("CUST_ID",
    AttributeDataType.integerType, PhysicalAttributeRole.caseId );
    applyData.addAttribute( pa );
    m_dmeConn.saveObject( "treeTestApplyData_jdm", applyData, true );
    // 2 Create & save ClassificationApplySettings
    ClassificationApplySettings clasAS = m_applySettingsFactory.create();
    HashMap sourceAttrMap = new HashMap();
    sourceAttrMap.put( "AFFINITY_CARD", "AFFINITY_CARD" );
    clasAS.setSourceDestinationMap( sourceAttrMap );
    m_dmeConn.saveObject( "treeTestApplySettings_jdm", clasAS, true);
    // 3 Create, store & execute apply Task
    DataSetApplyTask applyTask = m_dsApplyFactory.create(
    "treeTestApplyData_jdm",
    "treeModel_jdm",
    "treeTestApplySettings_jdm",
    applyOutputName);
    if(executeTask(applyTask, "treeTestApplyTask_jdm"))
    // Compute test metrics on new created apply output table
    // 4. Create & save PhysicalDataSpecification
    PhysicalDataSet applyOutputData = m_pdsFactory.create(
    applyOutputName, false );
    applyOutputData.addAttribute( pa );
    m_dmeConn.saveObject( "treeTestApplyOutput_jdm", applyOutputData, true );
    // 5. Create a ClassificationTestMetricsTask
    ClassificationTestMetricsTask testMetricsTask =
    m_testMetricsTaskFactory.create( "treeTestApplyOutput_jdm", // apply output data used as input
    "AFFINITY_CARD", // actual target column
    "PREDICTION", // predicted target column
    testResultName // test metrics result name
    testMetricsTask.computeMetric( // enable confusion matrix computation
    ClassificationTestMetricOption.confusionMatrix, true );
    testMetricsTask.computeMetric( // enable lift computation
    ClassificationTestMetricOption.lift, true );
    testMetricsTask.computeMetric( // enable ROC computation
    ClassificationTestMetricOption.receiverOperatingCharacteristics, true );
    testMetricsTask.setPositiveTargetValue( new Integer(1) );
    testMetricsTask.setNumberOfLiftQuantiles( 10 );
    testMetricsTask.setPredictionRankingAttrName( "PROBABILITY" );
    if (costMatrixName != null) {
    testMetricsTask.setCostMatrixName(costMatrixName);
    displayTable(costMatrixName, "", "order by ACTUAL_TARGET_VALUE, PREDICTED_TARGET_VALUE");
    // Store & execute the task
    boolean isTaskSuccess = executeTask(testMetricsTask, "treeTestMetricsTask_jdm");
    if( isTaskSuccess ) {
    // Restore & display test metrics
    ClassificationTestMetrics testMetrics = (ClassificationTestMetrics)
    m_dmeConn.retrieveObject( testResultName, NamedObject.testMetrics );
    // Display classification test metrics
    displayTestMetricDetails(testMetrics);
    * This method illustrates how to apply the mining model on the
    * MINING_DATA_APPLY_V dataset to predict customer
    * response. After completion of the task apply output table with the
    * predicted results is created at the user specified location.
    * @exception JDMException if model apply failed
    public static void applyModel() throws JDMException
    System.out.println("---------------------------------------------------");
    System.out.println("--- Apply Model ---");
    System.out.println("---------------------------------------------------");
    System.out.println("---------------------------------------------------");
    System.out.println("--- Business case 1 ---");
    System.out.println("--- Find the 10 customers who live in Italy ---");
    System.out.println("--- that are least expensive to be convinced to ---");
    System.out.println("--- use an affinity card. ---");
    System.out.println("---------------------------------------------------");
    // 1. Create & save PhysicalDataSpecification
    PhysicalDataSet applyData =
    m_pdsFactory.create( "MINING_DATA_APPLY_V", false );
    PhysicalAttribute pa = m_paFactory.create("CUST_ID",
    AttributeDataType.integerType, PhysicalAttributeRole.caseId );
    applyData.addAttribute( pa );
    m_dmeConn.saveObject( "treeApplyData_jdm", applyData, true );
    // 2. Create & save ClassificationApplySettings
    ClassificationApplySettings clasAS = m_applySettingsFactory.create();
    // Add source attributes
    HashMap sourceAttrMap = new HashMap();
    sourceAttrMap.put( "COUNTRY_NAME", "COUNTRY_NAME" );
    clasAS.setSourceDestinationMap( sourceAttrMap );
    // Add cost matrix
    clasAS.setCostMatrixName( m_costMatrixName );
    m_dmeConn.saveObject( "treeApplySettings_jdm", clasAS, true);
    // 3. Create, store & execute apply Task
    DataSetApplyTask applyTask = m_dsApplyFactory.create(
    "treeApplyData_jdm", "treeModel_jdm",
    "treeApplySettings_jdm", "TREE_APPLY_OUTPUT1_JDM");
    executeTask(applyTask, "treeApplyTask_jdm");
    // 4. Display apply result -- Note that APPLY results do not need to be
    // reverse transformed, as done in the case of model details. This is
    // because class values of a classification target were not (required to
    // be) binned or normalized.
    // Find the 10 customers who live in Italy that are least expensive to be
    // convinced to use an affinity card.
    displayTable("TREE_APPLY_OUTPUT1_JDM",
    "where COUNTRY_NAME='Italy' and ROWNUM < 11 ",
    "order by COST");
    System.out.println("---------------------------------------------------");
    System.out.println("--- Business case 2 ---");
    System.out.println("--- List ten customers (ordered by their id) ---");
    System.out.println("--- along with likelihood and cost to use or ---");
    System.out.println("--- reject the affinity card. ---");
    System.out.println("---------------------------------------------------");
    // 1. Create & save PhysicalDataSpecification
    applyData =
    m_pdsFactory.create( "MINING_DATA_APPLY_V", false );
    pa = m_paFactory.create("CUST_ID",
    AttributeDataType.integerType, PhysicalAttributeRole.caseId );
    applyData.addAttribute( pa );
    m_dmeConn.saveObject( "treeApplyData_jdm", applyData, true );
    // 2. Create & save ClassificationApplySettings
    clasAS = m_applySettingsFactory.create();
    // Add cost matrix
    clasAS.setCostMatrixName( m_costMatrixName );
    m_dmeConn.saveObject( "treeApplySettings_jdm", clasAS, true);
    // 3. Create, store & execute apply Task
    applyTask = m_dsApplyFactory.create(
    "treeApplyData_jdm", "treeModel_jdm",
    "treeApplySettings_jdm", "TREE_APPLY_OUTPUT2_JDM");
    executeTask(applyTask, "treeApplyTask_jdm");
    // 4. Display apply result -- Note that APPLY results do not need to be
    // reverse transformed, as done in the case of model details. This is
    // because class values of a classification target were not (required to
    // be) binned or normalized.
    // List ten customers (ordered by their id) along with likelihood and cost
    // to use or reject the affinity card (Note: while this example has a
    // binary target, such a query is useful in multi-class classification -
    // Low, Med, High for example).
    displayTable("TREE_APPLY_OUTPUT2_JDM",
    "where ROWNUM < 21",
    "order by CUST_ID, PREDICTION");
    System.out.println("---------------------------------------------------");
    System.out.println("--- Business case 3 ---");
    System.out.println("--- Find the customers who work in Tech support ---");
    System.out.println("--- and are under 25 who is going to response ---");
    System.out.println("--- to the new affinity card program. ---");
    System.out.println("---------------------------------------------------");
    // 1. Create & save PhysicalDataSpecification
    applyData =
    m_pdsFactory.create( "MINING_DATA_APPLY_V", false );
    pa = m_paFactory.create("CUST_ID",
    AttributeDataType.integerType, PhysicalAttributeRole.caseId );
    applyData.addAttribute( pa );
    m_dmeConn.saveObject( "treeApplyData_jdm", applyData, true );
    // 2. Create & save ClassificationApplySettings
    clasAS = m_applySettingsFactory.create();
    // Add source attributes
    sourceAttrMap = new HashMap();
    sourceAttrMap.put( "AGE", "AGE" );
    sourceAttrMap.put( "OCCUPATION", "OCCUPATION" );
    clasAS.setSourceDestinationMap( sourceAttrMap );
    m_dmeConn.saveObject( "treeApplySettings_jdm", clasAS, true);
    // 3. Create, store & execute apply Task
    applyTask = m_dsApplyFactory.create(
    "treeApplyData_jdm", "treeModel_jdm",
    "treeApplySettings_jdm", "TREE_APPLY_OUTPUT3_JDM");
    executeTask(applyTask, "treeApplyTask_jdm");
    // 4. Display apply result -- Note that APPLY results do not need to be
    // reverse transformed, as done in the case of model details. This is
    // because class values of a classification target were not (required to
    // be) binned or normalized.
    // Find the customers who work in Tech support and are under 25 who is
    // going to response to the new affinity card program.
    displayTable("TREE_APPLY_OUTPUT3_JDM",
    "where OCCUPATION = 'TechSup' " +
    "and AGE < 25 " +
    "and PREDICTION = 1 ",
    "order by CUST_ID");
    * This method stores the given task with the specified name in the DMS
    * and submits the task for asynchronous execution in the DMS. After
    * completing the task successfully it returns true. If there is a task
    * failure, then it prints error description and returns false.
    * @param taskObj task object
    * @param taskName name of the task
    * @return boolean returns true when the task is successful
    * @exception JDMException if task execution failed
    public static boolean executeTask(Task taskObj, String taskName)
    throws JDMException
    boolean isTaskSuccess = false;
    m_dmeConn.saveObject(taskName, taskObj, true);
    ExecutionHandle execHandle = m_dmeConn.execute(taskName);
    System.out.print(taskName + " is started, please wait. ");
    //Wait for completion of the task
    ExecutionStatus status = execHandle.waitForCompletion(Integer.MAX_VALUE);
    //Check the status of the task after completion
    isTaskSuccess = status.getState().equals(ExecutionState.success);
    if( isTaskSuccess ) //Task completed successfully
    System.out.println(taskName + " is successful.");
    else //Task failed
    System.out.println(taskName + " failed.\nFailure Description: " +
    status.getDescription() );
    return isTaskSuccess;
    private static void displayBuildSettings(
    ClassificationSettings clasSettings, String buildSettingsName)
    System.out.println("BuildSettings Details from the "
    + buildSettingsName + " table:");
    displayTable(buildSettingsName, "", "order by SETTING_NAME");
    System.out.println("BuildSettings Details from the "
    + buildSettingsName + " model build settings object:");
    String objName = clasSettings.getName();
    if(objName != null)
    System.out.println("Name = " + objName);
    String objDescription = clasSettings.getDescription();
    if(objDescription != null)
    System.out.println("Description = " + objDescription);
    java.util.Date creationDate = clasSettings.getCreationDate();
    String creator = clasSettings.getCreatorInfo();
    String targetAttrName = clasSettings.getTargetAttributeName();
    System.out.println("Target attribute name = " + targetAttrName);
    AlgorithmSettings algoSettings = clasSettings.getAlgorithmSettings();
    if(algoSettings == null)
    System.out.println("Failure: clasSettings.getAlgorithmSettings() returns null");
    MiningAlgorithm algo = algoSettings.getMiningAlgorithm();
    if(algo == null) System.out.println("Failure: algoSettings.getMiningAlgorithm() returns null");
    System.out.println("Algorithm Name: " + algo.name());
    MiningFunction function = clasSettings.getMiningFunction();
    if(function == null) System.out.println("Failure: clasSettings.getMiningFunction() returns null");
    System.out.println("Function Name: " + function.name());
    try {
    String costMatrixName = clasSettings.getCostMatrixName();
    if(costMatrixName != null) {
    System.out.println("Cost Matrix Details from the " + costMatrixName
    + " table:");
    displayTable(costMatrixName, "", "order by ACTUAL_TARGET_VALUE, PREDICTED_TARGET_VALUE");
    } catch(Exception jdmExp)
    System.out.println("Failure: clasSettings.getCostMatrixName()throws exception");
    jdmExp.printStackTrace();
    // List of DT algorithm settings
    // treeAlgo.setBuildHomogeneityMetric(TreeHomogeneityMetric.gini);
    // treeAlgo.setMaxDepth(7);
    // ((OraTreeSettings)treeAlgo).setMinDecreaseInImpurity(0.1, SizeUnit.percentage);
    // treeAlgo.setMinNodeSize( 0.05, SizeUnit.percentage );
    // treeAlgo.setMinNodeSize( 10, SizeUnit.count );
    // ((OraTreeSettings)treeAlgo).setMinDecreaseInImpurity(20, SizeUnit.count);
    TreeHomogeneityMetric homogeneityMetric = ((OraTreeSettings)algoSettings).getBuildHomogeneityMetric();
    System.out.println("Homogeneity Metric: " + homogeneityMetric.name());
    int intValue = ((OraTreeSettings)algoSettings).getMaxDepth();
    System.out.println("Max Depth: " + intValue);
    double doubleValue = ((OraTreeSettings)algoSettings).getMinNodeSizeForSplit(SizeUnit.percentage);
    System.out.println("MinNodeSizeForSplit (percentage): " + m_df.format(doubleValue));
    doubleValue = ((OraTreeSettings)algoSettings).getMinNodeSizeForSplit(SizeUnit.count);
    System.out.println("MinNodeSizeForSplit (count): " + m_df.format(doubleValue));
    doubleValue = ((OraTreeSettings)algoSettings).getMinNodeSize();
    SizeUnit unit = ((OraTreeSettings)algoSettings).getMinNodeSizeUnit();
    System.out.println("Min Node Size (" + unit.name() +"): " + m_df.format(doubleValue));
    doubleValue = ((OraTreeSettings)algoSettings).getMinNodeSize( SizeUnit.count );
    System.out.println("Min Node Size (" + SizeUnit.count.name() +"): " + m_df.format(doubleValue));
    doubleValue = ((OraTreeSettings)algoSettings).getMinNodeSize( SizeUnit.percentage );
    System.out.println("Min Node Size (" + SizeUnit.percentage.name() +"): " + m_df.format(doubleValue));
    * This method displayes DT model signature.
    * @param model model object
    * @exception JDMException if failed to retrieve model signature
    public static void displayModelSignature(Model model) throws JDMException
    String modelName = model.getName();
    System.out.println("Model Name: " + modelName);
    ModelSignature modelSignature = model.getSignature();
    System.out.println("ModelSignature Deatils: ( Attribute Name, Attribute Type )");
    MessageFormat mfSign = new MessageFormat(" ( {0}, {1} )");
    String[] vals = new String[3];
    Collection sortedSet = modelSignature.getAttributes();
    Iterator attrIterator = sortedSet.iterator();
    while(attrIterator.hasNext())
    SignatureAttribute attr = (SignatureAttribute)attrIterator.next();
    vals[0] = attr.getName();
    vals[1] = attr.getDataType().name();
    System.out.println( mfSign.format(vals) );
    * This method displayes DT model details.
    * @param treeModelDetails tree model details object
    * @exception JDMException if failed to retrieve model details
    public static void displayTreeModelDetailsExtensions(TreeModelDetail treeModelDetails)
    throws JDMException
    System.out.println( "\nTreeModelDetail: Model name=" + "treeModel_jdm" );
    TreeNode root = treeModelDetails.getRootNode();
    System.out.println( "\nRoot node: " + root.getIdentifier() );
    // get the info for the tree model
    int treeDepth = ((OraTreeModelDetail) treeModelDetails).getTreeDepth();
    System.out.println( "Tree depth: " + treeDepth );
    int totalNodes = ((OraTreeModelDetail) treeModelDetails).getNumberOfNodes();
    System.out.println( "Total number of nodes: " + totalNodes );
    int totalLeaves = ((OraTreeModelDetail) treeModelDetails).getNumberOfLeafNodes();
    System.out.println( "Total number of leaf nodes: " + totalLeaves );
    Stack nodeStack = new Stack();
    nodeStack.push( root);
    while( !nodeStack.empty() )
    TreeNode node = (TreeNode) nodeStack.pop();
    // display this node
    int nodeId = node.getIdentifier();
    long caseCount = node.getCaseCount();
    Object prediction = node.getPrediction();
    int level = node.getLevel();
    int children = node.getNumberOfChildren();
    TreeNode parent = node.getParent();
    System.out.println( "\nNode id=" + nodeId + " at level " + level );
    if( parent != null )
    System.out.println( "parent: " + parent.getIdentifier() +
    ", children=" + children );
    System.out.println( "Case count: " + caseCount + ", prediction: " + prediction );
    Predicate predicate = node.getPredicate();
    System.out.println( "Predicate: " + predicate.toString() );
    Predicate[] surrogates = node.getSurrogates();
    if( surrogates != null )
    for( int i=0; i<surrogates.length; i++ )
    System.out.println( "Surrogate[" + i + "]: " + surrogates[i] );
    // add child nodes in the stack
    if( children > 0 )
    TreeNode[] childNodes = node.getChildren();
    for( int i=0; i<childNodes.length; i++ )
    nodeStack.push( childNodes[i] );
    TreeNode[] allNodes = treeModelDetails.getNodes();
    System.out.print( "\nNode identifiers by getNodes():" );
    for( int i=0; i<allNodes.length; i++ )
    System.out.print( " " + allNodes.getIdentifier() );
    System.out.println();
    // display the node identifiers
    int[] nodeIds = treeModelDetails.getNodeIdentifiers();
    System.out.print( "Node identifiers by getNodeIdentifiers():" );
    for( int i=0; i<nodeIds.length; i++ )
    System.out.print( " " + nodeIds[i] );
    System.out.println();
    TreeNode node = treeModelDetails.getNode(nodeIds.length-1);
    System.out.println( "Node identifier by getNode(" + (nodeIds.length-1) +
    "): " + node.getIdentifier() );
    Rule rule2 = treeModelDetails.getRule(nodeIds.length-1);
    System.out.println( "Rule identifier by getRule(" + (nodeIds.length-1) +
    "): " + rule2.getRuleIdentifier() );
    // get the rules and display them
    Collection ruleColl = treeModelDetails.getRules();
    Iterator ruleIterator = ruleColl.iterator();
    while( ruleIterator.hasNext() )
    Rule rule = (Rule) ruleIterator.next();
    int ruleId = rule.getRuleIdentifier();
    Predicate antecedent = (Predicate) rule.getAntecedent();
    Predicate consequent = (Predicate) rule.getConsequent();
    System.out.println( "\nRULE " + ruleId + ": support=" +
    rule.getSupport() + " (abs=" + rule.getAbsoluteSupport() +
    "), confidence=" + rule.getConfidence() );
    System.out.println( antecedent );
    System.out.println( "=======>" );
    System.out.println( consequent );
    * Display classification test metrics object
    * @param testMetrics classification test metrics object
    * @exception JDMException if failed to retrieve test metric details
    public static void displayTestMetricDetails(
    ClassificationTestMetrics testMetrics) throws JDMException
    // Retrieve Oracle ABN model test metrics deatils extensions
    // Test Metrics Name
    System.out.println("Test Metrics Name = " + testMetrics.getName());
    // Model Name
    System.out.println("Model Name = " + testMetrics.getModelName());
    // Test Data Name
    System.out.println("Test Data Name = " + testMetrics.getTestDataName());
    // Accuracy
    System.out.println("Accuracy = " + m_df.format(testMetrics.getAccuracy().doubleValue()));
    // Confusion Matrix
    ConfusionMatrix confusionMatrix = testMetrics.getConfusionMatrix();
    Collection categories = confusionMatrix.getCategories();
    Iterator xIterator = categories.iterator();
    System.out.println("Confusion Matrix: Accuracy = " + m_df.format(confusionMatrix.getAccuracy()));
    System.out.println("Confusion Matrix: Error = " + m_df.format(confusionMatrix.getError()));
    System.out.println("Confusion Matrix:( Actual, Prection, Value )");
    MessageFormat mf = new MessageFormat(" ( {0}, {1}, {2} )");
    String[] vals = new String[3];
    while(xIterator.hasNext())
    Object actual = xIterator.next();
    vals[0] = actual.toString();
    Iterator yIterator = categories.iterator();
    while(yIterator.hasNext())
    Object predicted = yIterator.next();
    vals[1] = predicted.toString();
    long number = confusionMatrix.getNumberOfPredictions(actual, predicted);
    vals[2] = Long.toString(number);
    System.out.println(mf.format(vals));
    // Lift
    Lift lift = testMetrics.getLift();
    System.out.println("Lift Details:");
    System.out.println("Lift: Target Attribute Name = " + lift.getTargetAttributeName());
    System.out.println("Lift: Positive Target Value = " + lift.getPositiveTargetValue());
    System.out.println("Lift: Total Cases = " + lift.getTotalCases());
    System.out.println("Lift: Total Positive Cases = " + lift.getTotalPositiveCases());
    int numberOfQuantiles = lift.getNumberOfQuantiles();
    System.out.println("Lift: Number Of Quantiles = " + numberOfQuantiles);
    System.out.println("Lift: ( QUANTILE_NUMBER, QUANTILE_TOTAL_COUNT, QUANTILE_TARGET_COUNT, PERCENTAGE_RECORDS_CUMULATIVE,CUMULATIVE_LIFT,CUMULATIVE_TARGET_DENSITY,TARGETS_CUMULATIVE, NON_TARGETS_CUMULATIVE, LIFT_QUANTILE, TARGET_DENSITY )");
    MessageFormat mfLift = new MessageFormat(" ( {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9} )");
    String[] liftVals = new String[10];
    for(int iQuantile=1; iQuantile<= numberOfQuantiles; iQuantile++)
    liftVals[0] = Integer.toString(iQuantile); //QUANTILE_NUMBER
    liftVals[1] = Long.toString(lift.getCases((iQuantile-1), iQuantile));//QUANTILE_TOTAL_COUNT
    liftVals[2] = Long.toString(lift.getNumberOfPositiveCases((iQuantile-1), iQuantile));//QUANTILE_TARGET_COUNT
    liftVals[3] = m_df.format(lift.getCumulativePercentageSize(iQuantile).doubleValue());//PERCENTAGE_RECORDS_CUMULATIVE
    liftVals[4] = m_df.format(lift.getCumulativeLift(iQuantile).doubleValue());//CUMULATIVE_LIFT
    liftVals[5] = m_df.format(lift.getCumulativeTargetDensity(iQuantile).doubleValue());//CUMULATIVE_TARGET_DENSITY
    liftVals[6] = Long.toString(lift.getCumulativePositiveCases(iQuantile));//TARGETS_CUMULATIVE
    liftVals[7] = Long.toString(lift.getCumulativeNegativeCases(iQuantile));//NON_TARGETS_CUMULATIVE
    liftVals[8] = m_df.format(lift.getLift(iQuantile, iQuantile).doubleValue());//LIFT_QUANTILE
    liftVals[9] = m_df.format(lift.getTargetDensity(iQuantile, iQuantile).doubleValue());//TARGET_DENSITY
    System.out.println(mfLift.format(liftVals));
    // ROC
    ReceiverOperatingCharacterics roc = testMetrics.getROC();
    System.out.println("ROC Details:");
    System.out.println("ROC: Area Under Curve = " + m_df.format(roc.getAreaUnderCurve()));
    int nROCThresh = roc.getNumberOfThresholdCandidates();
    System.out.println("ROC: Number Of Threshold Candidates = " + nROCThresh);
    System.out.println("ROC: ( INDEX, PROBABILITY, TRUE_POSITIVES, FALSE_NEGATIVES, FALSE_POSITIVES, TRUE_NEGATIVES, TRUE_POSITIVE_FRACTION, FALSE_POSITIVE_FRACTION )");
    MessageFormat mfROC = new MessageFormat(" ( {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7} )");
    String[] rocVals = new String[8];
    for(int iROC=1; iROC <= nROCThresh; iROC++)
    rocVals[0] = Integer.toString(iROC); //INDEX
    rocVals[1] = m_df.format(roc.getProbabilityThreshold(iROC));//PROBABILITY
    rocVals[2] = Long.toString(roc.getPositives(iROC, true));//TRUE_POSITIVES
    rocVals[3] = Long.toString(roc.getNegatives(iROC, false));//FALSE_NEGATIVES
    rocVals[4] = Long.toString(roc.getPositives(iROC, false));//FALSE_POSITIVES
    rocVals[5] = Long.toString(roc.getNegatives(iROC, true));//TRUE_NEGATIVES
    rocVals[6] = m_df.format(roc.getHitRate(iROC));//TRUE_POSITIVE_FRACTION
    rocVals[7] = m_df.format(roc.getFalseAlarmRate(iROC));//FALSE_POSITIVE_FRACTION
    System.out.println(mfROC.format(rocVals));
    private static void displayTable(String tableName, String whereCause, String orderByColumn)
    StringBuffer emptyCol = new StringBuffer(" ");
    java.sql.Connection dbConn =
    ((OraConnection)m_dmeConn).getDatabaseConnection();
    PreparedStatement pStmt = null;
    ResultSet rs = null;
    try
    pStmt = dbConn.prepareStatement("SELECT * FROM " + tableName + " " + whereCause + " " + orderByColumn);
    rs = pStmt.executeQuery();
    ResultSetMetaData rsMeta = rs.getMetaData();
    int colCount = rsMeta.getColumnCount();
    StringBuffer header = new StringBuffer();
    System.out.println("Table : " + tableName);
    //Build table header
    for(int iCol=1; iCol<=colCount; iCol++)
    String colName = rsMeta.getColumnName(iCol);
    header.append(emptyCol.replace(0, colName.length(), colName));
    emptyCol = new StringBuffer(" ");
    System.out.println(header.toString());
    //Write table data
    while(rs.next())
    StringBuffer rowContent = new StringBuffer();
    for(int iCol=1; iCol<=colCount; iCol++)
    int sqlType = rsMeta.getColumnType(iCol);
    Object obj = rs.getObject(iCol);
    String colContent = null;
    if(obj instanceof java.lang.Number)
    try
    BigDecimal bd = (BigDecimal)obj;
    if(bd.scale() > 5)
    colContent = m_df.format(obj);
    } else
    colContent = bd.toString();
    } catch(Exception anyExp) {
    colContent = m_df.format(obj);
    } else
    if(obj == null)
    colContent = "NULL";
    else
    colContent = obj.toString();
    rowContent.append(" "+emptyCol.replace(0, colContent.length(), colContent));
    emptyCol = new StringBuffer(" ");
    System.out.println(rowContent.toString());
    } catch(Exception anySqlExp) {
    anySqlExp.printStackTrace();
    }//Ignore
    private static void createTableForTestMetrics(String applyOutputTableName,
    String testDataName,
    String testMetricsInputTableName)
    //0. need to execute the following in the schema
    String sqlCreate =
    "create table " + testMetricsInputTableName + " as " +
    "select a.id as id, prediction, probability, affinity_card " +
    "from " + testDataName + " a, " + applyOutputTableName + " b " +
    "where a.id = b.id";
    java.sql.Connection dbConn = ((OraConnection) m_dmeConn).getDatabaseConnection();
    Statement stmt = null;
    try
    stmt = dbConn.createStatement();
    stmt.executeUpdate( sqlCreate );
    catch( Exception anySqlExp )
    System.out.println( anySqlExp.getMessage() );
    anySqlExp.printStackTrace();
    finally
    try
    stmt.close();
    catch( SQLException sqlExp ) {}
    private static void clean()
    java.sql.Connection dbConn =
    ((OraConnection) m_dmeConn).getDatabaseConnection();
    Statement stmt = null;
    // Drop apply output table
    try
    stmt = dbConn.createStatement();
    stmt.executeUpdate("DROP TABLE TREE_APPLY_OUTPUT1_JDM");
    } catch(Exception anySqlExp) {}//Ignore
    finally
    try
    stmt.close();
    catch( SQLException sqlExp ) {}
    try
    stmt = dbConn.createStatement();
    stmt.executeUpdate("DROP TABLE TREE_APPLY_OUTPUT2_JDM");
    } catch(Exception anySqlExp) {}//Ignore
    finally
    try
    stmt.close();
    catch( SQLException sqlExp ) {}
    try
    stmt = dbConn.createStatement();
    stmt.executeUpdate("DROP TABLE TREE_APPLY_OUTPUT3_JDM");
    } catch(Exception anySqlExp) {}//Ignore
    finally
    try
    stmt.close();
    catch( SQLException sqlExp ) {}
    // Drop apply output table created for test metrics task
    try
    stmt = dbConn.createStatement();
    stmt.executeUpdate("DROP TABLE DT_TEST_APPLY_OUTPUT_COST_JDM");
    } catch(Exception anySqlExp) {}//Ignore
    finally
    try
    stmt.close();
    catch( SQLException sqlExp ) {}
    try
    stmt = dbConn.createStatement();
    stmt.executeUpdate("DROP TABLE DT_TEST_APPLY_OUTPUT_JDM");
    } catch(Exception anySqlExp) {}//Ignore
    finally
    try
    stmt.close();
    catch( SQLException sqlExp ) {}
    //Drop the model
    try {
    m_dmeConn.removeObject( "treeModel_jdm", NamedObject.model );
    } catch(Exception jdmExp) {}
    // drop test metrics result: created by TestMetricsTask
    try {
    m_dmeConn.removeObject( "dtTestMetricsWithCost_jdm", NamedObject.testMetrics );
    } catch(Exception jdmExp) {}
    try {
    m_dmeConn.removeObject( "dtTestMetrics_jdm", NamedObject.testMetrics );
    } catch(Exception jdmExp) {}

    Hi
    I am not sure whether this will help but someone else was getting an error with a java.sql.SQLexception: Unsupported feature. Here is a link to the fix: http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=3&t=007947
    Best wishes
    Michael

Maybe you are looking for

  • Extract Roles (DB Object ) into separate files in Oracle

    Hi all, Help needed in extraction of Oracle Roles in a File (Text) through a script where I can basically extract all the Oracle Roles to a file from a given schema Thanks in Advance, Anurag.

  • Disable Delete of current transaction in foreground proccesing of BI sess.

    Hi experts, I want to disable possibility to delete current transaction from Batch input session while foreground proccesing. This is possible to do using /bdel or using Menu System>Services>Batch Input-->Delete transaction. Is there any way to do it

  • How can I get iTunes Music I bought into FCE in an editable form?

    I've been making a teaser for a documentary (okay, it could be a mockumentary) about family events this summer. Trying to use Lux Aeterna (the Requiem for a Dream song that SOUNDS like a trailer...) and all I'm getting is a beep every eighth note. I

  • Mac pro graphics card compatibility

    I have a 2008 mac pro works wonderful but the graphics card has recently burned out. I need to replace it but I want something more modern. What kinds of graphics cards are compatible with this model of mac pro. Preferably not something that has a pr

  • Document could not be opened for editing

    Hi, I'm trying to open Office documents  from SharePoint 2010 on Google chrome browser and it throws the below error.  "The document could not be opened for editing. A Microsoft SharePoint Foundation compatible application could not be found to edit