I'm trying to create a Database object for myself in .net. The constructor takes a connection string and opens a connection to the MySQL db using the MySQL Connector. It has functions like:
function executeNonQuery(cmd as String) as Boolean
function getOneResultQuery(query as String) as String
function getDataReader(query as String) as MySQLDataReader
When a task needs the db, it instantiates the database object and calls its necessary commands. When it is done with the database, it calls the disconnect() function.
Does this take advantage of MySQL Connection Pooling? As each tasks connects and disconnects from the DB (sometimes more than one connection open at a time, sometimes one connection open, sometimes no connections open) do the connections get stored in a pool? Do I have to leave one connection permanently open for connection pooling to be enabled?
Is this database object a decent practice or am I overdoing this?