jdbc/with-connection takes the commands you want to run in that connection as arguments, after the spec. You are running no commands in the context with-connection creates, and running everything outside it, where the db connection is not bound.