Can't insert arabic characters into oracle database

前端 未结 2 1992
旧巷少年郎
旧巷少年郎 2021-01-23 23:13

I got problems while reading arabic characters from oracle in java using JDBC driver, the main problem was i couldn\'t find the proper character encoding to get the correct data

相关标签:
2条回答
  • 2021-01-23 23:47

    First you may check the NLS_CHARACTERSET parameter of your database using the SQL*PLUS command :-

    select * from v$nls_parameters where parameter = 'NLS_CHARACTERSET';

    the result should be

    PARAMETER

    VALUE

    NLS_CHARACTERSET

    AR8MSWIN1256

    if it's not, you have to change the value of this parameter using :-

    • hit WINDOWS KEY + r on your keyboard

    • write :- SQLPLUS sys as sysdba

    • press Enter then enter the password or just hit another Enter

    • issue the following commands :

    • SHUTDOWN IMMEDIATE

    • STARTUP RESTRICT

    • ALTER DATABASE CHARACTER SET INTERNAL_USE AR8MSWIN1256;

    • ALTER DATABASE CHARACTER SET AR8MSWIN1256;

    • SHUTDOWN IMMEDIATE

    • STARTUP

    • change the value of the NLS_LANG registry string into AMERICAN_AMERICA.AR8MSWIN1256

      if your operating system is a flavor of UNIX use

    AR8ISO8859P6 instead of AR8MSWIN1256 as the value of NLS_CHARACTERSET

    • DON'T use National datatypes (i.e NVARCHAR, NTEXT, or NCLOB ) in your database unless you are going to use other languages than (Arabic and English) inside your database

    • AR8MSWIN1256 character set is sufficient for mixing arabic and english inside the same field (as far as I know).

    TAKEN FROM

    • https://www.youtube.com/watch?v=zMphHE78imM

    • https://ksadba.wordpress.com/2008/06/10/how-to-show-arabic-characters-in-your-client-app/

    0 讨论(0)
  • 2021-01-24 00:00

    Check your oracle version. if it old it can't support UTF16.

    here is an article -- hope it will be useful.

    http://docs.oracle.com/cd/B19306_01/server.102/b14225/ch6unicode.htm

    0 讨论(0)
提交回复
热议问题