001    package railo.commons.sql;
002    
003    import railo.commons.lang.ClassUtil;
004    
005    public class OracleCaster {
006    
007            private static final Class OPAQUE=ClassUtil.loadClass("oracle.sql.OPAQUE", null);
008            
009            public static Object OPAQUE(Object o) {
010                    if(o==null) return null;
011                            
012                    try {
013                            byte[] bv = ((oracle.sql.OPAQUE)o).getBytes();
014                            
015                            //OPAQUE op = ((oracle.sql.OPAQUE)o);
016                            //OpaqueDescriptor desc = ((oracle.sql.OPAQUE)o).getDescriptor();
017                            
018                            
019                            //Method getBytesValue = o.getClass().getMethod("getBytesValue", new Class[0]);
020                            //byte[] bv = (byte[])getBytesValue.invoke(o, new Object[0]);
021                            return new String(bv,"UTF-8");
022                    }
023                    catch (Exception e) {
024                            //print.printST(e);
025                    }
026                    
027                    return o;
028            }
029    
030            private static boolean equals(Class left, Class right) {
031                    if(left==right)return true;
032                    return left.equals(right.getName());
033            }
034    
035    }