Package org.apache.calcite.avatica

## Class AvaticaSite

- java.lang.Object
- - org.apache.calcite.avatica.AvaticaSite

    public class AvaticaSite
    extends java.lang.Object

A location that a value can be written to or read from.

### Nested Class Summary

Nested Classes
`private static class` `AvaticaSite.Dummy` Singleton value to denote parameters that have been set to null (as opposed to not set).

### Field Summary

Fields
`(package private) java.util.Calendar` `calendar` Calendar is not thread-safe.
`static java.lang.Object` `DUMMY_VALUE` Value that means the parameter has been set to null.
`private int` `index`
`(package private) AvaticaParameter` `parameter`
`(package private) TypedValue[]` `slots`

### Constructor Summary

Constructors
`AvaticaSite​(AvaticaParameter parameter, java.util.Calendar calendar, int index, TypedValue[] slots)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static java.lang.Object` `get​(Cursor.Accessor accessor, int targetSqlType, java.util.Calendar localCalendar)` Similar logic to `setObject(java.lang.Object, int)`.
`boolean` `isSet​(int index)`
`private static java.lang.RuntimeException` `notImplemented()`
`void` `setArray​(java.sql.Array x)`
`void` `setAsciiStream​(java.io.InputStream x)`
`void` `setAsciiStream​(java.io.InputStream x, long length)`
`void` `setBigDecimal​(java.math.BigDecimal x)`
`void` `setBinaryStream​(java.io.InputStream x)`
`void` `setBinaryStream​(java.io.InputStream x, long length)`
`void` `setBlob​(java.io.InputStream inputStream)`
`void` `setBlob​(java.io.InputStream inputStream, long length)`
`void` `setBlob​(java.sql.Blob x)`
`void` `setBoolean​(boolean o)`
`void` `setByte​(byte o)`
`void` `setBytes​(byte[] x)`
`void` `setChar​(char o)`
`void` `setCharacterStream​(java.io.Reader reader)`
`void` `setCharacterStream​(java.io.Reader reader, long length)`
`void` `setClob​(java.io.Reader reader)`
`void` `setClob​(java.io.Reader reader, long length)`
`void` `setClob​(java.sql.Clob x)`
`void` `setDate​(java.sql.Date x, java.util.Calendar calendar)`
`void` `setDouble​(double x)`
`void` `setFloat​(float x)`
`void` `setInt​(int o)`
`void` `setLong​(long o)`
`void` `setNCharacterStream​(java.io.Reader value)`
`void` `setNCharacterStream​(java.io.Reader value, long length)`
`void` `setNClob​(java.io.Reader reader)`
`void` `setNClob​(java.io.Reader reader, long length)`
`void` `setNClob​(java.sql.NClob value)`
`void` `setNString​(java.lang.String o)`
`void` `setNull​(int sqlType)`
`void` `setNull​(int sqlType, java.lang.String typeName)`
`void` `setObject​(java.lang.Object x)`
`void` `setObject​(java.lang.Object x, int targetSqlType)`
`void` `setObject​(java.lang.Object x, int targetSqlType, int scaleOrLength)`
`void` `setRef​(java.sql.Ref x)`
`void` `setRowId​(java.sql.RowId x)`
`void` `setShort​(short o)`
`void` `setSQLXML​(java.sql.SQLXML xmlObject)`
`void` `setString​(java.lang.String x)`
`void` `setTime​(java.sql.Time x, java.util.Calendar calendar)`
`void` `setTimestamp​(java.sql.Timestamp x, java.util.Calendar calendar)`
`void` `setUnicodeStream​(java.io.InputStream x, int length)`
`void` `setURL​(java.net.URL x)`
`private static java.sql.Array` `toArray​(java.lang.Object x)`
`static java.math.BigDecimal` `toBigDecimal​(java.lang.Object x)`
`private static boolean` `toBoolean​(java.lang.Object x)`
`private static byte` `toByte​(java.lang.Object x)`
`private static byte[]` `toBytes​(java.lang.Object x)`
`private static java.sql.Date` `toDate​(java.lang.Object x)`
`private static double` `toDouble​(java.lang.Object x)`
`private static float` `toFloat​(java.lang.Object x)`
`private static int` `toInt​(java.lang.Object x)`
`private static long` `toLong​(java.lang.Object x)`
`private static short` `toShort​(java.lang.Object x)`
`private static java.lang.String` `toString​(java.lang.Object x)`
`private static java.sql.Time` `toTime​(java.lang.Object x)`
`private static java.sql.Timestamp` `toTimestamp​(java.lang.Object x)`
`private static java.lang.RuntimeException` `unsupportedCast​(java.lang.Class<?> from, java.lang.Class<?> to)`
`private TypedValue` `wrap​(ColumnMetaData.Rep rep, java.lang.Object o)`
`private TypedValue` `wrap​(ColumnMetaData.Rep rep, java.lang.Object o, java.util.Calendar calendar)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### parameter

    final AvaticaParameter parameter

#### calendar

    final java.util.Calendar calendar

Calendar is not thread-safe. But calendar is only used from within one thread, and we have to trust that clients are not modifying calendars that they pass to us in a method such as `PreparedStatement.setTime(int, Time, Calendar)`, so we do not need to synchronize access.

#### index

    private final int index

#### slots

    final TypedValue[] slots

#### DUMMY_VALUE

    public static final java.lang.Object DUMMY_VALUE

Value that means the parameter has been set to null. If value is null, parameter has not been set.

### Constructor Detail

#### AvaticaSite

    public AvaticaSite​(AvaticaParameter parameter,
                       java.util.Calendar calendar,
                       int index,
                       TypedValue[] slots)

### Method Detail

#### wrap

    private TypedValue wrap​(ColumnMetaData.Rep rep,
                            java.lang.Object o,
                            java.util.Calendar calendar)

#### wrap

    private TypedValue wrap​(ColumnMetaData.Rep rep,
                            java.lang.Object o)

#### isSet

    public boolean isSet​(int index)

#### setByte

    public void setByte​(byte o)

#### setChar

    public void setChar​(char o)

#### setShort

    public void setShort​(short o)

#### setInt

    public void setInt​(int o)

#### setLong

    public void setLong​(long o)

#### setBoolean

    public void setBoolean​(boolean o)

#### setRowId

    public void setRowId​(java.sql.RowId x)

#### setNString

    public void setNString​(java.lang.String o)

#### setNCharacterStream

    public void setNCharacterStream​(java.io.Reader value,
                                    long length)

#### setNClob

    public void setNClob​(java.sql.NClob value)

#### setClob

    public void setClob​(java.io.Reader reader,
                        long length)

#### setBlob

    public void setBlob​(java.io.InputStream inputStream,
                        long length)

#### setNClob

    public void setNClob​(java.io.Reader reader,
                         long length)

#### setSQLXML

    public void setSQLXML​(java.sql.SQLXML xmlObject)

#### setAsciiStream

    public void setAsciiStream​(java.io.InputStream x,
                               long length)

#### setBinaryStream

    public void setBinaryStream​(java.io.InputStream x,
                                long length)

#### setCharacterStream

    public void setCharacterStream​(java.io.Reader reader,
                                   long length)

#### setAsciiStream

    public void setAsciiStream​(java.io.InputStream x)

#### setBinaryStream

    public void setBinaryStream​(java.io.InputStream x)

#### setCharacterStream

    public void setCharacterStream​(java.io.Reader reader)

#### setNCharacterStream

    public void setNCharacterStream​(java.io.Reader value)

#### setClob

    public void setClob​(java.io.Reader reader)

#### setBlob

    public void setBlob​(java.io.InputStream inputStream)

#### setNClob

    public void setNClob​(java.io.Reader reader)

#### setUnicodeStream

    public void setUnicodeStream​(java.io.InputStream x,
                                 int length)

#### setFloat

    public void setFloat​(float x)

#### setDouble

    public void setDouble​(double x)

#### setBigDecimal

    public void setBigDecimal​(java.math.BigDecimal x)

#### setString

    public void setString​(java.lang.String x)

#### setBytes

    public void setBytes​(byte[] x)

#### setTimestamp

    public void setTimestamp​(java.sql.Timestamp x,
                             java.util.Calendar calendar)

#### setTime

    public void setTime​(java.sql.Time x,
                        java.util.Calendar calendar)

#### setDate

    public void setDate​(java.sql.Date x,
                        java.util.Calendar calendar)

#### setObject

    public void setObject​(java.lang.Object x,
                          int targetSqlType)

#### get

    public static java.lang.Object get​(Cursor.Accessor accessor,
                                       int targetSqlType,
                                       java.util.Calendar localCalendar)
                                throws java.sql.SQLException

Similar logic to `setObject(java.lang.Object, int)`.

Throws:
  `java.sql.SQLException`

#### setObject

    public void setObject​(java.lang.Object x)

#### setNull

    public void setNull​(int sqlType)

#### setRef

    public void setRef​(java.sql.Ref x)

#### setBlob

    public void setBlob​(java.sql.Blob x)

#### setClob

    public void setClob​(java.sql.Clob x)

#### setArray

    public void setArray​(java.sql.Array x)

#### setNull

    public void setNull​(int sqlType,
                        java.lang.String typeName)

#### setURL

    public void setURL​(java.net.URL x)

#### setObject

    public void setObject​(java.lang.Object x,
                          int targetSqlType,
                          int scaleOrLength)

#### unsupportedCast

    private static java.lang.RuntimeException unsupportedCast​(java.lang.Class<?> from,
                                                              java.lang.Class<?> to)

#### notImplemented

    private static java.lang.RuntimeException notImplemented()

#### toArray

    private static java.sql.Array toArray​(java.lang.Object x)

#### toBigDecimal

    public static java.math.BigDecimal toBigDecimal​(java.lang.Object x)

#### toBoolean

    private static boolean toBoolean​(java.lang.Object x)

#### toByte

    private static byte toByte​(java.lang.Object x)

#### toBytes

    private static byte[] toBytes​(java.lang.Object x)

#### toDate

    private static java.sql.Date toDate​(java.lang.Object x)

#### toTime

    private static java.sql.Time toTime​(java.lang.Object x)

#### toTimestamp

    private static java.sql.Timestamp toTimestamp​(java.lang.Object x)

#### toDouble

    private static double toDouble​(java.lang.Object x)

#### toFloat

    private static float toFloat​(java.lang.Object x)

#### toInt

    private static int toInt​(java.lang.Object x)

#### toLong

    private static long toLong​(java.lang.Object x)

#### toShort

    private static short toShort​(java.lang.Object x)

#### toString

    private static java.lang.String toString​(java.lang.Object x)