|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjet.connect.DbValue
jet.connect.DbChar
public class DbChar
The DbChar class represents character strings. All
SQL string literals in Java programs, such as "VarChar" and "NVarChar",
are implemented as instances of this class.
DbChar supports mutable strings. A DbChar represents a string in the UTF-16 format
with default coding 8859-1. This class also supports other encodings.
You can set DbColDesc desc in the constructor with the
encoding name GBK, etc, and use getRaw and setRaw methods for other encodings.
| Field Summary | |
|---|---|
java.lang.String |
value
Deprecated. |
| Fields inherited from class jet.connect.DbValue |
|---|
bNull, CHAR_DESC, CURRENCY_DESC, DATE_DESC, desc, DOUBLE_DESC, INTEGER_DESC, TIME_DESC |
| Fields inherited from interface jet.util.DbValueable |
|---|
EQUAL, GREATER, LESS |
| Constructor Summary | |
|---|---|
DbChar()
Constructs an uninitialized DbChar. |
|
DbChar(DbColDesc desc)
Constructs an uninitialized DbChar. |
|
DbChar(java.lang.String val)
Constructs an uninitialized DbChar. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Creates a clone of this DbChar object. |
int |
compareTo(DbValue v)
Compares this DbChar object with the DbValue object. |
boolean |
equals(DbValue v)
Compares this object to the specified object. |
java.lang.String |
get()
Returns the value of this DbChar as a
String value. |
byte[] |
getRaw()
Returns the value of this DbChar as a
String value. |
void |
set(DbValue v)
Sets a newly allocated DbChar object that
represents the String value indicated by the
DbValue parameter. |
void |
set(JRHierarchicalDataset hds,
int col)
Sets a newly allocated DbChar object that
represents the String value indicated by the
JRHierarchicalDataset parameter and an index of the column. |
void |
set(java.sql.ResultSet rs,
int col)
Sets a newly allocated DbChar object that
represents the boolean value indicated by the
ResultSet parameter and an index of the column. |
void |
set(java.lang.String v)
Sets a newly allocated DbChar object that
represents the specified String argument. |
void |
setRaw(byte[] bytes)
Sets a newly allocated DbChar object that
represents the specified byte array argument. |
void |
setValue(java.lang.String v)
Sets a newly allocated DbChar object that
represents the String value indicated by the
String parameter. |
java.lang.String |
toConvertString()
Returns a String object representing this
DbChar's value. |
java.lang.String |
toString()
Returns a String object representing this
DbChar's value. |
java.lang.String |
toStringValue()
|
| Methods inherited from class jet.connect.DbValue |
|---|
compareTo, compareTo, equals, getColDesc, getPrecision, getScale, getSqlType, isCurrency, isNull, makeDbValue, setColDesc, setfoo, setNull, setValue |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String value
get and set to access it instead of accessing it directly.
| Constructor Detail |
|---|
public DbChar()
DbChar. This
DbChar object is mutable until the value and the description of the column are set.
public DbChar(java.lang.String val)
DbChar. This
DbBit object is mutable until DbColDesc is set.
val - The value holding a String.public DbChar(DbColDesc desc)
DbChar. This
DbChar object is mutable until the value is set.
desc - The value to be represented by the
DbColDesc object.| Method Detail |
|---|
public byte[] getRaw()
DbChar as a
String value. This method uses the desc.getEncodingName()
to encode the value and return an encoded string.
Note this method should be used with setRaw.
public void setRaw(byte[] bytes)
DbChar object that
represents the specified byte array argument.
This method uses the desc.getEncodingName()
to encode the value and set encoded string.
Note this method should be used with getRaw.
v - The value to be represented by the byte array.public final java.lang.String get()
DbChar as a
String value.
public final void set(java.lang.String v)
DbChar object that
represents the specified String argument.
v - The value to be represented by the String object.
public void set(java.sql.ResultSet rs,
int col)
throws java.sql.SQLException
DbChar object that
represents the boolean value indicated by the
ResultSet parameter and an index of the column.
set in class DbValuers - The ResultSet to be fetched.col - The index of the column.
java.sql.SQLException - if the ResultSet does not
contain the index.
public void set(JRHierarchicalDataset hds,
int col)
throws java.sql.SQLException
DbChar object that
represents the String value indicated by the
JRHierarchicalDataset parameter and an index of the column.
set in class DbValuehds - The JRHierarchicalDataset to be fetched.col - The index of the column.
java.sql.SQLException - if the ResultSet does not
contain the index.public java.lang.String toString()
String object representing this
DbChar's value. The value is returned as a string.
if the value is null, it returns "NULL".
toString in class DbValuepublic java.lang.String toConvertString()
String object representing this
DbChar's value.
If encoded, returns a new string with 8859_1.
If the value is null, it returns "NULL".
public java.lang.Object clone()
DbChar object.
clone in interface jet.util.DbValueableclone in class DbValuepublic boolean equals(DbValue v)
true if and only if the argument is not
null but a DbChar object that
contains the same String value as this object.
equals in class DbValuev - The DbValue object to be compared with.
true if the objects are the same;
false otherwise.public int compareTo(DbValue v)
DbChar object with the DbValue object.
compareTo in class DbValueDbValueablepublic void set(DbValue v)
DbChar object that
represents the String value indicated by the
DbValue parameter. The DbValue object will be checked to see if it is null.
set in class DbValuev - The DbValue to be converted to a
DbChar. If it is null, the value will not be set.public void setValue(java.lang.String v)
DbChar object that
represents the String value indicated by the
String parameter.
setValue in class DbValuev - The String to be converted to a
DbChar.public java.lang.String toStringValue()
toStringValue in class DbValue
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||