OracleCommand.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. namespace Ant.Oracle
  7. {
  8. public class OracleCommand : IDbCommand, IDisposable
  9. {
  10. IDbCommand _dbCommand;
  11. public OracleCommand(IDbCommand dbCommand)
  12. {
  13. Utils.CheckNull(dbCommand);
  14. this._dbCommand = dbCommand;
  15. }
  16. /// <summary>
  17. /// SQL语句
  18. /// </summary>
  19. public string CommandText
  20. {
  21. get
  22. {
  23. return this._dbCommand.CommandText;
  24. }
  25. set
  26. {
  27. this._dbCommand.CommandText = value;
  28. }
  29. }
  30. /// <summary>
  31. /// 超时时间
  32. /// </summary>
  33. public int CommandTimeout
  34. {
  35. get
  36. {
  37. return this._dbCommand.CommandTimeout;
  38. }
  39. set
  40. {
  41. this._dbCommand.CommandTimeout = value;
  42. }
  43. }
  44. public CommandType CommandType
  45. {
  46. get
  47. {
  48. return this._dbCommand.CommandType;
  49. }
  50. set
  51. {
  52. this._dbCommand.CommandType = value;
  53. }
  54. }
  55. public IDbConnection Connection
  56. {
  57. get
  58. {
  59. return this._dbCommand.Connection;
  60. }
  61. set
  62. {
  63. this._dbCommand.Connection = value;
  64. }
  65. }
  66. public IDataParameterCollection Parameters
  67. {
  68. get
  69. {
  70. return this._dbCommand.Parameters;
  71. }
  72. }
  73. public IDbTransaction Transaction
  74. {
  75. get
  76. {
  77. return this._dbCommand.Transaction;
  78. }
  79. set
  80. {
  81. this._dbCommand.Transaction = value;
  82. }
  83. }
  84. public UpdateRowSource UpdatedRowSource
  85. {
  86. get
  87. {
  88. return this._dbCommand.UpdatedRowSource;
  89. }
  90. set
  91. {
  92. this._dbCommand.UpdatedRowSource = value;
  93. }
  94. }
  95. public void Cancel()
  96. {
  97. this._dbCommand.Cancel();
  98. }
  99. public IDbDataParameter CreateParameter()
  100. {
  101. return this._dbCommand.CreateParameter();
  102. }
  103. public int ExecuteNonQuery()
  104. {
  105. return this._dbCommand.ExecuteNonQuery();
  106. }
  107. public IDataReader ExecuteReader()
  108. {
  109. return new OracleDataReader(this._dbCommand.ExecuteReader());
  110. }
  111. public IDataReader ExecuteReader(CommandBehavior behavior)
  112. {
  113. return new OracleDataReader(this._dbCommand.ExecuteReader(behavior));
  114. }
  115. public object ExecuteScalar()
  116. {
  117. return this._dbCommand.ExecuteScalar();
  118. }
  119. public void Prepare()
  120. {
  121. this._dbCommand.Prepare();
  122. }
  123. public void Dispose()
  124. {
  125. this._dbCommand.Dispose();
  126. }
  127. }
  128. }