Thanks Charles and Vikas. This certainly put me on the right track. I ended up using https://github.com/cwensel/cascading.jdbc which uses Hadoop classes DBInputFormat/DBOutput
to make it easy to set up Cascading jobs that read and write to db.
To write I just changed the output flow of my tap to:
String url = "jdbc:mysql://localhost:3306/mydb?user=myusername&password=mypassword";
String driver = "com.mysql.jdbc.Driver";
String tableName = "mytable";
String[] columnNames = {'col1', 'col2', 'col3'}; //Columns I want to write to
TableDesc tableDesc = new TableDesc( tableName );
JDBCScheme dbScheme = new JDBCScheme( columnNames );
Tap dbOutputTap = new JDBCTap( url, driver, tableDesc, dbScheme );
And to read from the db I just made a tap that looked like this:
String url = "jdbc:mysql://localhost:3306/mydb?user=myusername&password=mypassword";
String driver = "com.mysql.jdbc.Driver";
String tableName = "mytable";
String[] columnNames = {'col1', 'col2', 'col3'}; //Columns I want to read from
TableDesc tableDesc = new TableDesc( tableName );
JDBCScheme dbScheme = new JDBCScheme( columnNames, "col1<40" );
Tap dbInputTap = new JDBCTap( url, driver, tableDesc, dbScheme );
I came across Cascading-DBMigrate as well but it seems this is only for reading from db's and not writing to them.