You can get most of those messages, but unfortunately not all. See my question on Stackoverflow regarding that.
In general those messages (e.g. messages from a
PRINT statement) are returned as warnings on the Statement object by the JDBC driver. To retrieve them use Statement.getWarnings() in a loop:
Statement stmt = ...;
SQLWarning warning = stmt.getWarnings();
while (warn != null)
warning = warning.getNextWarning();
I have seen some messages also being returned on the Connection instance rather than the Statement. If you don't see anything, try the above code with your Connection instance.