I'm missing something with database connections

Hey all!

I’m no pro, I’ve been coding for half my life as a hobby and come from a mainly LAMP background. The one issue I seem to be completely missing/overlooking/not-grasping is where/how to store the default database connection.

I’m now using PostgreSQL, and have no issues with it so far, its quite nice. I have established a connection and queried data and everything is working great. The issue I seem to be having is where or how do i define the global credentials and connection to the database. In php you create a config.inc file, have all the information in there, and just reference that file for any new connection. I’ve watched and read quite a few tutorials on this subject, however, most span many years and many versions of Xojo and they all seem to take quite different approaches. So I guess my actual question would be, what is the best/most secure/easiest way to currently do this?

On web app using Session
On Desktop i use the module

i have no problems (i use PostgresSQL)

Sorry I did not clarify that this will be a webapp.

So your answer leads me to another question, I see, I can insert a “database” into my app, but I cant figure out how to reference it. So using a session and adding all the connection data there is the appropriate way to handle this over the built in insert database feature?

yes Session is the way

This is working great, thank you!