Just make sure that whatever DBMS you use, you use an abstract interface to hide the implementation. That way, if MySQL stops meeting your needs, you can easily replace it (with Oracle for example). Here''s a really rough example:
class IDatabase
{
virtual ~IDatabase ( void ) {}
virtual void SetConnectionInfo ( char * db, char * user, char * pw ) = 0;
virtual int Query ( char * sql ) = 0;
..
}
Then each database implementation would extend this interface and new implementations could be created with a DBMS factory class like so:
DBMSFactory dbmsFactory;
DBMS *dbms = dbmsFactory.Create ( "mysql" );
char* sql[] = "DELETE FROM accounts WHERE ID=1";
dbms->SetConnectionInfo ( "mmorpg", "root", "" );
dbms->Query ( sql );
dbmsFactory.Destroy ( dbms );
Another cool idea would be to make your factory a singleton so that you could call it from anywhere to get an instance of your dbms. The book C++ Programming for Game Developers has a really good chapter on abstraction which explains this in more detail.
bpopp (
bpopp.net)