A variant of the Oracle specific representation of characters.
It is identical to the CHAR representation, except that the mode
of usage are NCHAR character values.
This class is currently only supported in SQLJ.
JDBC must employ the mode-of-use API to set the usage on parameters
and result set columns.
Constructor for NCHAR - a variant of CHAR with the mode of use NCHAR.
This constructor uses an existing CHAR object.
NCHAR
public NCHAR(java.lang.String str,
oracle.sql.CharacterSet charSet)
throws java.sql.SQLException
Constructor for NCHAR - a variant of CHAR with the mode of use NCHAR.
The String is first converted to the indicated character set.
No provision is made for loss if the CharacterSet cannot represent
all Unicode characters.
Although perhaps some time in the future it may throw an exception in
that case.
Parameters:
str - the sequence of characters (represented in Unicode).
charSet - the CharacterSet to which the string should be converted.
Throws:
java.sql.SQLException - if the attempt to convert str to charSet throws
an exception. To avoid this, the program can first use
CharacterSet.convertWithReplacement to get an array of bytes and then
use the byte constructor.
NCHAR
public NCHAR(java.lang.Object obj,
oracle.sql.CharacterSet charSet)
throws java.sql.SQLException
Constructor for NCHAR - a variant of CHAR with the mode of use NCHAR.
Parameters:
obj - input data from which this class instance is
constructed. This constructor calls obj.toString()
to obtain the input string.
charSet - character set of the CHAR to be created.
Throws:
java.sql.SQLException - if the input argument "obj" is an instance of an
unsupported class, or if the input object cannot be
converted into a CHAR.
NCHAR
public NCHAR(byte[] bytes,
oracle.sql.CharacterSet charSet)
NCHAR
public NCHAR(byte[] bytes,
int offset,
int count,
oracle.sql.CharacterSet charSet)