Java Count Occurrences Of Substring In Postgresql