Package org.springframework.jdbc.core.namedparam

# Class EmptySqlParameterSource

java.lang.Object
org.springframework.jdbc.core.namedparam.EmptySqlParameterSource

All Implemented Interfaces:
  `SqlParameterSource`

public class EmptySqlParameterSource extends Object implements SqlParameterSource
A simple empty implementation of the `SqlParameterSource` interface.

Since:
  3.2.2
Author:
  Juergen Hoeller

## Field Summary

Fields
Modifier and Type
Field
Description
`static final EmptySqlParameterSource`
`INSTANCE`
A shared instance of `EmptySqlParameterSource`.

### Fields inherited from interface org.springframework.jdbc.core.namedparam.SqlParameterSource

`TYPE_UNKNOWN`

## Constructor Summary

Constructors
Constructor
Description
`EmptySqlParameterSource()`

## Method Summary

Modifier and Type
Method
Description
`String[]`
`getParameterNames()`
Enumerate all available parameter names if possible.
`int`
`getSqlType(String paramName)`
Determine the SQL type for the specified named parameter.
`String`
`getTypeName(String paramName)`
Determine the type name for the specified named parameter.
`Object`
`getValue(String paramName)`
Return the parameter value for the requested named parameter.
`boolean`
`hasValue(String paramName)`
Determine whether there is a value for the specified named parameter.

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

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

## Field Details

### INSTANCE

public static final EmptySqlParameterSource INSTANCE
A shared instance of `EmptySqlParameterSource`.

## Constructor Details

### EmptySqlParameterSource

public EmptySqlParameterSource()

## Method Details

### hasValue

public boolean hasValue(String paramName)
Description copied from interface: `SqlParameterSource`
Determine whether there is a value for the specified named parameter.

Specified by:
  `hasValue` in interface `SqlParameterSource`
Parameters:
  `paramName` - the name of the parameter
Returns:
  whether there is a value defined

### getValue

@Nullable public Object getValue(String paramName) throws IllegalArgumentException
Description copied from interface: `SqlParameterSource`
Return the parameter value for the requested named parameter.

Specified by:
  `getValue` in interface `SqlParameterSource`
Parameters:
  `paramName` - the name of the parameter
Returns:
  the value of the specified parameter
Throws:
  `IllegalArgumentException` - if there is no value for the requested parameter

### getSqlType

public int getSqlType(String paramName)
Description copied from interface: `SqlParameterSource`
Determine the SQL type for the specified named parameter.

Specified by:
  `getSqlType` in interface `SqlParameterSource`
Parameters:
  `paramName` - the name of the parameter
Returns:
  the SQL type of the specified parameter, or `TYPE_UNKNOWN` if not known
See Also:
  - `SqlParameterSource.TYPE_UNKNOWN`

### getTypeName

@Nullable public String getTypeName(String paramName)
Description copied from interface: `SqlParameterSource`
Determine the type name for the specified named parameter.

Specified by:
  `getTypeName` in interface `SqlParameterSource`
Parameters:
  `paramName` - the name of the parameter
Returns:
  the type name of the specified parameter, or `null` if not known

### getParameterNames

@Nullable public String[] getParameterNames()
Description copied from interface: `SqlParameterSource`
Enumerate all available parameter names if possible.

This is an optional operation, primarily for use with `SimpleJdbcInsert` and `SimpleJdbcCall`.

Specified by:
  `getParameterNames` in interface `SqlParameterSource`
Returns:
  the array of parameter names, or `null` if not determinable
See Also:
  - `SqlParameterSourceUtils.extractCaseInsensitiveParameterNames(org.springframework.jdbc.core.namedparam.SqlParameterSource)`