コード例 #1
0
ファイル: PhpSqlDbProcedure.cs プロジェクト: dw4dev/Phalanger
		/// <summary>
		/// Creates a stored procedure statement.
		/// </summary>
		/// <param name="connection">Database connection.</param>
		/// <param name="procedureName">Procedure name.</param>
		/// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
		public PhpSqlDbProcedure(PhpDbConnection/*!*/ connection, string/*!*/ procedureName)
			: base("mssql statement", connection)
		{
			if (procedureName == null)
				throw new ArgumentNullException("procedureName");

			this.procedureName = procedureName;
		}
コード例 #2
0
ファイル: PhpSqlDbProcedure.cs プロジェクト: jiahao42/weverca
        /// <summary>
        /// Creates a stored procedure statement.
        /// </summary>
        /// <param name="connection">Database connection.</param>
        /// <param name="procedureName">Procedure name.</param>
        /// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
        public PhpSqlDbProcedure(PhpDbConnection /*!*/ connection, string /*!*/ procedureName)
            : base("mssql statement", connection)
        {
            if (procedureName == null)
            {
                throw new ArgumentNullException("procedureName");
            }

            this.procedureName = procedureName;
        }
コード例 #3
0
        /// <summary>
        /// Creates an instance of parameterized statement.
        /// </summary>
        /// <param name="resourceName">Name of the resource.</param>
        /// <param name="connection">Database connection resource.</param>
        public PhpDbStatement(string /*!*/ resourceName, PhpDbConnection /*!*/ connection)
            : base(resourceName)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            this.connection = connection;
        }
コード例 #4
0
        public static int GetLastAffectedRows()
        {
            PhpDbConnection last_connection = GetManager().GetLastConnection();

            if (last_connection == null)
            {
                last_connection = (PhpDbConnection)Connect();
            }

            return(GetLastAffectedRows(last_connection));
        }
コード例 #5
0
        public static PhpResource Query(string query)
        {
            PhpDbConnection last_connection = GetManager().GetLastConnection();

            if (last_connection == null)
            {
                last_connection = (PhpDbConnection)Connect();
            }

            return(Query(query, last_connection));
        }
コード例 #6
0
        public static PhpResource CreateProcedure(string procedureName)
        {
            PhpDbConnection last_connection = GetManager().GetLastConnection();

            if (last_connection == null)
            {
                last_connection = (PhpDbConnection)Connect();
            }

            return(CreateProcedure(procedureName, last_connection));
        }
コード例 #7
0
        /// <summary>
        /// Removes specified connection from the list of active connections.
        /// </summary>
        /// <param name="connection">The connection to be removed.</param>
        public void RemoveConnection(PhpDbConnection /*!*/ connection)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            if (connections.Count > 0)
            {
                connections.Remove(connection);
                Interlocked.Decrement(ref AppConnectionCount);
            }
        }
コード例 #8
0
        public static bool SelectDb(string databaseName)
        {
            PhpDbConnection last_connection = GetManager().GetLastConnection();

            if (last_connection == null)
            {
                last_connection = (PhpDbConnection)Connect();
                if (last_connection == null)
                {
                    return(false);
                }
            }

            return(SelectDb(databaseName, last_connection));
        }
コード例 #9
0
ファイル: MsSql.cs プロジェクト: jiahao42/weverca
        public static bool Close()
        {
            PhpDbConnection last_connection = manager.GetLastConnection();

            if (last_connection == null)
            {
                return(false);
            }

            manager.RemoveConnection(last_connection);

            last_connection.Close();
            last_connection = null;
            return(true);
        }
コード例 #10
0
        /// <summary>
        /// Creates an instance of a result resource.
        /// </summary>
        /// <param name="connection">Database connection.</param>
        /// <param name="reader">Data reader from which to load results.</param>
        /// <param name="name">Resource name.</param>
        /// <param name="convertTypes">Whether to convert resulting values to PHP types.</param>
        /// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
        protected PhpDbResult(PhpDbConnection /*!*/ connection, IDataReader /*!*/ reader, string /*!*/ name, bool convertTypes)
            : base(name)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            this.reader     = reader;
            this.connection = connection;
            LoadData(convertTypes);
        }
コード例 #11
0
 /// <summary>
 /// Creates an instance of a result resource.
 /// </summary>
 /// <param name="connection">Database connection.</param>
 /// <param name="reader">Data reader from which to load results.</param>
 /// <param name="convertTypes">Whether to convert resulting values to PHP types.</param>
 /// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
 public PhpMyDbResult(PhpDbConnection/*!*/ connection, IDataReader/*!*/ reader, bool convertTypes)
     : base(connection, reader, "MySQL result", convertTypes)
 {
     // no code in here
 }
コード例 #12
0
ファイル: Result.cs プロジェクト: dw4dev/Phalanger
		internal void ReleaseConnection()
		{
			this.connection = null;
		}
