Compare Mysql Date time with string date time

Dear All,
I have read dateTime field into a string from mysql database and in my java I have another dateTime in string format and in same format as the mysql date time and would like to compare both to see which one is before?

Use DateFormat.parse() to return the Strings to Date objects, then use Date.before() to determine which is earliest.

Dear Rushiku,
Thank you will try the method out.