Package org.pentaho.database.model

Examples of org.pentaho.database.model.IDatabaseConnection


      setEnabled(isConnectionSelected());
    }

    public void actionPerformed(final ActionEvent e)
    {
      final IDatabaseConnection existingConnection = (IDatabaseConnection) dataSourceList.getSelectedValue();

      try
      {
        final Window parentWindow = LibSwingUtil.getWindowAncestor(ConnectionEditorPanel.this);
        final XulDatabaseDialog connectionDialog = new XulDatabaseDialog(parentWindow);
        final IDatabaseConnection connectionDefinition = connectionDialog.open(existingConnection);

        // See if the edit completed...
        if (connectionDefinition != null)
        {
          dialogModel.updateDatasourceById(existingConnection.getId(), connectionDefinition);
View Full Code Here


      setEnabled(isConnectionSelected());
    }

    public void actionPerformed(final ActionEvent e)
    {
      final IDatabaseConnection source = (IDatabaseConnection) dataSourceList.getSelectedValue();
      if (source != null)
      {
        dialogModel.deleteDatasourceById(source.getId());
        dataSourceModel.removeElement(source);
      }
    }
View Full Code Here

    {
      try
      {
        final Window parentWindow = LibSwingUtil.getWindowAncestor(ConnectionEditorPanel.this);
        final XulDatabaseDialog connectionDialog = new XulDatabaseDialog(parentWindow);
        final IDatabaseConnection connectionDefinition = connectionDialog.open(null);

        if (connectionDefinition != null &&
            !StringUtils.isEmpty(connectionDefinition.getName()))
        {
          // A new JNDI source was created
          dialogModel.createDatasource(connectionDefinition);
          dataSourceModel.addElement(connectionDefinition);
          dataSourceList.setSelectedValue(connectionDefinition, true);
View Full Code Here

    {
      final DataSourceMgmtService datasourceMgmtSvc =
          ClassicEngineBoot.getInstance().getObjectFactory().get(DataSourceMgmtService.class);
      try
      {
        final IDatabaseConnection databaseConnection = datasourceMgmtSvc.getDatasourceByName(datasource);
        return PooledDatasourceHelper.setupPooledDataSource(databaseConnection);
      }
      catch(DatasourceMgmtServiceException daoe)
      {
        return queryFallback(datasource);
View Full Code Here

    final SerializedConnection connection = connectionsById.get(id);
    if (connection == null)
    {
      throw new NonExistingDatasourceException();
    }
    final IDatabaseConnection databaseConnection = connection.getConnection();
    connectionsByName.remove(databaseConnection.getName());
    connectionsById.remove(databaseConnection.getId());

    writeChanges();
  }
View Full Code Here

    editedMembers.remove(id);
  }

  public IDatabaseConnection getDatasourceByName(final String name) throws DatasourceMgmtServiceException
  {
    final IDatabaseConnection dataSource = parent.getDatasourceByName(name);
    if (deletedMembersById.contains(dataSource.getId()))
    {
      throw new NonExistingDatasourceException();
    }
    return dataSource;
  }
View Full Code Here

  {
    final ArrayList<IDatabaseConnection> connection = new ArrayList<IDatabaseConnection>(parent.getDatasources());
    final Iterator<IDatabaseConnection> it = connection.iterator();
    while (it.hasNext())
    {
      final IDatabaseConnection databaseConnection = it.next();
      if (deletedMembersById.contains(databaseConnection.getId()))
      {
        it.remove();
      }
    }
    return connection;
View Full Code Here

  {
    final List<IDatabaseConnection> datasources = getDatasources();
    final List<String> list = new ArrayList<String>();
    for (int i = 0; i < datasources.size(); i++)
    {
      final IDatabaseConnection connection = datasources.get(i);
      list.add(connection.getId());
    }
    return list;
  }
View Full Code Here

    }

    final Set<String> datasourceIds = new HashSet<String>(parent.getDatasourceIds());
    for (final SerializedConnection c : editedMembers.values())
    {
      final IDatabaseConnection connection = c.getConnection();
      if (datasourceIds.contains(connection.getId()))
      {
        parent.updateDatasourceById(connection.getId(), connection);
      }
      else
      {
        parent.createDatasource(connection);
      }
View Full Code Here

    rootList.addNamespaceDeclaration(null, ConnectionModule.NAMESPACE);

    writer.writeTag(ConnectionModule.NAMESPACE, "connections", rootList, XmlWriter.OPEN);
    for (int i = 0; i < connections.length; i++)
    {
      final IDatabaseConnection connection = connections[i];
      write(connection, writer);
    }
    writer.writeCloseTag();
    writer.flush();
  }
View Full Code Here

TOP

Related Classes of org.pentaho.database.model.IDatabaseConnection

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.