You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Caio Zanchetti <ca...@gmail.com> on 2007/06/11 22:22:26 UTC
Sql statement and Meta-Data
Hi!
Now I have another problem! (I'm sorry if my questions are so simple!)
I would need to execute an sql statement created by the user. I will not
have this statement mapped in my xml file. How can I do that?
I would like to know to, how can I get the meta-data of a result (like the
getMetadata() in resultset object (JDBC))?
Thank's
Caio.
--
Claudiomir G. Zanchetti (Caio)
Sun Certified Programmer for the Java 2 Plataform, Standard Edition 5.0
"Use com sabedoria a mente e energia para beneficiar ambos, vocĂȘ mesmo e os
outros." -Dr. Jigoro Kano
Re: Sql statement and Meta-Data
Posted by Jeff Butler <je...@gmail.com>.
This is not a great solution, but the best you could do in iBATIS is this:
<select id="customSelect" resultClass="java.util.HashMap"
remapResults="true">
$value$
</select>
This is wide open to SQL injection, but I assume you are handling this other
ways.
iBATIS does not use ResultSetMetadata. If you need access to such, then you
should probably drop to plain JDBC.
Jeff Butler
On 6/11/07, Caio Zanchetti <ca...@gmail.com> wrote:
>
> Hi!
> Now I have another problem! (I'm sorry if my questions are so simple!)
>
> I would need to execute an sql statement created by the user. I will not
> have this statement mapped in my xml file. How can I do that?
>
> I would like to know to, how can I get the meta-data of a result (like the
> getMetadata() in resultset object (JDBC))?
>
>
> Thank's
> Caio.
>
>
> --
> Claudiomir G. Zanchetti (Caio)
> Sun Certified Programmer for the Java 2 Plataform, Standard Edition 5.0
> "Use com sabedoria a mente e energia para beneficiar ambos, vocĂȘ mesmo e
> os outros." -Dr. Jigoro Kano