A simple way to open a database connection, query the database, and close the connection.