Using a database variable to tell the site what template to use will not be quite doable, but there are a couple of other options.
1) Using Framwework builder, you could convert the templates to Themes. Then apply the Dynamic theme to your pages based on a session variable or a url variable.
2) you could create a separate database for each languages content, then use subdoamins and Dynamic Connections to connect to the correct database for that language. for example, the subdomains could be:
then set up dynamic connections to point spanish.mydomain.com to the spanish version of the database, and english.mydomain.com to the english version of the database.