If it helps, I use these two methods with JPA to call Stored Procedures / Functions: <div><br></div><div><div>    protected Object executeFunction(EntityManager entityManager, String functionName, Object... params) {</div>

<div>        StringBuilder functionStr = new StringBuilder(functionName);</div><div>        functionStr.append(&quot;(&quot;);</div><div>        for (int i = 1; i &lt;= params.length; i++) {</div><div>            functionStr.append(&quot;?&quot;).append(i);</div>

<div>            functionStr.append(&quot;,&quot;);</div><div>        }</div><div>        functionStr.deleteCharAt(functionStr.length() - 1);</div><div>        functionStr.append(&quot;)&quot;);</div><div>        Query nativeQuery = entityManager.createNativeQuery(&quot;SELECT &quot; + functionStr.toString() + &quot; FROM DUAL&quot;);</div>

<div>        for (int i = 1; i &lt;= params.length; i++) {</div><div>            nativeQuery.setParameter(i, params[i - 1]);</div><div>        }</div><div>        return nativeQuery.getSingleResult();</div><div>    }</div>

<div><br></div><div>    protected Object executeFunctionUpdate(DataSource dataSource, String functionName, Object... params) {</div><div>        StringBuilder functionStr = new StringBuilder(functionName);</div><div>        functionStr.append(&quot;(&quot;);</div>

<div>        for (int i = 1; i &lt;= params.length; i++) {</div><div>            functionStr.append(&quot;?,&quot;);</div><div>        }</div><div>        functionStr.deleteCharAt(functionStr.length() - 1);</div><div>        functionStr.append(&quot;)&quot;);</div>

<div>        String sqlString = &quot;{? = call &quot; + functionStr.toString() + &quot;}&quot;;</div><div>        Connection con = null;</div><div>        CallableStatement call = null;</div><div>        try {</div><div>

            con = dataSource.getConnection();</div><div>            call = con.prepareCall(sqlString);</div><div>            call.registerOutParameter(1, java.sql.Types.NUMERIC);</div><div>            for (int i = 1; i &lt;= params.length; i++) {</div>

<div>                call.setObject(i + 1, params[i - 1]);</div><div>            }</div><div>            call.execute();</div><div>            return call.getObject(1);</div><div>        } catch (SQLException se) {</div>
<div>
            throw new GvtIntegraException(se);</div><div>        } finally {</div><div>            DBUtil.closeQuietly(con, call, null);</div><div>        }</div><div>    }</div><div><br></div><br><div class="gmail_quote">

2011/11/26 <a href="mailto:michal.kaplon@poczta.fm">michal.kaplon@poczta.fm</a> <span dir="ltr">&lt;<a href="mailto:michal.kaplon@poczta.fm">michal.kaplon@poczta.fm</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi,<br>
<br>
It smells like a challenge for cdi-query extension guys ;)<br>
<br>
--<br>
BR,<br>
Michal<br>
<div class="im"><br>
On 25.11.2011 21:32, John D. Ament wrote:<br>
&gt; Here here.<br>
&gt;<br>
&gt; I know the biggest issue I always run into is stored procedure<br>
&gt; invocation.  Something really easy to implement would be binding stored<br>
&gt; procedures (not ones that return results, just do work) to interface methods<br>
&gt;<br>
&gt; public interface SomePackageNameOrDboOrSchemaName{<br>
&gt;<br>
&gt; @StoredProcedure(&quot;someProcedureName(?,?,?)&quot;)<br>
&gt; public void someProcedureName(String s, int i, Long l);<br>
&gt; }<br>
&gt;<br>
&gt; And do automatic binding of the method args to the procedure invocation.<br>
&gt;<br>
&gt; For result sets, I always find it easier to just bind it as a JPA query.<br>
&gt;<br>
&gt; On Fri, Nov 25, 2011 at 3:07 PM, José Rodolfo Freitas<br>
</div>&gt; &lt;<a href="mailto:joserodolfo.freitas@gmail.com">joserodolfo.freitas@gmail.com</a> &lt;mailto:<a href="mailto:joserodolfo.freitas@gmail.com">joserodolfo.freitas@gmail.com</a>&gt;&gt;<br>
<div class="im">&gt; wrote:<br>
&gt;<br>
&gt;     Yeah, a JBDC module would be very useful. Eventually I cross with<br>
&gt;     requirements that asks for JDBC connections. Essentially for<br>
&gt;     perfomance with gigantic queries and reports.<br>
&gt;<br>
&gt;<br>
&gt;     On Fri, Nov 25, 2011 at 3:39 PM, John D. Ament<br>
</div><div class="im">&gt;     &lt;<a href="mailto:john.d.ament@gmail.com">john.d.ament@gmail.com</a> &lt;mailto:<a href="mailto:john.d.ament@gmail.com">john.d.ament@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;         Maybe we need a Seam JDBC module.<br>
&gt;<br>
&gt;<br>
&gt;         On Fri, Nov 25, 2011 at 12:32 PM, Jason Porter<br>
</div><div class="im">&gt;         &lt;<a href="mailto:lightguard.jp@gmail.com">lightguard.jp@gmail.com</a> &lt;mailto:<a href="mailto:lightguard.jp@gmail.com">lightguard.jp@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;             No it does not, JPA only.<br>
&gt;<br>
&gt;             Sent from my iPhone<br>
&gt;<br>
&gt;             On Nov 25, 2011, at 8:21, José Rodolfo Freitas<br>
&gt;             &lt;<a href="mailto:joserodolfo.freitas@gmail.com">joserodolfo.freitas@gmail.com</a><br>
</div><div class="im">&gt;             &lt;mailto:<a href="mailto:joserodolfo.freitas@gmail.com">joserodolfo.freitas@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;&gt;             afaik, it doesn&#39;t, but maybe a feature or two escaped from<br>
&gt;&gt;             my eyes.<br>
&gt;&gt;<br>
&gt;&gt;             On Fri, Nov 25, 2011 at 1:20 PM, José Rodolfo Freitas<br>
&gt;&gt;             &lt;<a href="mailto:joserodolfo.freitas@gmail.com">joserodolfo.freitas@gmail.com</a><br>
</div><div class="im">&gt;&gt;             &lt;mailto:<a href="mailto:joserodolfo.freitas@gmail.com">joserodolfo.freitas@gmail.com</a>&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;                 Hey guys, quick question:<br>
&gt;&gt;                 Does seam-persistence provide any mechanism that<br>
&gt;&gt;                 handles jdbc connections and sql native queries?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;             _______________________________________________<br>
&gt;&gt;             seam-dev mailing list<br>
</div>&gt;&gt;             <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a>&gt;<br>
<div class="im">&gt;&gt;             <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
&gt;<br>
&gt;             _______________________________________________<br>
&gt;             seam-dev mailing list<br>
</div>&gt;             <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a>&gt;<br>
<div><div></div><div class="h5">&gt;             <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; seam-dev mailing list<br>
&gt; <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
<br>
_______________________________________________<br>
seam-dev mailing list<br>
<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
</div></div></blockquote></div><br></div>