|
jxUtil 0.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sourceforge.jxutil.sql.type.AbstractType
Baseclass for all Types supported by the driver.
All operations on data retrieved from or sent to the database is handled
by instances of classes extending AbstractType.
The methods of this class have to perform all necessary conversions.
TODO:
Field Summary | |
protected static BigDecimal |
BD_ONE
|
protected static BigDecimal |
BD_ZERO
|
protected String |
name
The type's unique database specific typename. |
Constructor Summary | |
protected |
AbstractType(String name)
Construct a type with a given typename. |
Method Summary | |
protected DataTruncation |
dataTruncationRead(ConversionContext ctx,
Object rval,
Object val)
Report a DataTruncation warning. |
protected DataTruncation |
dataTruncationWrite(ConversionContext ctx,
Object wval,
Object val)
Report a DataTruncation exception. |
AbstractType |
deriveType(int d)
Derive a type from this type, modifying it according to the given integer parameter. |
Array |
getArray(Object row,
ConversionContext ctx)
|
InputStream |
getAsciiStream(Object row,
ConversionContext ctx)
|
boolean |
getAutoInc()
Get whether this type is automatically incrementing. |
BigDecimal |
getBigDecimal(Object row,
ConversionContext ctx)
Get a BigDecimal. |
InputStream |
getBinaryStream(Object row,
ConversionContext ctx)
|
Blob |
getBlob(Object row,
ConversionContext ctx)
|
boolean |
getBoolean(Object row,
ConversionContext ctx)
Get a boolean. |
byte |
getByte(Object row,
ConversionContext ctx)
Get a byte. |
byte[] |
getBytes(Object row,
ConversionContext ctx)
|
boolean |
getCaseSensitive()
Get whether data of this type is treated case sensitive. |
Reader |
getCharacterStream(Object row,
ConversionContext ctx)
|
Clob |
getClob(Object row,
ConversionContext ctx)
|
String |
getCreateParams()
Get the additional parameters to supply in a CREATE TABLE statement using this type. |
boolean |
getCurrency()
Get whether this type is a currency type. |
Date |
getDate(Object row,
Calendar cal,
ConversionContext ctx)
Get a Date using given Calendar. |
Date |
getDate(Object row,
ConversionContext ctx)
Get a Date. |
double |
getDouble(Object row,
ConversionContext ctx)
Get a double. |
float |
getFloat(Object row,
ConversionContext ctx)
Get a float. |
int |
getInt(Object row,
ConversionContext ctx)
Get an int. |
Class |
getJavaClass()
Get the Java Class returned when calling getObject on this type. |
Class |
getJavaType()
Get the Java Class of the primitive type best representing data of this database type. |
abstract int |
getJDBCType()
Get the type's closest representation as a JDBC type. |
String |
getLiteral(Object row,
ConversionContext ctx)
Get a literal value. |
String |
getLiteralPrefix()
Get the prefix to use for literal data of this type. |
String |
getLiteralSuffix()
Get the suffix to use for literal data of this type. |
String |
getLocalName()
Get the type's local name. |
long |
getLong(Object row,
ConversionContext ctx)
Get a long. |
short |
getMaxScale()
Get the type's maximum allowed scale. |
short |
getMinScale()
Get the type's minimum allowed scale. |
String |
getName()
Get the type's name. |
int |
getNullable()
Get whether this type can be nulled. |
int |
getNumRadix()
Get the type's numeric radix. |
Object |
getObject(Object row,
ConversionContext ctx)
|
Object |
getObject(Object row,
Map map,
ConversionContext ctx)
|
int |
getPrecision()
Get the type's precision. |
Ref |
getRef(Object row,
ConversionContext ctx)
|
int |
getScale()
Get the type's scale. |
int |
getSearchable()
Get whether columns of this type can be used in search constructs. |
short |
getShort(Object row,
ConversionContext ctx)
Get a short. |
String |
getString(Object row,
ConversionContext ctx)
|
Time |
getTime(Object row,
Calendar cal,
ConversionContext ctx)
Get a Time using given Calendar. |
Time |
getTime(Object row,
ConversionContext ctx)
Get a Time. |
Timestamp |
getTimestamp(Object row,
Calendar cal,
ConversionContext ctx)
|
Timestamp |
getTimestamp(Object row,
ConversionContext ctx)
|
boolean |
getUnsigned()
Get whether data of this type is unsigned. |
URL |
getURL(Object row,
ConversionContext ctx)
|
protected SQLException |
noConversion(String accessor)
|
protected SQLException |
noConversion(String accessor,
Class paramClass,
Object paramObject)
|
protected SQLException |
noConversion(String accessor,
Object paramObject)
|
void |
setArray(Object row,
Array val,
ConversionContext ctx)
|
void |
setAsciiStream(Object row,
InputStream in,
int length,
ConversionContext ctx)
|
void |
setBigDecimal(Object row,
BigDecimal val,
ConversionContext ctx)
|
void |
setBinaryStream(Object row,
InputStream in,
int length,
ConversionContext ctx)
|
void |
setBlob(Object row,
Blob val,
ConversionContext ctx)
|
void |
setBoolean(Object row,
boolean val,
ConversionContext ctx)
|
void |
setByte(Object row,
byte val,
ConversionContext ctx)
|
void |
setBytes(Object row,
byte[] val,
ConversionContext ctx)
|
void |
setCharacterStream(Object row,
Reader in,
int length,
ConversionContext ctx)
|
void |
setClob(Object row,
Clob val,
ConversionContext ctx)
|
void |
setDate(Object row,
Date val,
Calendar cal,
ConversionContext ctx)
|
void |
setDate(Object row,
Date val,
ConversionContext ctx)
|
void |
setDouble(Object row,
double val,
ConversionContext ctx)
|
void |
setFloat(Object row,
float val,
ConversionContext ctx)
|
void |
setInt(Object row,
int val,
ConversionContext ctx)
|
void |
setLong(Object row,
long val,
ConversionContext ctx)
|
void |
setNull(Object row,
ConversionContext ctx)
|
void |
setNull(Object row,
int parameterType,
ConversionContext ctx)
|
void |
setNull(Object row,
int parameterType,
String parameterName,
ConversionContext ctx)
|
void |
setObject(Object row,
Object val,
ConversionContext ctx)
|
void |
setObject(Object row,
Object val,
int target,
ConversionContext ctx)
Set value from Object. |
void |
setObject(Object row,
Object val,
int target,
int scale,
ConversionContext ctx)
Set value from Object. |
void |
setRef(Object row,
Ref val,
ConversionContext ctx)
|
void |
setShort(Object row,
short val,
ConversionContext ctx)
|
void |
setString(Object row,
String val,
ConversionContext ctx)
|
void |
setStruct(Object row,
Struct val,
ConversionContext ctx)
|
void |
setTime(Object row,
Time val,
Calendar cal,
ConversionContext ctx)
|
void |
setTime(Object row,
Time val,
ConversionContext ctx)
|
void |
setTimestamp(Object row,
Timestamp val,
Calendar cal,
ConversionContext ctx)
|
void |
setTimestamp(Object row,
Timestamp val,
ConversionContext ctx)
|
void |
setURL(Object row,
URL val,
ConversionContext ctx)
|
String |
toString()
Print lots of information on this type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final BigDecimal BD_ONE
protected static final BigDecimal BD_ZERO
protected final String name
Constructor Detail |
protected AbstractType(String name)
Method Detail |
protected final DataTruncation dataTruncationRead(ConversionContext ctx, Object rval, Object val)
rval
- The value readval
- The original value in the databaseprotected final DataTruncation dataTruncationWrite(ConversionContext ctx, Object wval, Object val)
wval
- The value writtenval
- The original valuepublic AbstractType deriveType(int d)
public Array getArray(Object row, ConversionContext ctx) throws SQLException
SQLException
public InputStream getAsciiStream(Object row, ConversionContext ctx) throws SQLException
SQLException
public boolean getAutoInc()
public BigDecimal getBigDecimal(Object row, ConversionContext ctx) throws SQLException
SQLException
public InputStream getBinaryStream(Object row, ConversionContext ctx) throws SQLException
SQLException
public Blob getBlob(Object row, ConversionContext ctx) throws SQLException
SQLException
public boolean getBoolean(Object row, ConversionContext ctx) throws SQLException
SQLException
public byte getByte(Object row, ConversionContext ctx) throws SQLException
SQLException
public byte[] getBytes(Object row, ConversionContext ctx) throws SQLException
SQLException
public boolean getCaseSensitive()
public Reader getCharacterStream(Object row, ConversionContext ctx) throws SQLException
SQLException
public Clob getClob(Object row, ConversionContext ctx) throws SQLException
SQLException
public String getCreateParams()
public boolean getCurrency()
public Date getDate(Object row, Calendar cal, ConversionContext ctx) throws SQLException
SQLException
public final Date getDate(Object row, ConversionContext ctx) throws SQLException
SQLException
public double getDouble(Object row, ConversionContext ctx) throws SQLException
SQLException
public float getFloat(Object row, ConversionContext ctx) throws SQLException
SQLException
public int getInt(Object row, ConversionContext ctx) throws SQLException
SQLException
public Class getJavaClass()
public Class getJavaType()
public abstract int getJDBCType()
Types
public String getLiteral(Object row, ConversionContext ctx) throws SQLException
SQLException
public String getLiteralPrefix()
public String getLiteralSuffix()
public String getLocalName()
public long getLong(Object row, ConversionContext ctx) throws SQLException
SQLException
public short getMaxScale()
public short getMinScale()
public final String getName()
public int getNullable()
public int getNumRadix()
public final Object getObject(Object row, ConversionContext ctx) throws SQLException
SQLException
public Object getObject(Object row, Map map, ConversionContext ctx) throws SQLException
SQLException
public int getPrecision()
public Ref getRef(Object row, ConversionContext ctx) throws SQLException
SQLException
public int getScale()
public int getSearchable()
public short getShort(Object row, ConversionContext ctx) throws SQLException
SQLException
public String getString(Object row, ConversionContext ctx) throws SQLException
SQLException
public Time getTime(Object row, Calendar cal, ConversionContext ctx) throws SQLException
SQLException
public final Time getTime(Object row, ConversionContext ctx) throws SQLException
SQLException
public Timestamp getTimestamp(Object row, Calendar cal, ConversionContext ctx) throws SQLException
SQLException
public final Timestamp getTimestamp(Object row, ConversionContext ctx) throws SQLException
SQLException
public boolean getUnsigned()
public URL getURL(Object row, ConversionContext ctx) throws SQLException
SQLException
protected final SQLException noConversion(String accessor) throws SQLException
SQLException
protected final SQLException noConversion(String accessor, Class paramClass, Object paramObject) throws SQLException
SQLException
protected final SQLException noConversion(String accessor, Object paramObject) throws SQLException
SQLException
public void setArray(Object row, Array val, ConversionContext ctx) throws SQLException
SQLException
public void setAsciiStream(Object row, InputStream in, int length, ConversionContext ctx) throws SQLException
SQLException
public void setBigDecimal(Object row, BigDecimal val, ConversionContext ctx) throws SQLException
SQLException
public void setBinaryStream(Object row, InputStream in, int length, ConversionContext ctx) throws SQLException
SQLException
public void setBlob(Object row, Blob val, ConversionContext ctx) throws SQLException
SQLException
public void setBoolean(Object row, boolean val, ConversionContext ctx) throws SQLException
SQLException
public void setByte(Object row, byte val, ConversionContext ctx) throws SQLException
SQLException
public void setBytes(Object row, byte[] val, ConversionContext ctx) throws SQLException
SQLException
public void setCharacterStream(Object row, Reader in, int length, ConversionContext ctx) throws SQLException
SQLException
public void setClob(Object row, Clob val, ConversionContext ctx) throws SQLException
SQLException
public void setDate(Object row, Date val, Calendar cal, ConversionContext ctx) throws SQLException
SQLException
public final void setDate(Object row, Date val, ConversionContext ctx) throws SQLException
SQLException
public void setDouble(Object row, double val, ConversionContext ctx) throws SQLException
SQLException
public void setFloat(Object row, float val, ConversionContext ctx) throws SQLException
SQLException
public void setInt(Object row, int val, ConversionContext ctx) throws SQLException
SQLException
public void setLong(Object row, long val, ConversionContext ctx) throws SQLException
SQLException
public void setNull(Object row, ConversionContext ctx) throws SQLException
SQLException
public void setNull(Object row, int parameterType, ConversionContext ctx) throws SQLException
SQLException
public void setNull(Object row, int parameterType, String parameterName, ConversionContext ctx) throws SQLException
SQLException
public void setObject(Object row, Object val, ConversionContext ctx) throws SQLException
SQLException
public void setObject(Object row, Object val, int target, ConversionContext ctx) throws SQLException
SQLException
public void setObject(Object row, Object val, int target, int scale, ConversionContext ctx) throws SQLException
SQLException
public void setRef(Object row, Ref val, ConversionContext ctx) throws SQLException
SQLException
public void setShort(Object row, short val, ConversionContext ctx) throws SQLException
SQLException
public void setString(Object row, String val, ConversionContext ctx) throws SQLException
SQLException
public void setStruct(Object row, Struct val, ConversionContext ctx) throws SQLException
SQLException
public void setTime(Object row, Time val, Calendar cal, ConversionContext ctx) throws SQLException
SQLException
public final void setTime(Object row, Time val, ConversionContext ctx) throws SQLException
SQLException
public void setTimestamp(Object row, Timestamp val, Calendar cal, ConversionContext ctx) throws SQLException
SQLException
public final void setTimestamp(Object row, Timestamp val, ConversionContext ctx) throws SQLException
SQLException
public void setURL(Object row, URL val, ConversionContext ctx) throws SQLException
SQLException
public String toString()
toString
in class Object
|
jxUtil 0.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |