ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: oracle XmlType
Date Sat, 11 Nov 2006 15:39:37 GMT
Hmm, this could be fun. ;-)

The connection pool wraps the result set...and so does iBATIS (for
logging), and depending upon the log level, you will see different
result set objects.

What you will need to do is look at the result set you get, and based
on that, try to get the object it is wrapping.

So, if it's the ResultSetLogProxy, there is a private field that has
it (it's private, but you can still get that via reflection... and I
just added a getter for it in SVN).

I am looking for a copy of dbcp now..

Larry


On 11/11/06, Timo Schnölzer <tschnoelzer@nsdcom.de> wrote:
>
>
> Hi Jeff,
>
> I am getting a
>
> com.ibatis.common.jdbc.logging.ResultSetLogProxy
>
> when using DEBUG level and a apache dbcp.DelegatingResultSet when going on
> ERROR for Resultset debugging.
>
> Any ideas welcome
>
>
>
> Timo
>
>  ________________________________
>  Von: Jeff Butler [mailto:jeffgbutler@gmail.com]
> Gesendet: Freitag, 10. November 2006 17:51
> An: user-java@ibatis.apache.org
> Betreff: Re: oracle XmlType
>
>
>
> What class is returned from getter.getResultSet()?
>
> If you have logging enabled, you might be getting iBATIS' result set proxy
> instead of the underlying result set.
>
> Does it work differently if you enable or disable logging?
>
> Jeff Butler
>
>
>
>
> On 11/10/06, Timo Schnölzer <tschnoelzer@nsdcom.de> wrote:
> > Hi Folks,
> >
> > I am using the Ibatis mapping tool for long and want to map XmlType from
> Oracle.
> > I registerd the XMLTypeHandlerCallbackand the system is running into the
> getResult Method
> > returning the UnsupportedOperationException  error:
> >
> > if (getter.getResultSet() instanceof OracleResultSet) {
> >                        OPAQUE opaqueValue = getOpaqueValue(getter);
> >                        if (opaqueValue != null) {
> >                                XMLType xmlResult =
> XMLType.createXML(opaqueValue);
> >                                return xmlResult.getDOM();
> >                        } else {
> >                                return (Document) null;
> >                        }
> >                } else {
> >                        throw new UnsupportedOperationException(
> >                                        "XMLType mapping
> only supported for Oracle RDBMS");
> > }
> >
> > Has anyone out there running example with the mapping and Object ?
> >
> > I am using "SELECT 1 as id, xmlelement("Flat", xmlattributes(z.floors
> ..... "
> >
> > With:
> >
> >        <resultMap id="houseResult" class="houseData">
> >                <result property="id" column="id" />
> >                <result property="xmlValue" column="xmlValue"/>
> >        </resultMap>
> >
> >        <select id="getHouseXML"
> >                resultMap=" houseResult "> select ...
> >
> > and:
> >
> > import org.w3c.dom.Document;
> >
> > public class House {
> >
> >        private Integer id;
> >
> >        private Document xmlValue;
> >
> >        public Document getXmlValue() {
> >                return xmlValue;
> >        }
> >
> >        public void setXmlValue(Document xmlValue) {
> >                this.xmlValue = xmlValue;
> >        }
> >
> >        public Integer getId() {
> >                return id;
> >        }
> >
> >        public void setId(Integer id) {
> >                this.id = id;
> >        }
> >
> > }
> >
> >
> > Thx a lot
> >
> > Timo Schnölzer
> >
> >
>
>
>
> ____________
> Virus checked by G DATA AntiVirusKit
> Version: AVK 16.8873 from 02.08.2006
> Virus news: www.antiviruslab.com
>

Mime
View raw message