prepareStatement method

PreparedStatement? prepareStatement(
  1. int connectionId,
  2. String sql, {
  3. int timeoutMs = 0,
})

Prepares a SQL statement and returns a PreparedStatement wrapper.

The connectionId must be a valid active connection. The sql should be a parameterized SQL statement.

The timeoutMs specifies the statement timeout in milliseconds (0 = no timeout). Returns a PreparedStatement on success, null on failure.

Implementation

PreparedStatement? prepareStatement(
  int connectionId,
  String sql, {
  int timeoutMs = 0,
}) {
  final stmtId = prepare(connectionId, sql, timeoutMs: timeoutMs);
  if (stmtId == 0) return null;
  return PreparedStatement(this, stmtId);
}