Examples of DatabaseMeta


Examples of org.pentaho.di.core.database.DatabaseMeta

      if (handler.isConfirmed() == false)
      {
        return null;
      }

      final DatabaseMeta database = (DatabaseMeta) handler.getData(); //$NON-NLS-1$
      if (database == null)
      {
        log.debug("DatabaseMeta is null");
        return null;
      }
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

    return noCommentSql;
  }
 
  public void execute(final String[] sql, final ExecutorCallback callback) throws DataAccessException {
    Exception exceptionDuringExecute = null;
    DatabaseMeta dbMeta = connectionModel.getDatabaseMeta();
    String url = null;
    try {
      url = dbMeta.getURL();
    } catch (KettleDatabaseException e) {
      throw new DataAccessException("DatabaseMeta problem", e) {
        private static final long serialVersionUID = -3457360074729938909L;
      };
    }
    // create the datasource
    DataSource ds = new SingleConnectionDataSource(dbMeta.getDriverClass(), url, dbMeta.getUsername(), dbMeta
        .getPassword(), false);

    // create the jdbc template
    final JdbcTemplate jt = new JdbcTemplate(ds);
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

  public DatabaseMeta getDatabaseMeta() {
    if (this.databaseMeta == null) {
      File file = new File(".databaseMetaInfo");
      if (file.exists()) {
        try {
          this.databaseMeta = new DatabaseMeta(getFileContents(file));
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    }
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

    return xstream.toXML(systemObjects);
  }
 
  public void deserializeConnection(Schema schema, String rdbmsXml, String schemaXml) {
    XStream xstream = getXStream(schema);
    DatabaseMeta databaseMeta = (DatabaseMeta)xstream.fromXML(rdbmsXml);
    SchemaModel schemaModel = (SchemaModel)xstream.fromXML(schemaXml);
   
    //save off cubeName since setSelectedSchemaModel will clear it out
    String cubeName = schemaModel.getCubeName();
   
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

    dataHandler.setData(connectionModel.getDatabaseMeta());

    XulDialog dialog = (XulDialog) document.getElementById(GENERAL_DATASOURCE_WINDOW);
    dialog.show();

    DatabaseMeta databaseMeta = (DatabaseMeta) dataHandler.getData();

    if (databaseMeta != null) {
      connectionModel.setDatabaseMeta(databaseMeta);
    }
  }
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

            }
            if (dbMeta != null) {
                return dbMeta;
            }
            if (xml == null) {
                dbMeta = new DatabaseMeta();
            } else {
                dbMeta = new DatabaseMeta(xml);
            }
        } catch (KettleException e) {
            throw new RuntimeException(
                    getResourceConverter()
                    .getFormattedString(
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

            }
            if (dbMeta != null) {
                return dbMeta;
            }
            if (xml == null) {
                dbMeta = new DatabaseMeta();
            } else {
                dbMeta = new DatabaseMeta(xml);
            }
        } catch (KettleException e) {
            throw new RuntimeException(
                    getResourceConverter()
                    .getFormattedString(
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

import com.thoughtworks.xstream.io.HierarchicalStreamWriter;

public class DatabaseMetaConverter implements Converter {

  public void marshal(Object arg0, HierarchicalStreamWriter writer, MarshallingContext arg2) {
    DatabaseMeta obj = (DatabaseMeta)arg0;
    writer.setValue(obj.getXML());
  }
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

    writer.setValue(obj.getXML());
  }

  public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext arg1) {
    try {
      return new DatabaseMeta(reader.getValue());
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
View Full Code Here

Examples of org.pentaho.di.core.database.DatabaseMeta

        try {
          while (dialog.isHidden()) {
            sleep(500);
          }
         
          DatabaseMeta dbMeta = connectionModel.getDatabaseMeta();
          final String mondrianConnectionUrl = MessageFormat.format(
              "Provider={0};Jdbc={1};JdbcUser={2};JdbcPassword={3};Catalog={4};JdbcDrivers={5}", "Mondrian", dbMeta.getURL(), dbMeta
                  .getUsername(), dbMeta.getPassword(), "file:" + getMondrianSchemaFilename(),
                  dbMeta.getDriverClass());
          Map<Parameter, Object> parameterValues = new HashMap<Parameter, Object>();

          parameterValues.put(mondrianSchemaLoader.getParameters().get(0), mondrianConnectionUrl);
          parameterValues.put(mondrianSchemaLoader.getParameters().get(1), cubeName);
         
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.