Package net.snowflake.client.core

## Class SFPreparedStatementMetaData

- java.lang.Object
- - net.snowflake.client.core.SFPreparedStatementMetaData

    public class SFPreparedStatementMetaData
    extends Object

Statement metadata which includes the result metadata and bind information.

Author:
  jhuang

  Created on 1/21/16

### Constructor Summary

Constructors
`SFPreparedStatementMetaData​(SFResultSetMetaData resultSetMetaData, SFStatementType statementType, int numberOfBinds, boolean arrayBindSupported, List<MetaDataOfBinds> metaDataOfBinds, boolean isValidMetaData)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static SFPreparedStatementMetaData` `emptyMetaData()` Generates an empty/invalid metadata for placeholder.
`MetaDataOfBinds` `getMetaDataForBindParam​(int param)`
`int` `getNumberOfBinds()`
`SFResultSetMetaData` `getResultSetMetaData()`
`SFStatementType` `getStatementType()`
`boolean` `isArrayBindSupported()` According to StatementType, to decide whether array binds supported or not
`boolean` `isValidMetaData()` Is a valid metadata or not.
`void` `setNumberOfBinds​(int numberOfBinds)`
`void` `setResultSetMetaData​(SFResultSetMetaData resultSetMetaData)`

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

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

### Constructor Detail

#### SFPreparedStatementMetaData

    public SFPreparedStatementMetaData​(SFResultSetMetaData resultSetMetaData,
                                       SFStatementType statementType,
                                       int numberOfBinds,
                                       boolean arrayBindSupported,
                                       List<MetaDataOfBinds> metaDataOfBinds,
                                       boolean isValidMetaData)

### Method Detail

#### getResultSetMetaData

    public SFResultSetMetaData getResultSetMetaData()

#### setResultSetMetaData

    public void setResultSetMetaData​(SFResultSetMetaData resultSetMetaData)

#### getNumberOfBinds

    public int getNumberOfBinds()

#### getMetaDataForBindParam

    public MetaDataOfBinds getMetaDataForBindParam​(int param)
                                            throws SQLException

Throws:
  `SQLException`

#### setNumberOfBinds

    public void setNumberOfBinds​(int numberOfBinds)

#### isValidMetaData

    public boolean isValidMetaData()

Is a valid metadata or not. If true, this object is a valid metadata from describe. If false, a dummy/empty metadata generated because prepare statement fails.

This is used to determine if the content is valid or not, e.g., number of bind parameters.

Returns:
  true or false

#### isArrayBindSupported

    public boolean isArrayBindSupported()

According to StatementType, to decide whether array binds supported or not

Currently, only INSERT supports array bind

Returns:
  true if array binds is supported.

#### getStatementType

    public SFStatementType getStatementType()

#### emptyMetaData

    public static SFPreparedStatementMetaData emptyMetaData()

Generates an empty/invalid metadata for placeholder.

Returns:
  statement metadata