public class DatabasePrintListener extends Object implements IDatabaseListener
| Modifier and Type | Field and Description |
|---|---|
protected static ICache<String,TimeZone> |
cacheTimezone
Cache of timezone.
|
protected SimpleDateFormat |
formatDate
Format dates.
|
protected SimpleDateFormat |
formatTime
Format timestamps.
|
| Constructor and Description |
|---|
DatabasePrintListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
dump(IContext context,
IResultSet result,
String sql,
Map<Integer,Object> arguments)
Dump SQL.
|
String |
getTimezone()
Get current timezone set.
|
protected TimeZone |
getZone()
Get a timezone definition.
|
void |
initialize() |
void |
onRegisterIn(DatabaseRegisterEvent event)
On register input command.
|
void |
onRegisterOut(DatabaseRegisterEvent event)
On register output command.
|
void |
onTableIn(DatabaseTableEvent event)
On table start processing.
|
void |
onTableOut(DatabaseTableEvent event)
On table end processing.
|
protected void |
print(StringBuilder sb)
Print result.
|
protected void |
printDate(StringBuilder sb,
Date obj)
Print dates as SQL.
|
void |
setTimezone(String timezone)
Set current timezone.
|
protected void |
textByType(StringBuilder sb,
Object obj)
Dump current value according to its type.
|
protected SimpleDateFormat formatTime
protected SimpleDateFormat formatDate
public String getTimezone()
public void setTimezone(String timezone)
timezone - The timezone.protected TimeZone getZone()
public void initialize()
initialize in interface IResetablepublic void onTableIn(DatabaseTableEvent event) throws DatabaseException
IDatabaseListeneronTableIn in interface IDatabaseListenerevent - Event.DatabaseException - On processing errors.public void onRegisterIn(DatabaseRegisterEvent event) throws DatabaseException
IDatabaseListeneronRegisterIn in interface IDatabaseListenerevent - Event.DatabaseException - On register errors.public void onRegisterOut(DatabaseRegisterEvent event) throws DatabaseException
IDatabaseListeneronRegisterOut in interface IDatabaseListenerevent - Event.DatabaseException - O register errors.public void onTableOut(DatabaseTableEvent event) throws DatabaseException
IDatabaseListeneronTableOut in interface IDatabaseListenerevent - Event.DatabaseException - On processing errors.public void dump(IContext context, IResultSet result, String sql, Map<Integer,Object> arguments)
context - The test context.result - The test result.sql - The SQL.arguments - The arguments.protected void textByType(StringBuilder sb, Object obj)
sb - The result.obj - An object to dump.protected void printDate(StringBuilder sb, Date obj)
sb - The result.obj - An object to dump.protected void print(StringBuilder sb)
sb - A resolved SQL.Copyright © 2017. All rights reserved.