Can you show us the respective code? Especially the part where you create the connection and where you pass it to the other part of the application.