Hi Jesus,
      The  Oracle 9i database was created fresh with default encoding set
to UTF-8. And I am using Oracle JDBC - OCI driver. The Java class is
invoked from a Korn shell script and the NLS lang param is set to
AMERICAN_AMERICA.UTF8 in the script. I get the following error:

java.sql.SQLException: Io exception: Char array not long enough:
javaCharsToUtf8Bytes
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
        at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2061)
        at
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
        at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
        at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)


Any idea what could be the reason and how to fix it ?

Appreciate all your help !!

Thanks,

Ravi Varanasi
408 517 7675


|---------+---------------------------->
|         |           "Jesus M. Salvo  |
|         |           Jr."             |
|         |           <[EMAIL PROTECTED]|
|         |           sia.com>         |
|         |                            |
|         |           09/04/2003 04:49 |
|         |           PM               |
|         |           Please respond to|
|         |           xerces-j-user    |
|         |                            |
|---------+---------------------------->
  
>---------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                                |
  |       To:       [EMAIL PROTECTED]                                           
                                                     |
  |       cc:                                                                   
                                                                |
  |       Subject:  Re: UTF-8 problem with Xerces-J2                            
                                                                |
  
>---------------------------------------------------------------------------------------------------------------------------------------------|




Holliday, Donald B. (LNG-CSP) wrote:

>Actually, Oracle doesn't "totally supports UTF-8" unless you specifically
>alter the database to do that.  By default, Oracle installs as USASCII7.
>Even installed as USASCII7 (x00 - x7f), Oracle will correctly store and
>deliver 8859-1 (Western European 8) (x00 - xff) because Oracle stores
bytes
>as 8 bit bytes rather than 7 bit bytes.  In UTF-8, any character value
>greater then x7f is represented by two or more bytes.
>
>This is true for Oracle 8x in the United States.  I assume it is also true
>for Oracle 9x.
>
>I'd check with the DBA and verify that the Oracle instance has been
altered
>to accept UTF-8.
>
>Thanks,
>
>Donald Holliday
>

1) The default charset of the Oracle database must be changed to UTF-8.

2) Any existing data in the database prior to changing the charset are
not "converted" to UTF-8. Thus, you will still get "junk" if you try to
read CHARs / VARCHARs from Oracle that were inserted prior to changing
the default charset to UTF-8.

3) Even if the Oracle database was installed with a default charset of
USASCII7, when using JDBC, somehow, the database ( or the JDBC driver )
still allows characters beyond the ASCII range.

4) The Oracle JDBC thin driver automatically converts Strings to and
from Oracle's default charset

5) The Oracle JDBC-OCI driver does not. You have to specify the default
charset of the database by an environment variable ( NLS_LANG ).





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to