update sql code and put the sharing field to java coding style