Example usage can be found here

Use the DatabaseManager class for managing tables, and TableInfo for grabbing the data. RowData class contains a list of ColumnData which contains the data. My FernCommands plugin can also be used as an example of MySQL.