Package org.geotools.arcsde.session

Examples of org.geotools.arcsde.session.ISessionPool


     */
    List<String> getRasterColumns(final String server, final String port, final String instance,
            final String user, final String password, final ISessionPoolFactory sessionFac)
            throws IllegalArgumentException {

        final ISessionPool pool;
        {
            final ArcSDEConnectionConfig connectionConfig;
            Map<String, Serializable> params = new HashMap<String, Serializable>();
            params.put(SERVER_NAME_PARAM_NAME, server);
            params.put(PORT_NUMBER_PARAM_NAME, port);
            params.put(INSTANCE_NAME_PARAM_NAME, instance);
            params.put(USER_NAME_PARAM_NAME, user);
            params.put(PASSWORD_PARAM_NAME, password);
            params.put(MIN_CONNECTIONS_PARAM_NAME, "1");
            params.put(MAX_CONNECTIONS_PARAM_NAME, "1");
            params.put(CONNECTION_TIMEOUT_PARAM_NAME, "1000");
            connectionConfig = ArcSDEConnectionConfig.fromMap(params);
            try {
                pool = sessionFac.createPool(connectionConfig);
            } catch (IOException e) {
                throw new IllegalArgumentException(e.getMessage());
            }
        }

        ISession session;
        try {
            session = pool.getSession();
        } catch (IOException e) {
            throw new IllegalAccessError(e.getMessage());
        } catch (UnavailableConnectionException e) {
            throw new IllegalAccessError(e.getMessage());
        }

        final List<String> rasterTables;
        try {
            rasterTables = session.getRasterColumns();
        } catch (IOException e) {
            throw new IllegalArgumentException(e.getMessage());
        } finally {
            session.dispose();
            pool.close();
        }

        return rasterTables;
    }
View Full Code Here


     */
    List<String> getRasterColumns(final String server, final String port, final String instance,
            final String user, final String password, final ISessionPoolFactory sessionFac)
            throws IllegalArgumentException {

        final ISessionPool pool;
        {
            final ArcSDEConnectionConfig connectionConfig;
            Map<String, Serializable> params = new HashMap<String, Serializable>();
            params.put(SERVER_NAME_PARAM_NAME, server);
            params.put(PORT_NUMBER_PARAM_NAME, port);
            params.put(INSTANCE_NAME_PARAM_NAME, instance);
            params.put(USER_NAME_PARAM_NAME, user);
            params.put(PASSWORD_PARAM_NAME, password);
            params.put(MIN_CONNECTIONS_PARAM_NAME, "1");
            params.put(MAX_CONNECTIONS_PARAM_NAME, "1");
            params.put(CONNECTION_TIMEOUT_PARAM_NAME, "1000");
            connectionConfig = ArcSDEConnectionConfig.fromMap(params);
            try {
                pool = sessionFac.createPool(connectionConfig);
            } catch (IOException e) {
                throw new IllegalArgumentException(e.getMessage());
            }
        }

        ISession session;
        try {
            session = pool.getSession();
        } catch (IOException e) {
            throw new IllegalAccessError(e.getMessage());
        } catch (UnavailableConnectionException e) {
            throw new IllegalAccessError(e.getMessage());
        }

        final List<String> rasterTables;
        try {
            rasterTables = session.getRasterColumns();
        } catch (IOException e) {
            throw new IllegalArgumentException(e.getMessage());
        } finally {
            session.dispose();
            pool.close();
        }

        return rasterTables;
    }
View Full Code Here

                "FAKE.TABLE3");

        tableChooserPanel.setSessionFactory(new ISessionPoolFactory() {

            public ISessionPool createPool(final ArcSDEConnectionConfig config) throws IOException {
                return new ISessionPool() {
                    public ISession getSession() throws IOException, UnavailableConnectionException {
                        return getSession(true);
                    }
                    public ISession getSession(final boolean transactional) throws IOException, UnavailableConnectionException {
                        return new SessionWrapper(null) {
View Full Code Here

TOP

Related Classes of org.geotools.arcsde.session.ISessionPool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.