コード例 #1
0
            /// <summary>
            /// Retrieves an embedded session using the given properties.
            /// </summary>
            /// <param name="properties">The properties.</param>
            /// <returns>an embedded session</returns>
            internal static HsqlSession NewEmbeddedSession(
                HsqlProperties properties)
            {
                if (properties == null)
                {
                    throw new ArgumentNullException("properties");
                }

                TranslateProperties(properties);

                string user     = properties.getProperty("user");
                string password = properties.getProperty("password");
                string scheme   = properties.getProperty("connection_type");
                string path     = properties.getProperty("database");

                try
                {
                    ISession session = org.hsqldb.DatabaseManager.newSession(
                        scheme,
                        path,
                        user,
                        password,
                        properties);

                    return(new HsqlSession(session));
                }
                catch (org.hsqldb.HsqlException e)
                {
                    throw new HsqlDataSourceException(e);
                }
            }
コード例 #2
0
ファイル: HsqlSession.cs プロジェクト: svn2github/hsqldb
        /// <summary>
        /// Constructs a new <c>HsqlSession</c>
        /// instance that delegates to the given
        /// interface implementation.
        /// </summary>
        /// <param name="session">
        /// The interface implementation to which to delegate.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// When <c>session</c> is <c>null</c>.
        /// </exception>
        internal HsqlSession(ISession session)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            m_session = session;

            if (session is EmbeddedSession)
            {
                m_serverVersion = s_embeddedServerVersion;
            }
        }
コード例 #3
0
        /// <summary>
        /// Constructs a new <c>HsqlSession</c>
        /// instance that delegates to the given 
        /// interface implementation.
        /// </summary>
        /// <param name="session">
        /// The interface implementation to which to delegate.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// When <c>session</c> is <c>null</c>.
        /// </exception>
        internal HsqlSession(ISession session)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            m_session = session;

            if (session is EmbeddedSession)
            {
                m_serverVersion = s_embeddedServerVersion;
            }
        }