Why are you using tokenizer at all; it is legacy code? You need to look in its API documentation to see what you ought to use instead.
There is lots about database connections in the Java™ Tutorials.
there is no problem with the connectivity with the data base,what the problem is i successfully retrieve the string from the text box "str1",the next thing is to parse the string by "," and insert it into the database javascript:emoticon('');