handling database connection

toggle button or... how to handle connecting/dc from db