In multi-connection mode, any template that uses DB queries, uses the main connection. However, it may be useful to use the actual connection of the SQL/program/whichever window the template is being used in.
This may be optional as per a new item in pldev preferences.