Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Enconding - decoding ISU-8859-8 Hebrew charset from servlet to DB

418054Mar 30 2004 — edited Mar 31 2004
Hi ,
I have a problem with encoding and decoding, from a servlet , running on Tomcat , to Oracle DB.
I hope it is the right forum for that , and i appologize if ti is not ..

The problem:
I am using Oracle 8.1.7 DB , in a Charest ISU 8859-9-8 ( Hebrew ), I use a thin client as the JDBC driver .
I have a servlet that all it does is getting and updating one of the table

The character set in the servlet is too , ISO 8859-8 . This is done this way:

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

request.setCharacterEncoding("ISO-8859-8");
response.setContentType("Text/html; ISO-8859-8");
.....
}

I use the doGet method of a servlet to get parameters to retrieve from Oracle. this is done through the URL, for example :
I send the parameters like this : http://localhost:8080/myapp/myapp?name=yair&family=fine
for name= yair, family = fine

There is no problem in getting and inserting English characters.
There is a problem when i try to get or to insert Hebrew characters.
i get ???? in DB , for both if i write yair in the url in Hebrew , or i write yair in %E9%E9%E9%F8 which is the decimal representation

For example , if i insert a string in Hebrew , it looks like this "?????" ( in SQL +)


this is how i get the requests from the url
Enumeration paramEnum = request.getParameterNames(); // get request parameters from the url , in param/value pairs
String myParam = (String) paramEnum.nextElement(); //get parameter
String myValue = request.getParameter(myParam); //get value

String myStatment = "insert into mytable values('19', '"+myValue+"')" insert to table 19 , myvalue
ResultSet rs = stmt.executeQuery(myStatment);

does any one have a solution for that ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 28 2004
Added on Mar 30 2004
1 comment
663 views