And you have to name your connection explicitly with
exec sql bind connection myconnection to :myconnection end-exec
so that you can release it with :
exec sql unbind connection myconnection end-exec
Otherwise you will receive :
-0000019701 SQLERRMC : Connection ? not found