public override void Execute(string template, params object[] args) { if (Connection.State != ConnectionState.Open) { Connection.Open(); } using (var command = OracleFactory.GetCommand(Connection, String.Format(template, args))) { command.ExecuteNonQuery(); } }
public override bool Exists(string template, params object[] args) { if (Connection.State != ConnectionState.Open) { Connection.Open(); } using (var command = OracleFactory.GetCommand(Connection, String.Format(template, args))) using (var reader = command.ExecuteReader()) { return(reader.Read()); } }
public override DataSet Read(string template, params object[] args) { if (Connection.State != ConnectionState.Open) { Connection.Open(); } DataSet ds = new DataSet(); using (var command = OracleFactory.GetCommand(Connection, String.Format(template, args))) using (DbDataAdapter adapter = OracleFactory.GetDataAdapter(command)) { adapter.Fill(ds); return(ds); } }
protected override void Process(string sql) { Announcer.Sql(sql); if (Options.PreviewOnly || string.IsNullOrEmpty(sql)) { return; } if (Connection.State != ConnectionState.Open) { Connection.Open(); } using (var command = OracleFactory.GetCommand(Connection, sql)) command.ExecuteNonQuery(); }