Second pass at db connection