Class ConnectionEnv


  • class ConnectionEnv
    extends java.lang.Object
    To enable multi-user use of ij.Main2
    • Field Detail

      • sessions

        java.util.Hashtable<java.lang.String,​Session> sessions
      • currSession

        private Session currSession
      • tag

        private java.lang.String tag
      • only

        private boolean only
      • CONNECTION_PROPERTY

        private static final java.lang.String CONNECTION_PROPERTY
        See Also:
        Constant Field Values
      • protocol

        private java.lang.String protocol
    • Constructor Detail

      • ConnectionEnv

        ConnectionEnv​(int userNumber,
                      boolean printUserNumber,
                      boolean theOnly)
    • Method Detail

      • init

        void init​(LocalizedOutput out)
           throws java.sql.SQLException,
                  java.lang.ClassNotFoundException,
                  java.lang.InstantiationException,
                  java.lang.IllegalAccessException,
                  java.lang.NoSuchMethodException,
                  java.lang.reflect.InvocationTargetException
        separate from the constructor so that connection failure does not prevent object creation.
        Throws:
        java.sql.SQLException
        java.lang.ClassNotFoundException
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        java.lang.NoSuchMethodException
        java.lang.reflect.InvocationTargetException
      • getConnection

        java.sql.Connection getConnection()
      • addSession

        void addSession​(java.sql.Connection conn,
                        java.lang.String name)
        Making a new connection, add it to the pool, and make it current.
      • getUniqueConnectionName

        public java.lang.String getUniqueConnectionName()
      • getSessions

        java.util.Hashtable<java.lang.String,​Session> getSessions()
      • getSession

        Session getSession​(java.lang.String name)
      • setCurrentSession

        Session setCurrentSession​(java.lang.String name)
      • haveSession

        boolean haveSession​(java.lang.String name)
      • removeCurrentSession

        void removeCurrentSession()
                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • removeSession

        void removeSession​(java.lang.String name)
                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • removeAllSessions

        void removeAllSessions()
                        throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • installConnection

        private void installConnection​(java.lang.String name,
                                       java.lang.String value,
                                       LocalizedOutput out)
                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException