Best way to connect to mySQL
Hello.
I have an application which connect to mySQL server. I would like to Know which is the best way to do it.
1. Connect one time at the beggining (what I do)
or
2. Every time I need to make a query connect against to the server.
In the first step the problem will be how to store the dbUrl, user, password throughout the application.
In the second case how I ask the dbUrl, user, password every time I need.
I would like to know a strategy to do this kind of step.
Thanks.
|