# Class ComStmtPrepare

java.lang.Object
org.mariadb.jdbc.internal.com.send.ComStmtPrepare

public class ComStmtPrepare extends Object

## Constructor Summary

Constructors
Constructor
Description
`ComStmtPrepare(Protocol protocol, String sql)`

## Method Summary

Modifier and Type
Method
Description
`ServerPrepareResult`
`read(PacketInputStream reader, boolean eofDeprecated)`
Read COM_PREPARE_RESULT.
`ComStmtPrepare`
`send(PacketOutputStream pos)`
Send directly to socket the sql data.

### Methods inherited from class Object

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

## Constructor Details

### ComStmtPrepare

public ComStmtPrepare(Protocol protocol, String sql)

## Method Details

### send

public ComStmtPrepare send(PacketOutputStream pos) throws IOException
Send directly to socket the sql data.

Parameters:
  `pos` - the writer
Returns:
  ComStmtPrepare this object
Throws:
  `IOException` - if connection error occur

### read

public ServerPrepareResult read(PacketInputStream reader, boolean eofDeprecated) throws IOException, SQLException
Read COM_PREPARE_RESULT.

Parameters:
  `reader` - inputStream
  `eofDeprecated` - are EOF_packet deprecated
Returns:
  ServerPrepareResult prepare result
Throws:
  `IOException` - if connection has error
  `SQLException` - if server answer with error.