Dear Friends,
I a working on a project where i have to let the user to type in other languages(hindi,tamil,kannada etc..) and i have to store into the database and retrive it back and show it to the client in the same language he has entered..I am using postgres 8.0 for storing the data. When i tried to store the data's its storing in database as "ल�ि�प�िप�" and displaying it in the same manner...Can any one help me how to fix this..Thanks in advance
i use the following code to store
english.jsp
<input type="button" name="but1" value="<%=session.getValue("main.Bok")%>" onClick="callSearch()">
function callSearch()
{
var f = document.forms[0];//("myform");
var semiCol = ":";
var Name = document.myForm.Name.value;
var Company = document.myForm.Company.value;
var DOB = document.myForm.DOB.value;
var Age = document.myForm.Age.value;
// parent.document.getElementById("Local").src="jdbcConnection.jsp?Name="+Name+"&Company="+Company+"&DOB="+DOB+"&Age="+Age;
alert("Name = "+Name);
window.location.href="./jdbcConnection.jsp?Name="+Name+"&Company="+Company+"&DOB="+DOB+"&Age="+Age;
}
jdbcConnection.jsp
<%
request.setCharacterEncoding("UTF-8");
String szName=request.getParameter("Name");
System.out.println("Name = "+szName);
String szCompany=request.getParameter("Company");
System.out.println("Company = "+szCompany);
String szDOB=request.getParameter("DOB");
System.out.println("DOB = "+szDOB);
String szAge=request.getParameter("Age");
System.out.println("Age = "+szAge);
try{
Connection conn;
String szUrl;
Class.forName("org.postgresql.Driver");
szUrl="jdbc:postgresql://localhost/jaiprakash";
System.out.println("Driver created");
conn = DriverManager.getConnection(szUrl,"postgres","password");
System.out.println("Connection created");
Statement sqlString1=conn.createStatement();
sqlString1.executeUpdate("INSERT INTO public.user values('"+szName+"','"+szCompany+"','"+szDOB+"','"+szAge+"')");
//sqlString1.executeUpdate("INSERT INTO public.user values('gfgfdg','gffdggf','gdfgdfg','gdfgdfg')");
System.out.println("Query executed....");
conn.close();
}catch(Exception e){
e.printStackTrace();
}
%>
Regards,
Jayaprakash