It can be converted directly database functions, eliminating the trouble code conversion java
SELECT TIMESTAMPDIFF(YEAR, '1988/01/10', CURDATE())
And a fault tolerant function well, even null, '', is not being given, such as SELECT TIMESTAMPDIFF (YEAR, null, CURDATE ())