The rule of thumb for database access is to open the connection as late as possible and close it as soon as possible. The slowness may simply be caused by the connection to your database, say if it is located on another server. If the data is static, i.e. doesn't change often, then caching it may be an option, depending on the amount of data. There are an enormous amount of examples of constructing data access layers, I would suggest you try searching for one as an example.
only two letters away from being an asset