Examples of ArcSDEDataStore


Examples of org.geotools.arcsde.data.ArcSDEDataStore

        ArcSDEDataStoreConfig dsConfig = service.getDataStoreConfig();
        String namespaceUri = dsConfig.getNamespaceUri();
        String versionName = dsConfig.getVersion();
        boolean allowNonSpatialTables = dsConfig.isAllowNonSpatialTables();
        ArcSDEDataStore ds = new ArcSDEDataStore(sessionPool, namespaceUri, versionName,
                allowNonSpatialTables);
        return ds;
    }
View Full Code Here

Examples of org.geotools.arcsde.data.ArcSDEDataStore

            throws java.io.IOException {
        if (JSDE_CLIENT_VERSION == JSDE_VERSION_DUMMY) {
            throw new DataSourceException("Can't connect to ArcSDE with the dummy jar.");
        }

        ArcSDEDataStore sdeDStore = null;
        ArcSDEDataStoreConfig config = new ArcSDEDataStoreConfig(params);
        sdeDStore = createDataStore(config);

        ViewRegisteringFactoryHelper.registerSqlViews(sdeDStore, params);
View Full Code Here

Examples of org.geotools.arcsde.data.ArcSDEDataStore

        return createDataStore(config, connPool);
    }

    final ArcSDEDataStore createDataStore(ArcSDEDataStoreConfig config, final ISessionPool connPool)
            throws IOException {
        ArcSDEDataStore sdeDStore;
        ISession session;
        try {
            session = connPool.getSession(false);
        } catch (UnavailableConnectionException e) {
            throw new RuntimeException(e);
        }
        try {
            // check to see if our sdk is compatible with this arcsde instance
            SeRelease releaseInfo = session.getRelease();
            int majVer = releaseInfo.getMajor();
            int minVer = releaseInfo.getMinor();

            if (majVer == 9 && minVer > 1 && JSDE_CLIENT_VERSION < JSDE_VERSION_91) {
                // we can't connect to ArcSDE 9.2 with the arcsde 9.0 jars. It
                // just won't
                // work when trying to draw maps. Oh well, at least we'll warn
                // people.
                LOGGER.severe("\n\n**************************\n"
                        + "DANGER DANGER DANGER!!!  You're using the ArcSDE 9.0 (or earlier) jars with "
                        + "ArcSDE "
                        + majVer
                        + "."
                        + minVer
                        + " on host '"
                        + config.getServerName()
                        + "' .  "
                        + "This PROBABLY WON'T WORK.  If you have issues "
                        + "or unexplained exceptions when rendering maps, upgrade your ArcSDE jars to version "
                        + "9.2 or higher.  See http://docs.codehaus.org/display/GEOTOOLS/ArcSDE+Plugin\n"
                        + "**************************\n\n");
            }

            // if a version was specified, verify it exists
            final String versionName = config.getVersion();
            if (versionName != null && !("".equals(versionName.trim()))) {
                session.issue(new Commands.GetVersionCommand(versionName));
            }
        } finally {
            session.dispose();
        }

        String namespaceUri = config.getNamespaceUri();
        if (namespaceUri != null && "".equals(namespaceUri.trim())) {
            namespaceUri = null;
        }
        String versionName = config.getVersion();
        if (versionName != null && "".equals(versionName.trim())) {
            versionName = null;
        }
        boolean allowNonSpatialTables = config.isAllowNonSpatialTables();
        /**
         * Multiple GeoDB Patch
         *
         * check if directconnect string has a schema Multiple GeoDB Syntax: Oracle 10g user's
         * schema geodatabase <schema_name> is the name of the schema that owns the geodatabase.
         * sde:oracle10g:/:<schema_name>
         *
         * Default single GeoDB Syntax: sde:oracle10g or in MultipleGeoDB Notation:
         * sde:oracle10g:/:sde
         *
         * for further infos look at
         * http://webhelp.esri.com/arcgisserver/9.3/java/geodatabases/arcsde-2034353163.htm
         */
        final String port = config.getPortNumber();

        final String[] directConnectParts = port.split(":");
        final int length = directConnectParts.length;
        final int multiGeoDB = 4;

        if (length == multiGeoDB) {
            final int multiGeoDBIndex = port.lastIndexOf(":");
            final String user_schema = port.substring(multiGeoDBIndex + 1);

            versionName = user_schema + ".DEFAULT";

        }
        sdeDStore = new ArcSDEDataStore(connPool, namespaceUri, versionName, allowNonSpatialTables);
        return sdeDStore;
    }
View Full Code Here

Examples of org.geotools.arcsde.data.ArcSDEDataStore

        final ArcSDEConnectionConfig connectionConfig = sessionPool.getConfig();
        final ArcSDEDataStoreConfig dsConfig;
        dsConfig = new ArcSDEDataStoreConfig(connectionConfig, nsUri, version, nonSpatial);

        LOGGER.info("Creating ArcSDE JNDI DataStore with shared session pool for " + dsConfig);
        final ArcSDEDataStore dataStore = delegateFactory.createDataStore(dsConfig, sessionPool);

        return dataStore;
    }
View Full Code Here

Examples of org.geotools.arcsde.data.ArcSDEDataStore

            assertNotNull(initialContext.lookup(jndiRef));
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }

        ArcSDEDataStore dataStore = (ArcSDEDataStore) factory.createDataStore(params);
        assertNotNull(dataStore);
        ISession session = dataStore.getSession(Transaction.AUTO_COMMIT);
        assertNotNull(session);
        try {
            assertEquals(String.valueOf(config.get("user")).toUpperCase(), session.getUser()
                    .toUpperCase());
        } finally {
View Full Code Here

Examples of org.geotools.arcsde.data.ArcSDEDataStore

            assertNotNull(initialContext.lookup(jndiRef));
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }

        ArcSDEDataStore dataStore = (ArcSDEDataStore) factory.createDataStore(params);
        assertNotNull(dataStore);
        ISession session = dataStore.getSession(Transaction.AUTO_COMMIT);
        assertNotNull(session);
        session.dispose();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.