do-commands is intended for DDL. All of these API methods are intended 
to be used inside (with-connection ...) which is how they know which 
DB connection to use. 
Again: 
Perhaps you can explain a bit more about what you're trying to do. 
Have you looked at this page: 
http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/UsingSQL.html 


I will read over that page. I have no experience with Java, which would 
probably help as there seem to be an abundance of Java examples on related 
topics. 

Right now I'm trying to run this query against a MySql database:

select u.first_name, u.last_name, sum(p.amount) as amountTotal from 
sf_guard_user_profile as u, payment_outgoing_for_answers as p where 
u.user_id=p.user_id group by p.user_id order by amountTotal ;

I can not figure out what command to use. The examples all look like this:

sql/with-connection db


but I am assuming I would get terrible performance if I use with-connection, 
since I need to make several queries.  





On Friday, November 9, 2012 1:48:25 PM UTC-5, Sean Corfield wrote:
>
> On Fri, Nov 9, 2012 at 10:19 AM, larry google groups 
> <lawrenc...@gmail.com <javascript:>> wrote: 
> > Usage: (do-commands & commands) 
> > 
> > This seems flexible, but how does it know what the open database 
> connection 
> > is? I have to switch between 2 databases. 
>
> do-commands is intended for DDL. All of these API methods are intended 
> to be used inside (with-connection ...) which is how they know which 
> DB connection to use. 
>
> Again: 
>
> Perhaps you can explain a bit more about what you're trying to do. 
>
> Have you looked at this page: 
> http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/UsingSQL.html 
>
> I think you're over-thinking / over-complicating what you need... 
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.com/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>

-- 
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