Incorporating data from an external database into Craft pages
That solution makes sense! I have used a similar strategy. You should absolutely cache around the template hook, or cache the database calls in the plugin itself. 

Take a look at the Yii Query Builder to see how Yii/Craft handles MySQL queries. You can also look at examples Craft source code.