Dynamic Database Connections It is sometimes desirable to generate your database connection informa- tion dynamically, for example, to allow multiple databases with the same schema to not have to duplicate an entire class hierarchy. The preferred method for doing this is to supply your own db_Main() method rather than calling set_db(). This method should return a valid database handle. Note however that this is class data, and that changing it may have unexpected behaviour for instances of the class already in existence.