Package com.illumon.intradaylogger
Class SQLReplicationRow
java.lang.Object
com.illumon.intradaylogger.SQLReplicationRow
- All Implemented Interfaces:
SystemInputRow
A thin wrapper for ResultSet consumed by the SQLReplicationLogger.
This provides a few services that makes it nicer to generate loggers for SQL replication:
- Converts SQLExeptions to IOException for consistency with existing logger classes.
- Converts SQL types to Iris types where appropriate.
- Convert SQL nulls to the Iris-equivalent null values for primitive types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBigDecimal(String name) Get JDBC BigDecimal (numeric/decimal)getBoolean(String name) Get an SQL bit/boolean integer as an Iris BooleanbyteGet an SQL tinyint/byte as an Iris byte (converting NULL to the Iris equivalent value).byte[]Get a SQL binary value as a byte array.getBytesAsString(String name) Get an SQL binary value converted to a string.charConvert JDBC text/varchar/char to Iris char.Get an SQL datelonggetDateAsMillis(String name) Get an SQL date as millislonggetDateAsNanos(String name) Get an SQL date as nanos.doubleConvert JDBC double to Iris double (converting NULL to the Iris equivalent value).floatConvert JDBC integer to Iris doubleintGet an SQL integer as an Iris int (converting NULL to the Iris equivalent value).longGet an SQL bigint/long as an Iris long (converting NULL to the Iris equivalent value).shortGet an SQL short integer as an Iris short (converting NULL to the Iris equivalent value).Get string column value.Get an SQL timelonggetTimeAsMillis(String name) Get an SQL time in millislonggetTimeAsNanos(String name) Get an SQL time in nanos.getTimestamp(String name) Get an SQL timestamplonggetTimestampAsMillis(String name) Get an SQL timestamp in millislonggetTimestampAsNanos(String name) Get an SQL timestamp in nanos
-
Constructor Details
-
SQLReplicationRow
-
-
Method Details
-
getBoolean
Get an SQL bit/boolean integer as an Iris Boolean- Specified by:
getBooleanin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getShort
Get an SQL short integer as an Iris short (converting NULL to the Iris equivalent value).- Specified by:
getShortin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getInt
Get an SQL integer as an Iris int (converting NULL to the Iris equivalent value).- Specified by:
getIntin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getLong
Get an SQL bigint/long as an Iris long (converting NULL to the Iris equivalent value).- Specified by:
getLongin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getByte
Get an SQL tinyint/byte as an Iris byte (converting NULL to the Iris equivalent value).- Specified by:
getBytein interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getDouble
Convert JDBC double to Iris double (converting NULL to the Iris equivalent value).- Specified by:
getDoublein interfaceSystemInputRow- Throws:
IOException
-
getFloat
Convert JDBC integer to Iris double- Specified by:
getFloatin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getBigDecimal
Get JDBC BigDecimal (numeric/decimal)- Specified by:
getBigDecimalin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getChar
Convert JDBC text/varchar/char to Iris char. If the client is using this, we assume either the database type is of length 1 or they only care about the first character.- Specified by:
getCharin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getString
Get string column value.- Specified by:
getStringin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getDate
Get an SQL date- Specified by:
getDatein interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getDateAsMillis
Get an SQL date as millis- Specified by:
getDateAsMillisin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getDateAsNanos
Get an SQL date as nanos. Note: These have only millisecond precision.- Specified by:
getDateAsNanosin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getTimestamp
Get an SQL timestamp- Specified by:
getTimestampin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getTimestampAsMillis
Get an SQL timestamp in millis- Specified by:
getTimestampAsMillisin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getTimestampAsNanos
Get an SQL timestamp in nanos- Specified by:
getTimestampAsNanosin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getTime
Get an SQL time- Specified by:
getTimein interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getTimeAsMillis
Get an SQL time in millis- Specified by:
getTimeAsMillisin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getTimeAsNanos
Get an SQL time in nanos. Note: These have only millisecond precision.- Specified by:
getTimeAsNanosin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getBytes
Get a SQL binary value as a byte array.- Specified by:
getBytesin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-
getBytesAsString
Get an SQL binary value converted to a string.- Specified by:
getBytesAsStringin interfaceSystemInputRow- Parameters:
name-- Returns:
- Throws:
IOException
-