Java Find Last Index Of Character In String Sql