public class DateColumnTranslator extends java.lang.Object implements ColumnTranslator
In the adapter configuration file this class is aliased as jdbc-type-date-column-translator which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
DateColumnTranslator()
The default dateformat is "yyyy-MM-dd"
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDateFormat() |
void |
setDateFormat(java.lang.String format)
Set the date format used to convert the column into a String.
|
protected java.lang.String |
toString(java.util.Date d) |
java.lang.String |
translate(JdbcResultRow rs,
int column)
Translate the column into a String.
|
java.lang.String |
translate(JdbcResultRow rs,
java.lang.String columnName)
Translate the column into a String.
|
public DateColumnTranslator()
public java.lang.String translate(JdbcResultRow rs, int column) throws java.sql.SQLException, java.io.IOException
ColumnTranslator
translate
in interface ColumnTranslator
rs
- the result setcolumn
- the column indexjava.sql.SQLException
java.io.IOException
public java.lang.String translate(JdbcResultRow rs, java.lang.String columnName) throws java.sql.SQLException, java.io.IOException
ColumnTranslator
translate
in interface ColumnTranslator
rs
- the result setcolumnName
- the column namejava.sql.SQLException
java.io.IOException
protected java.lang.String toString(java.util.Date d) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public java.lang.String getDateFormat()
public void setDateFormat(java.lang.String format)
format
- the format; the default is "yyyy-MM-dd'T'HH:mm:ssZ".