inserting Ã± in mysq using java

Im having problem inserting ñ and Ñ in mysql using java. I did try to insert in mysql using CLI and it works ok but when I used it in my java it was replaced by other characters. does anyone have the same problem and have solved them? please help.