コード例 #13
0
		/// <summary>
		/// Gets a query result resource.
		/// </summary>
		/// <param name="connection">Database connection.</param>
		/// <param name="reader">Data reader to be used for result resource population.</param>
		/// <param name="convertTypes">Whether to convert data types to PHP ones.</param>
		/// <returns>Result resource holding all resulting data of the query.</returns>
		protected override PhpDbResult/*!*/ GetResult(PhpDbConnection/*!*/ connection, IDataReader/*!*/ reader, bool convertTypes)
		{
			return new PhpSqlDbResult(connection, reader, convertTypes);
		}
コード例 #14
0
ファイル: ConnectionManager.cs プロジェクト: dw4dev/Phalanger
		/// <summary>
		/// Removes specified connection from the list of active connections.
		/// </summary>
		/// <param name="connection">The connection to be removed.</param>
		public void RemoveConnection(PhpDbConnection/*!*/ connection)
		{
			if (connection == null)
				throw new ArgumentNullException("connection");

			if (connections.Count > 0)
			{
				connections.Remove(connection);
				Interlocked.Decrement(ref AppConnectionCount);
			}
		}
コード例 #15
0
 internal void ReleaseConnection()
 {
     this.connection = null;
 }
コード例 #16
0
        //public new PhpMyDbConnection Connection => (PhpMyDbConnection)base.Connection;

        /// <summary>
        /// Creates an instance of a result resource.
        /// </summary>
        /// <param name="connection">Database connection.</param>
        /// <param name="reader">Data reader from which to load results.</param>
        /// <param name="convertTypes">Whether to convert resulting values to PHP types.</param>
        /// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
        public PhpMyDbResult(PhpDbConnection /*!*/ connection, IDataReader /*!*/ reader, bool convertTypes)
            : base(connection, reader, "MySQL result", convertTypes)
        {
            // no code in here
        }
コード例 #17
0
ファイル: Statement.cs プロジェクト: dw4dev/Phalanger
		/// <summary>
		/// Creates an instance of parameterized statement.
		/// </summary>
		/// <param name="resourceName">Name of the resource.</param>
		/// <param name="connection">Database connection resource.</param>
		public PhpDbStatement(string/*!*/ resourceName, PhpDbConnection/*!*/ connection)
			: base(resourceName)
		{
			if (connection == null)
				throw new ArgumentNullException("connection");

			this.connection = connection;
		}
コード例 #18
0
ファイル: Result.cs プロジェクト: dw4dev/Phalanger
		/// <summary>
		/// Creates an instance of a result resource.
		/// </summary>
		/// <param name="connection">Database connection.</param>
		/// <param name="reader">Data reader from which to load results.</param>
		/// <param name="name">Resource name.</param>
		/// <param name="convertTypes">Whether to convert resulting values to PHP types.</param>
		/// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
		protected PhpDbResult(PhpDbConnection/*!*/ connection, IDataReader/*!*/ reader, string/*!*/ name, bool convertTypes)
			: base(name)
		{
			if (connection == null)
				throw new ArgumentNullException("connection");

			if (reader == null)
				throw new ArgumentNullException("reader");

			this.reader = reader;
			this.connection = connection;
			LoadData(convertTypes);
		}
コード例 #19
0
ファイル: PDOConnection.cs プロジェクト: hansdude/Phalanger
 protected override PhpDbResult GetResult(PhpDbConnection connection, IDataReader reader, bool convertTypes)
 {
     throw new NotImplementedException();
 }
コード例 #20
0
ファイル: Connection.cs プロジェクト: dw4dev/Phalanger
		/// <summary>
		/// Gets a query result resource.
		/// </summary>
		/// <param name="connection">Database connection.</param>
		/// <param name="reader">Data reader to be used for result resource population.</param>
		/// <param name="convertTypes">Whether to convert data types to PHP ones.</param>
		/// <returns>Result resource holding all resulting data of the query.</returns>
		protected abstract PhpDbResult GetResult(PhpDbConnection/*!*/ connection, IDataReader/*!*/ reader, bool convertTypes);
コード例 #21
0
 protected override PhpDbResult GetResult(PhpDbConnection connection, IDataReader reader, bool convertTypes)
 {
     throw new NotImplementedException();
 }
コード例 #22
0
 /// <summary>
 /// Gets a query result resource.
 /// </summary>
 /// <param name="connection">Database connection.</param>
 /// <param name="reader">Data reader to be used for result resource population.</param>
 /// <param name="convertTypes">Whether to convert data types to PHP ones.</param>
 /// <returns>Result resource holding all resulting data of the query.</returns>
 protected override PhpDbResult /*!*/ GetResult(PhpDbConnection /*!*/ connection, IDataReader /*!*/ reader, bool convertTypes)
 {
     return(new PhpSqlDbResult(connection, reader, convertTypes));
 }
コード例 #23
0
 /// <summary>
 /// Gets a query result resource.
 /// </summary>
 /// <param name="connection">Database connection.</param>
 /// <param name="reader">Data reader to be used for result resource population.</param>
 /// <param name="convertTypes">Whether to convert data types to PHP ones.</param>
 /// <returns>Result resource holding all resulting data of the query.</returns>
 protected abstract PhpDbResult GetResult(PhpDbConnection /*!*/ connection, IDataReader /*!*/ reader, bool convertTypes);