Example #1
0
  public StatementImpl createStatement(
      int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
    // Check to see the connection is open
    checkConnection();

    validateResultSetType(resultSetType);
    validateResultSetConcurrency(resultSetConcurrency);
    // TODO: implement close cursors at commit

    // add the statement object to the map
    StatementImpl newStatement = new StatementImpl(this, resultSetType, resultSetConcurrency);
    addStatement(newStatement);

    return newStatement;
  }
Example #2
0
  public CallableStatementImpl prepareCall(
      String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
      throws SQLException {
    // Check to see the connection is open
    checkConnection();

    validateResultSetType(resultSetType);
    validateResultSetConcurrency(resultSetConcurrency);
    validateSQL(sql);
    // TODO: implement close cursors at commit

    // add the statement object to the map
    CallableStatementImpl newStatement =
        new CallableStatementImpl(this, sql, resultSetType, resultSetConcurrency);
    addStatement(newStatement);
    return newStatement;
  }
Example #3
0
  public PreparedStatementImpl prepareStatement(
      String sql,
      int resultSetType,
      int resultSetConcurrency,
      int resultSetHoldability,
      int autoGeneratedKeys)
      throws SQLException {
    // Check to see the connection is open
    checkConnection();

    validateResultSetType(resultSetType);
    validateResultSetConcurrency(resultSetConcurrency);
    validateSQL(sql);

    // add the statement object to the map
    PreparedStatementImpl newStatement =
        new PreparedStatementImpl(this, sql, resultSetType, resultSetConcurrency);
    newStatement.setAutoGeneratedKeys(autoGeneratedKeys == Statement.RETURN_GENERATED_KEYS);
    addStatement(newStatement);
    return newStatement;
  }