Examples of JDBCDataStore


Examples of org.eobjects.analyzer.connection.JdbcDatastore

  public void close() {
    SqlDatabaseUtils.safeClose(null, _insertStatement);

    DatastoreOutputWriterFactory.release(this);

    Datastore datastore = new JdbcDatastore(_datastoreName, _jdbcUrl, DRIVER_CLASS_NAME, "SA", "");
    _datastoreCreationDelegate.createDatastore(datastore);
  }
View Full Code Here

Examples of org.eobjects.analyzer.connection.JdbcDatastore

  }

  protected static String getDatastoreImagePath(Datastore datastore) {
    String imagePath = GENERIC_DATASTORE_IMAGEPATH;
    if (datastore instanceof JdbcDatastore) {
      JdbcDatastore jdbcDatastore = (JdbcDatastore) datastore;
      if ("jdbc:hsqldb:res:orderdb;readonly=true".equals(jdbcDatastore.getJdbcUrl())) {
        imagePath = "images/datastore-types/orderdb.png";
      } else {
        String driverClass = jdbcDatastore.getDriverClass();
        if (!StringUtils.isNullOrEmpty(driverClass)) {
          DatabaseDriverDescriptor driver = DatabaseDriverCatalog.getDatabaseDriverByDriverClassName(driverClass);
          if (driver != null) {
            imagePath = driver.getIconImagePath();
          }
View Full Code Here

Examples of org.eobjects.analyzer.connection.JdbcDatastore

      return datastore.getDescription();
    }
    if (datastore instanceof FileDatastore) {
      return ((FileDatastore) datastore).getFilename();
    } else if (datastore instanceof JdbcDatastore) {
      JdbcDatastore jdbcDatastore = (JdbcDatastore) datastore;
      String jdbcUrl = jdbcDatastore.getJdbcUrl();
      String datasourceJndiUrl = jdbcDatastore.getDatasourceJndiUrl();
      if (StringUtils.isNullOrEmpty(datasourceJndiUrl)) {
        return jdbcUrl;
      }
      return datasourceJndiUrl;
    } else if (datastore instanceof CompositeDatastore) {
View Full Code Here

Examples of org.eobjects.analyzer.connection.JdbcDatastore

    final JButton testButton = WidgetFactory.createButton("Test connection", "images/actions/refresh.png");
    testButton.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent event) {
        JdbcDatastore datastore = createDatastore();
        try {
          Connection connection = datastore.createConnection();
          connection.close();
          JOptionPane.showMessageDialog(JdbcDatastoreDialog.this, "Connection successful!");
        } catch (Throwable e) {
          WidgetUtils.showErrorMessage("Could not establish connection", e);
        }
      }
    });

    final JButton saveButton = WidgetFactory.createButton("Save datastore", "images/model/datastore.png");
    saveButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        JdbcDatastore datastore = createDatastore();

        if (_originalDatastore != null) {
          _catalog.removeDatastore(_originalDatastore);
        }
        _catalog.addDatastore(datastore);
View Full Code Here

Examples of org.eobjects.analyzer.connection.JdbcDatastore

      throw new IllegalStateException("No datastore name");
    }

    final String driverClass = _driverClassNameTextField.getText();

    JdbcDatastore datastore = new JdbcDatastore(datastoreName, _connectionStringTextField.getText(), driverClass,
        _usernameTextField.getText(), new String(_passwordField.getPassword()));

    return datastore;
  }
View Full Code Here

Examples of org.geotools.data.jdbc.JDBCDataStore

    DataStore store = DataStoreFinder.getDataStore(parameters);
    if (store instanceof PostgisDataStore) {
      PostgisDataStore jdbcStore = (PostgisDataStore) store;
      jdbcStore.setFIDMapperFactory(new NonTypedPostgisFidMapperFactory(false));
    } else if (store instanceof JDBCDataStore) {
      JDBCDataStore jdbcStore = (JDBCDataStore) store;
      jdbcStore.setFIDMapperFactory(new NonTypedFidMapperFactory());
    }
    if (store == null) {
      StringBuilder availableStr = new StringBuilder();
      StringBuilder missingStr = new StringBuilder();
      Iterator<DataStoreFactorySpi> all = DataStoreFinder.getAllDataStores();
View Full Code Here

Examples of org.geotools.jdbc.JDBCDataStore

    }
    if (adaptee.isAssignableFrom(IGeoResource.class)) {
      return adaptee.cast(this);
    }

    JDBCDataStore dataStore = parent.getDataStore();
    if (adaptee.isAssignableFrom(DataStore.class)) {
      return adaptee.cast(dataStore);
    }
    if (adaptee.isAssignableFrom(SimpleFeatureStore.class)) {
      FeatureSource<SimpleFeatureType, SimpleFeature> fs = dataStore
          .getFeatureSource(typename);
      if (fs instanceof FeatureStore) {
        readOnly = false;
        return adaptee.cast(fs);
      } else {
        readOnly = true;
      }
      if (adaptee.isAssignableFrom(SimpleFeatureSource.class)) {
        return adaptee.cast(dataStore.getFeatureSource(typename));
      }
    }
    if (adaptee.isAssignableFrom(Connection.class)) {
      return service.resolve(adaptee, monitor);
    }
View Full Code Here

Examples of org.geotools.jdbc.JDBCDataStore

    @Override
    public List<DB2GeoResource> resources( IProgressMonitor monitor ) throws IOException {

        if (members == null) {
            JDBCDataStore ds = getDataStore(monitor);
            if (ds == null)
                return null;

            rLock.lock();
            try {
                if (members == null) {
                    members = new ArrayList<DB2GeoResource>();

                    String[] names = ds.getTypeNames();
                    if (names == null)
                        return members;

                    for( int i = 0; i < names.length; i++ ) {
                        members.add(new DB2GeoResource(this, names[i]));
View Full Code Here

Examples of org.geotools.jdbc.JDBCDataStore

    public DB2ServiceInfo getInfo( IProgressMonitor monitor ) throws IOException {
        return (DB2ServiceInfo) super.getInfo(monitor);
    }
    @Override
    protected DB2ServiceInfo createInfo( IProgressMonitor monitor ) throws IOException {
        JDBCDataStore ds = getDataStore(monitor);
        if (ds == null) {
            return null; // could not connect
        }
        rLock.lock();
        try {
View Full Code Here

Examples of org.geotools.jdbc.JDBCDataStore

    /*
     * @see org.locationtech.udig.catalog.IResolve#members(org.eclipse.core.runtime.IProgressMonitor)
     */
    public List<MySQLGeoResource> resources( IProgressMonitor monitor ) throws IOException {

        JDBCDataStore ds = getDS();
        rLock.lock();
        try {
            if (members == null) {
                members = new LinkedList<MySQLGeoResource>();
                String[] typenames = ds.getTypeNames();
                if (typenames != null)
                    for( int i = 0; i < typenames.length; i++ ) {
                        members.add(new MySQLGeoResource(this, typenames[i]));
                    }
            }
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.