Skip navigation links

Oracle® Database Globalization Development Kit Java API Reference
11g Release 2 (11.2)

E10730-01


oracle.i18n.util
Class OraSQLUtil

java.lang.Object
  extended by oracle.i18n.util.OraSQLUtil


public class OraSQLUtil
extends Object

The OraSQLUtil class is an Oracle SQL utility class.

The following functionality is available in this class:

Since:
10.1.0.2

Method Summary
static String escapeUNISTR(String str, String dbCharset)
          Escapes the string into UNISTR form if the character is not supported by the database character set.
static boolean isValidIdentifier(String srcstr, String dbCharset)
          Checks if the string is valid in the database character set.
static boolean synchronizeLocale(Locale locale, Connection con)
          Synchronizes the session NLS parameters with the locale.
static boolean synchronizeLocale(String oralanguage, String oraterritory, Connection con)
          Synchronizes the database session NLS parameters with the Oracle language and territory names.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

isValidIdentifier

public static boolean isValidIdentifier(String srcstr,
                                        String dbCharset)
                                 throws UnsupportedEncodingException
Checks if the string is valid in the database character set.
Parameters:
srcstr - a string to be examined
dbCharset - Oracle database character set name
Returns:
true if the data is valid in the database character set, otherwise false
Throws:
UnsupportedEncodingException - if the dbCharset parameter is invalid

escapeUNISTR

public static String escapeUNISTR(String str,
                                  String dbCharset)
                           throws UnsupportedEncodingException
Escapes the string into UNISTR form if the character is not supported by the database character set.
Parameters:
str - a string to be examined
dbCharset - Oracle database character set name
Returns:
a UNISTR string containing Unicode escaped form if the character is not supported by the character set
Throws:
UnsupportedEncodingException - if the dbCharset parameter is invalid

synchronizeLocale

public static boolean synchronizeLocale(Locale locale,
                                        Connection con)
                                 throws SQLException
Synchronizes the session NLS parameters with the locale.

This executes ALTER SESSION SQL commands to set NLS session parameters to synchronize the locale and attributes in this object. The following session parameters are updated:

Parameters:
locale - Java locale object
con - database connection
Returns:
true if successful, otherwise false
Throws:
SQLException - if a SQL exception occurs

synchronizeLocale

public static boolean synchronizeLocale(String oralanguage,
                                        String oraterritory,
                                        Connection con)
                                 throws SQLException
Synchronizes the database session NLS parameters with the Oracle language and territory names.

This executes ALTER SESSION SQL commands to set NLS session parameters to synchronize the locale and attributes in this object. The following session parameters are updated:

Parameters:
oralanguage - Oracle language name
oraterritory - Oracle territory name
con - database connection
Returns:
true if successful, otherwise false
Throws:
SQLException - if a SQL exception occurs

Skip navigation links

Oracle® Database Globalization Development Kit Java API Reference
11g Release 2 (11.2)

E10730-01


Copyright © 2003, 2009, Oracle. All rights reserved.