Java
Java DB
Documentation
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
sun.javadb.vti.core.TemplateTableFunction
sun.javadb.vti.core.StringColumnTableFunction
public abstract class
StringColumnTableFunction<dt>extends
TemplateTableFunction</dl>
This is an abstract Table Function which assumes that all columns are strings and which coerces the strings to reasonable values for various getXXX() methods. Subclasses must implement the following public ResultSet methods:
and the following protected methods introduced by this class:
| Nested Class Summary | |
|---|---|
class
|
StringColumnTableFunction.SimpleBlob
A crude Blob implementation. |
class
|
StringColumnTableFunction.SimpleClob
A crude Clob implementation. |
| Field Summary | |
|---|---|
private
String[]
|
_columnNames
|
private boolean
|
_lastColumnWasNull
|
| Fields inherited from interface java.sql. ResultSet |
|---|
CLOSE_CURSORS_AT_COMMIT,
CONCUR_READ_ONLY,
CONCUR_UPDATABLE,
FETCH_FORWARD,
FETCH_REVERSE,
FETCH_UNKNOWN,
HOLD_CURSORS_OVER_COMMIT,
TYPE_FORWARD_ONLY,
TYPE_SCROLL_INSENSITIVE,
TYPE_SCROLL_SENSITIVE
|
| Constructor Summary | |
|---|---|
StringColumnTableFunction
(
String[] columnNames)
Build a StringColumnTableFunction with the given column names | |
| Method Summary | |
|---|---|
private int
|
castLong
(long value)
|
private void
|
checkNull
(
String columnValue)
Set the wasNull flag based on whether this column value turned out to be null. |
int
|
findColumn
(
String columnName)
|
InputStream
|
getAsciiStream
(int columnIndex)
|
BigDecimal
|
getBigDecimal
(int columnIndex)
|
InputStream
|
getBinaryStream
(int columnIndex)
|
Blob
|
getBlob
(int columnIndex)
|
boolean
|
getBoolean
(int columnIndex)
|
byte
|
getByte
(int columnIndex)
|
byte[]
|
getBytes
(int columnIndex)
|
Clob
|
getClob
(int columnIndex)
|
protected int
|
getColumnCount
()
Return the number of columns in this table function. |
protected
String[]
|
getColumnNames
()
Return the names of the columns. |
Date
|
getDate
(int columnIndex)
|
double
|
getDouble
(int columnIndex)
|
private
InputStream
|
getEncodedStream
(
String columnValue,
String encoding)
Turn a string into an appropriately encoded ByteArrayInputStream. |
float
|
getFloat
(int columnIndex)
|
int
|
getInt
(int columnIndex)
|
long
|
getLong
(int columnIndex)
|
protected abstract
String
|
getRawColumn
(int columnNumber)
Get the string value of the column in the current row identified by the 1-based columnNumber. |
short
|
getShort
(int columnIndex)
|
String
|
getString
(int columnIndex)
|
Time
|
getTime
(int columnIndex)
|
Timestamp
|
getTimestamp
(int columnIndex)
|
private long
|
parseDateTime
(
String columnValue)
Translate a date/time expression into the corresponding long number of milliseconds. |
boolean
|
wasNull
()
|
protected
SQLException
|
wrap
(
String message,
Throwable t)
Wrap an exception in a SQLException. |
protected
SQLException
|
wrap
(
Throwable t)
Wrap an exception in a SQLException. |
| Methods inherited from class java.lang. Object |
|---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
| Methods inherited from interface java.sql. ResultSet |
|---|
close,
next
|
| Field Detail |
|---|
private
String[]
_columnNames
private boolean
_lastColumnWasNull
| Constructor Detail |
|---|
public
StringColumnTableFunction(
String[] columnNames)
Build a StringColumnTableFunction with the given column names
| Method Detail |
|---|
protected abstract
String
getRawColumn(int columnNumber)
throws
SQLException
Get the string value of the column in the current row identified by the 1-based columnNumber.
SQLException
public boolean
wasNull()
throws
SQLException
wasNull
in interface
ResultSet
wasNull
in class
TemplateTableFunction
SQLException
public int
findColumn(
String columnName)
throws
SQLException
findColumn
in interface
ResultSet
findColumn
in class
TemplateTableFunction
SQLException
public
String
getString(int columnIndex)
throws
SQLException
getString
in interface
ResultSet
getString
in class
TemplateTableFunction
SQLException
public boolean
getBoolean(int columnIndex)
throws
SQLException
getBoolean
in interface
ResultSet
getBoolean
in class
TemplateTableFunction
SQLException
public byte
getByte(int columnIndex)
throws
SQLException
getByte
in interface
ResultSet
getByte
in class
TemplateTableFunction
SQLException
public short
getShort(int columnIndex)
throws
SQLException
getShort
in interface
ResultSet
getShort
in class
TemplateTableFunction
SQLException
public int
getInt(int columnIndex)
throws
SQLException
getInt
in interface
ResultSet
getInt
in class
TemplateTableFunction
SQLException
public long
getLong(int columnIndex)
throws
SQLException
getLong
in interface
ResultSet
getLong
in class
TemplateTableFunction
SQLException
public float
getFloat(int columnIndex)
throws
SQLException
getFloat
in interface
ResultSet
getFloat
in class
TemplateTableFunction
SQLException
public double
getDouble(int columnIndex)
throws
SQLException
getDouble
in interface
ResultSet
getDouble
in class
TemplateTableFunction
SQLException
public
BigDecimal
getBigDecimal(int columnIndex)
throws
SQLException
getBigDecimal
in interface
ResultSet
getBigDecimal
in class
TemplateTableFunction
SQLException
public byte[]
getBytes(int columnIndex)
throws
SQLException
getBytes
in interface
ResultSet
getBytes
in class
TemplateTableFunction
SQLException
public
Date
getDate(int columnIndex)
throws
SQLException
getDate
in interface
ResultSet
getDate
in class
TemplateTableFunction
SQLException
public
Time
getTime(int columnIndex)
throws
SQLException
getTime
in interface
ResultSet
getTime
in class
TemplateTableFunction
SQLException
public
Timestamp
getTimestamp(int columnIndex)
throws
SQLException
getTimestamp
in interface
ResultSet
getTimestamp
in class
TemplateTableFunction
SQLException
public
InputStream
getAsciiStream(int columnIndex)
throws
SQLException
getAsciiStream
in interface
ResultSet
getAsciiStream
in class
TemplateTableFunction
SQLException
public
InputStream
getBinaryStream(int columnIndex)
throws
SQLException
getBinaryStream
in interface
ResultSet
getBinaryStream
in class
TemplateTableFunction
SQLException
public
Blob
getBlob(int columnIndex)
throws
SQLException
getBlob
in interface
ResultSet
getBlob
in class
TemplateTableFunction
SQLException
public
Clob
getClob(int columnIndex)
throws
SQLException
getClob
in interface
ResultSet
getClob
in class
TemplateTableFunction
SQLException
protected
String[]
getColumnNames()
Return the names of the columns.
protected int
getColumnCount()
Return the number of columns in this table function.
protected
SQLException
wrap(
Throwable t)
Wrap an exception in a SQLException.
protected
SQLException
wrap(
String message,
Throwable t)
Wrap an exception in a SQLException.
private void
checkNull(
String columnValue)
Set the wasNull flag based on whether this column value turned out to be null.
private long
parseDateTime(
String columnValue)
throws
SQLException
Translate a date/time expression into the corresponding long number of milliseconds.
SQLException
private
InputStream
getEncodedStream(
String columnValue,
String encoding)
throws
SQLException
Turn a string into an appropriately encoded ByteArrayInputStream.
SQLException
private int
castLong(long value)
throws
SQLException
SQLException
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||