Oracle® Globalization Development Kit Java API Reference
10g Release 1(10.1)

B10971-01

oracle.i18n.util
Class OraSQLUtil

java.lang.Object
  |
  +--oracle.i18n.util.OraSQLUtil

public class OraSQLUtil
extends Object

OraSQLUtil is a 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 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 dbCharset 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 dbCharset is invalid

synchronizeLocale

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

This executes ALTER SESSIONSQL commands to set NLS session parameters to synchronize the locale and attributes in this object. The following session parameters will be updated:



Parameters:
locale - Java locale object
con - Database connection
Returns:
true if successfull, otherwise false.
Throws:
SQLException - if SQL exception occurs

synchronizeLocale

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

This executes ALTER SESSIONSQL commands to set NLS session parameters to synchronize the locale and attributes in this object. The following session parameters will be updated:



Parameters:
oralanguage - Oracle language name
oraterritory - Oracle territory name
con - Database connection
Returns:
true if successfull, otherwise false.
Throws:
SQLException - if SQL exception occurs

Oracle® Globalization Development Kit Java API Reference
10g Release 1(10.1)

B10971-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.