although some japanese characters still don't show up after storing in mySQL. Is that to say that many/most Japanese characters do show up correctly? Are you sure they're the right characters? Have you showed the result to someone who understand Japanese (assuming you don't)?
Your code looks rather strange to me, so I'm initially rather skeptical.
1) Set content-type in JSP to desired charset (UTF-8, ISO-8859-1, etc...) Sounds good.
2) Before stuffing a value into database i convert it into ISO:
String value = new String(submitted.getBytes("ISO-8859-1)); That sounds, at best, unnecessary, and more likely, seriously wrong. Well, at best it might be a necessary hack to compensate for something seriously wrong elsewhere, but I would really hope that it would be possible to fix the problem elsewhere, not here.
Java Strings are sequences of Unicode characters, period. You can't change the encoding of a String. You can change the encoding used when you read the String from some binary source, or when you write it somewhere else. If you find it necessary to use getBytes() and create a new String using a different encoding, that's a strong indication the original Sting was not read correctly in the first place. I'd say for simplicity
you should configure the JSP to UTF-8, period. ISO-8859-1 can not, will not transfer Japanese characters correctly.
I suspect that the real problem is with the database though. MySQL uses ISO-8859-1 by default - which again, is
not what you want if you wish to store Japanese characters. (Unless you're putting them in BLOBS or something, then you can do whatever you want, but lose the ability to do things like search for text.)
You should be able to tell MySQL to use a different encoding. If the DB is set up correctly, and if your data was read from the JSP correctly, then you shouldn't need to think about the DB's character encoding at all in your Java code. The driver and DB will handle that for you. You just use PreparedStatement's setString() method to load the data into your insert or update statement, and execute it. The driver and DB will translate that Unicode String into whatever encoding the DB is configured to use.
One other thing - in the unlikely event that you really do need the
you should probably look into explicitly specifying the character set to be used by the String constructor. Right now you're relying on the platform default encoding, which means if you move to a different machine you might get a very different result.
3) Store...
4) Retreave and convert back into desigred charset:
String value = new String(rs.getString("value").getBytes("ISO-8859-1"), charset); Same objections as before. If the DB is configured correctly, and the data was inserted correctly, then String value = rs.getString("value") is all you should need here.
5) display in JSP Which should work fine if the JSP is still using an encoding that cna handle Japanese.