# Interface Parameter

public interface Parameter
Parameter

## Method Summary

Modifier and Type
Method
Description
`String`
`bestEffortStringValue(org.mariadb.jdbc.client.Context context)`
Methods to return parameter as string if possible (Streaming parameter will return null)
`boolean`
`canEncodeLongData()`
Can parameter be encoded in binary long format
`void`
`encodeBinary(Writer encoder, org.mariadb.jdbc.client.Context context)`
Encode parameter in binary format
`byte[]`
`encodeData()`
transform parameter in byte array
`void`
`encodeLongData(Writer encoder)`
Encode parameter in binary long format
`void`
`encodeText(Writer encoder, org.mariadb.jdbc.client.Context context)`
Encode parameter in text format
`int`
`getApproximateTextProtocolLength()`
Get approximate text length, or -1 if unknown
`int`
`getBinaryEncodeType()`
return binary encoding type
`boolean`
`isNull()`
is parameter null

## Method Details

### encodeText

void encodeText(Writer encoder, org.mariadb.jdbc.client.Context context) throws IOException, SQLException
Encode parameter in text format

Parameters:
  `encoder` - packet writer
  `context` - connection context
Throws:
  `IOException` - if socket error occurs
  `SQLException` - if other kind of error occurs

### getApproximateTextProtocolLength

int getApproximateTextProtocolLength()
Get approximate text length, or -1 if unknown

Returns:
  max length if known, -1 if unknown

### encodeBinary

void encodeBinary(Writer encoder, org.mariadb.jdbc.client.Context context) throws IOException, SQLException
Encode parameter in binary format

Parameters:
  `encoder` - packet writer
  `context` - connection context
Throws:
  `IOException` - if socket error occurs
  `SQLException` - if other kind of error occurs

### encodeLongData

void encodeLongData(Writer encoder) throws IOException, SQLException
Encode parameter in binary long format

Parameters:
  `encoder` - packet writer
Throws:
  `IOException` - if socket error occurs
  `SQLException` - if other kind of error occurs

### encodeData

byte[] encodeData() throws IOException, SQLException
transform parameter in byte array

Returns:
  bytes
Throws:
  `IOException` - if socket error occurs
  `SQLException` - if other kind of error occurs

### canEncodeLongData

boolean canEncodeLongData()
Can parameter be encoded in binary long format

Returns:
  can parameter be encoded in binary long format

### getBinaryEncodeType

int getBinaryEncodeType()
return binary encoding type

Returns:
  binary encoding type

### isNull

boolean isNull()
is parameter null

Returns:
  is null

### bestEffortStringValue

String bestEffortStringValue(org.mariadb.jdbc.client.Context context)
Methods to return parameter as string if possible (Streaming parameter will return null)

Parameters:
  `context` - current connection context
Returns:
  null if not available.