GeoTools : ArcSDE snippets

Sample direct usage:

Simple example for connecting to an ArcSDE data source. This example was tested on Oracle8i.

private DataStore store = null;
private FeatureSource source = null;
private FeatureResults fsShape = null;
private FeatureType ft = null;

// ...

// Example parameters for the DB connection
HashMap params = new HashMap();
params.put("dbtype", "arcsde");
params.put("server", "a_database_server");
params.put("port", "a_port_number");
params.put("database", "");  // this was OK as blank in my example
params.put("user", "a_user");
params.put("password", "a_password");

String tableName = "SCHEMA.TABLE_NAME";

ArcSDEDataStoreFactory factory = new ArcSDEDataStoreFactory();
store = (DataStore) factory.createDataStore(params);
source = store.getFeatureSource(tableName);
fsShape = source.getFeatures();
featureCount = fsShape.getCount();
ft = source.getSchema();

Requires several gt/JTS jar files on the classpath, probably...
jsde_sdk-9.0.jar
jsde_jpe_sdk-9.0.jar
gt2-arcsde.jar
units-0.01.jar
geoapi-2.0.jar
JTS-1.6.jar
gt2-main.jar

Plus relevant drivers for Oracle JDBC connection.