T Sql While Statement Java