hey jatish..iam facing the same problem..were u able to tackle it ..??
step 1 : read Unicode character(or string any language ) from Excel and writer to Ms access using JSP, But in Ms access it shows " परितà¥?यà "
@ time of reading Unicode character from excel one decoding is required
i will explain that decoding first
first reading string from excel sheet
String UNI_Code=(cell.getStringCellValue() ) // read the Unicode character excel sheet
after that
String SringFinal=DECODEING(UNICode); // call decoding function
/// function for decoding string
public static String DECODEING(String STR) throws UnsupportedEncodingException { try { **byte[] utf8 = STR.getBytes("UTF-8"); STR = (new String(utf8, "UTF-8").trim()).toString();** } catch (UnsupportedEncodingException e) {} return STR; }
after that use this "String_final" in Sql query
Ex: String Sqlquery ="insert into Tablename ("Unicode Column name") values("+Sql_query+")";
Step 2 : Display (get Unicode from Ms access ) its normal way only String SQL="select Unicode Column name,....,... from Table_Name"; Statement st =conn.createStatement(); ResultSet rs= st.executeQuery(SQL); while (rs.next()) { String St_1=rs.getString(1).trim(); /// treat as a normal string ....................... ....................... ....................... }
step 1 : read Unicode character(or string any language ) from Excel and writer to Ms access using JSP, But in Ms access it shows " परितà¥?यà "
@ time of reading Unicode character from excel one decoding is required
i will explain that decoding first
first reading string from excel sheet
String UNI_Code=(cell.getStringCellValue() ) // read the Unicode character excel sheet
after that
String SringFinal=DECODEING(UNICode); // call decoding function
/// function for decoding string
public static String DECODEING(String STR) throws UnsupportedEncodingException { try { **byte[] utf8 = STR.getBytes("UTF-8"); STR = (new String(utf8, "UTF-8").trim()).toString();** } catch (UnsupportedEncodingException e) {} return STR; }
after that use this "String_final" in Sql query
Ex: String Sqlquery ="insert into Tablename ("Unicode Column name") values("+Sql_query+")";
Step 2 : Display (get Unicode from Ms access ) its normal way only String SQL="select Unicode Column name,....,... from Table_Name"; Statement st =conn.createStatement(); ResultSet rs= st.executeQuery(SQL); while (rs.next()) { String St_1=rs.getString(1).trim(); /// treat as a normal string ....................... ....................... ....................... }
Ads