|
Oracle®Database JDBC Java API Reference 12c Release 1 (12.1.0.2) E56669-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.sql.Datum
oracle.sql.CHAR
public class CHAR
The Oracle specific representation of characters. The class extends oracle.sql.Datum and interprets the bytes according to one of the Oracle supported character sets. Each object of type oracle.sql.CHAR contains an indication of what character set to use in interpreting the bytes so one class can be used for all the variations, such as National Character Set, Client, Database, etc.
For conversions that are not supported directly by CHAR (e.g. "best effort" conversions from String), if the programer wants a "best attempt" even when the conversion looses information, the "withReplacement" methods of oracle.sql.CharacterSet can be used directly.
CharacterSet
, Serialized FormField Summary | |
---|---|
static CharacterSet |
DEFAULT_CHARSET |
static boolean |
TRACE |
Constructor Summary | |
---|---|
protected |
CHAR() |
|
CHAR(Object obj, CharacterSet charSet) Construct a CHAR from an Object. |
|
CHAR(String str, CharacterSet charSet) Constructor for CHAR. |
|
CHAR(String str, CharacterSet charSet, int len) Constructor for CHAR. |
Method Summary | |
---|---|
InputStream |
asciiStreamValue() Convert to an ascii stream representation of the datum object |
BigDecimal |
bigDecimalValue() Convert this data object into a BigDecimal. |
InputStream |
binaryStreamValue() Convert to a binary stream representation of the datum object |
boolean |
booleanValue() Convert to a boolean representation of the datum object |
byte |
byteValue() Convert to a byte representation of the datum object |
Reader |
characterStreamValue() Convert to a character stream representation of the datum object |
Date |
dateValue() Convert to a Date representation of the datum object |
double |
doubleValue() Convert to a double representation of the datum object |
float |
floatValue() Convert to a float representation of the datum object |
protected oracle.jdbc.internal.OracleConnection |
getConnectionDuringExceptionHandling() |
String |
getString() Converts the sequence of characters represented by this to a String. |
int |
intValue() Convert to a integer representation of the datum object |
boolean |
isConvertibleTo(Class jClass) Test whether this data object can be converted to the specified Java data type. |
long |
longValue() Convert to a long representation of the datum object |
int |
oracleId() The integer that identifies the character set. |
String |
stringValue() Convert this data object into a String. |
Timestamp |
timestampValue() Convert to a Timestamp representation of the datum object |
Time |
timeValue() Convert to a Time representation of the datum object |
Object |
toJdbc() Convert this data object into its default Java object type. |
String |
toString() Converts the characters to a String. |
Methods inherited from class oracle.sql.Datum |
---|
bytesEqual, compareBytes, getBytes, getLength, getStream, isNull, setBytes, setShareBytes, shareBytes, stringValue, timestampValue, timeValue, toClass |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final CharacterSet DEFAULT_CHARSET
public static final boolean TRACE
Constructor Detail |
---|
protected CHAR()
public CHAR(String str, CharacterSet charSet, int len) throws SQLException
str
- the sequence of characters (represented in Unicode).charSet
- the CharacterSet to which the string should be converted.
if charSet is null, default charset will be used. The default charset choose we8iso8859p1 as Oracle Utiliites charset.
len
- the length that the CHAR object will be space padded up toSQLException
- if the attempt to convert str to charSet throws an exception.public CHAR(String str, CharacterSet charSet) throws SQLException
str
- the sequence of characters (represented in Unicode).charSet
- the CharacterSet to which the string should be converted.
if charSet is null, default charset will be used. The default charset choose we8iso8859p1 as Oracle Utiliites charset.
SQLException
- if the attempt to convert str to charSet throws an exception.public CHAR(Object obj, CharacterSet charSet) throws SQLException
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.SQLException
- if the input argument 'obj' is an instance of an unsupported class, or if the input object cannot be converted into a CHAR.Method Detail |
---|
public int oracleId()
public String getString() throws SQLException
SQLException
- if conversion from this.oracleId to UTF is not supportedSQLException
- if the particular cannot characters cannot be converted without loss to Unicode.public String toString()
toString
in class Object
public Object toJdbc() throws SQLException
toJdbc
in class Datum
SQLException
- if any of the lower layer code throws an exception.public boolean isConvertibleTo(Class jClass)
isConvertibleTo
in class Datum
jClass
- specifies the Java data type to test against.public String stringValue()
stringValue
in class Datum
public boolean booleanValue() throws SQLException
booleanValue
in class Datum
SQLException,
- if no boolean representation existsSQLException
public int intValue() throws SQLException
intValue
in class Datum
SQLException,
- if no integer representation existsSQLException
public long longValue() throws SQLException
longValue
in class Datum
SQLException,
- if no long representation existsSQLException
public float floatValue() throws SQLException
floatValue
in class Datum
SQLException,
- if no float representation existsSQLException
public double doubleValue() throws SQLException
doubleValue
in class Datum
SQLException,
- if no double representation existsSQLException
public byte byteValue() throws SQLException
byteValue
in class Datum
SQLException,
- if no byte representation existsSQLException
public Date dateValue() throws SQLException
dateValue
in class Datum
SQLException,
- if no Date representation existsSQLException
public Time timeValue() throws SQLException
timeValue
in class Datum
SQLException,
- if no Time representation existsSQLException
public Timestamp timestampValue() throws SQLException
timestampValue
in class Datum
SQLException,
- if no Timestamp representation existsSQLException
public BigDecimal bigDecimalValue() throws SQLException
bigDecimalValue
in class Datum
SQLException
public Reader characterStreamValue() throws SQLException
characterStreamValue
in class Datum
SQLException,
- if no character stream representation existsSQLException
public InputStream asciiStreamValue() throws SQLException
asciiStreamValue
in class Datum
SQLException,
- if no ascii stream representation existsSQLException
public InputStream binaryStreamValue() throws SQLException
binaryStreamValue
in class Datum
SQLException,
- if no binary stream representation existsSQLException
protected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling()
getConnectionDuringExceptionHandling
in class Datum
|
Oracle®Database JDBC Java API Reference 12c Release 1 (12.1.0.2) E56669-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |