Your code calls an existing stored procedure on the database.  I'm
wondering about *creating* a native Java stored procedure *inside* the
database.  Oracle supports Java 1.5 inside the DB, might as well use
clojure.

On Nov 19, 3:34 pm, willyh <wheine...@gmail.com> wrote:
> Here's how I do it with clojure.java.jdbc:
>
> (defn do-stored
>   "Executes an (optionally parameterized) SQL callable statement on
>   the open database connection. Each param-group is a seq of values
>   for all of the parameters."
>   [sql & param-groups]
>   (with-open [stmt (.prepareCall (sql/connection) sql)]
>     (doseq [param-group param-groups]
>       (doseq [[index value] (map vector (iterate inc 1) param-group)]
>         (.setObject stmt index value))
>       (.addBatch stmt))
>     (sql/transaction
>      (seq (.executeBatch stmt)))))
>
> (defn insert-sample-log
>   [process-code
>    csid
>    sample-id
>    container-id
>    container-well
>    tube-barcode
>    username
>    comment]
>   (do-stored "{call
> bsms_owner.Add_Sample_Log(?, ?, ?, ?, ?, ?, ?, ?)}"
>              [process-code
>               csid
>               sample-id
>               container-id
>               container-well
>               tube-barcode
>               username
>               comment]))
>
> Hope that helps.
>
> Cheers,
>
> Willy
>
> On Nov 19, 3:14 pm, Ghadi Shayban <gshay...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I'm trying to load and execute an Oracle Java Stored Procedure...
> > written in Clojure.
>
> > Has anyone successfully managed to do this?  Are you done throwing
> > up?  I would appreciate any direction
>
> > I have a little clj that is AOT compiled, and I load the whole jar
> > into the DB successfully.
>
> > What I'm running into is half of the classfiles inside clojure.jar
> > including RT get marked as invalid by the database class "resolver".
> > They have a 30-char max on pkg/class names, and anything longer gets
> > entered into a lookup table.
>
> > This seems to be a good 
> > referencehttp://download.oracle.com/docs/cd/E11882_01/java.112/e10588/chtwo.ht...
>
> > I'm not too familiar with custom class loaders, and I'm not sure
> > that's what I'd need.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to