Examples of DataSource


Examples of jimm.datavision.source.DataSource

    final TreeSet tables = new TreeSet(nameComparator);
    final TreeSet noTableCols = new TreeSet(nameComparator);

    // Walk data source's list of tables. If there are no tables for the
    // data source, then instead add all columns to the noTableCols set.
    DataSource source = report.getDataSource();
    Iterator iter = source.tables();
    if (iter != null) {
  while (iter.hasNext())
      tables.add(iter.next());
    }

    if (tables.isEmpty()) {
  for (iter = source.columns(); iter.hasNext(); )
      noTableCols.add(iter.next());
    }

    // Add nodes for tables and columns under tables
    for (iter = tables.iterator(); iter.hasNext(); )
View Full Code Here

Examples of jimm.datavision.source.DataSource

    boolean someFieldSelected = numSelected > 0;
    boolean multipleFieldsSelected = numSelected > 1;
    FieldWidget first = someFieldSelected ? (FieldWidget)selectedFields.get(0)
  : null;

    DataSource ds = report.getDataSource();

    // Edit menu
    Section s = (first == null) ? null : first.getSectionWidget().getSection();

    cutItem.setEnabled(someFieldSelected);
    copyItem.setEnabled(someFieldSelected);
    pasteItem.setEnabled(!Clipboard.instance().isEmpty());
    delSelectionItem.setEnabled(someFieldSelected);
    delGroupItem.setEnabled(someFieldSelected && report.isInsideGroup(s));
    delSectionItem.setEnabled(someFieldSelected && !report.isOneOfAKind(s));

    // Insert menu
    if (numSelected == 1) {  // One field is selected
  // Only enable aggregates if the selected field is a field
  // for which aggregates make sense.
  aggrItem.setEnabled(first.getField().canBeAggregated());
    }
    else
  aggrItem.setEnabled(false);
    sectItem.setEnabled(someFieldSelected);
    subreportItem.setEnabled(ds.canJoinTables());

    // Format menu
    if (someFieldSelected) {
  // Only enable if some field is formattable
  boolean enable = someSelectedFieldUsesFormat();
  formatItem.setEnabled(enable);
    }
    else
  formatItem.setEnabled(false);
    borderItem.setEnabled(someFieldSelected);
    boundsItem.setEnabled(someFieldSelected);
    alignSubmenu.setEnabled(multipleFieldsSelected);
    sizeSubmenu.setEnabled(multipleFieldsSelected);

    // Database menu
    tableJoinItem.setEnabled(ds.canJoinTables());
    sqlQueryTextItem.setEnabled(ds.isSQLGenerated());
    connectionItem.setEnabled(ds.isConnectionEditable());

    // Report menu
    runItem.setEnabled(ds.canRunReports());
    exportItem.setEnabled(ds.canRunReports());
    selectRecordsItem.setEnabled(ds.areRecordsSelectable());
    sortByItem.setEnabled(ds.areRecordsSortable());
    groupByItem.setEnabled(ds.canGroupRecords());
}
View Full Code Here

Examples of net.dataforte.cassandra.pool.DataSource

   public void start() throws CacheLoaderException {

      try {
         if (!config.autoCreateKeyspace)
            config.poolProperties.setKeySpace(config.keySpace);
         dataSource = new DataSource(config.getPoolProperties());
         readConsistencyLevel = ConsistencyLevel.valueOf(config.readConsistencyLevel);
         writeConsistencyLevel = ConsistencyLevel.valueOf(config.writeConsistencyLevel);
         entryColumnPath = new ColumnPath(config.entryColumnFamily).setColumn(ENTRY_COLUMN_NAME
                  .getBytes(UTF8Charset));
         entryColumnParent = new ColumnParent(config.entryColumnFamily);
View Full Code Here

Examples of net.sf.hajdbc.sql.DataSource

    config.setDatabaseMetaDataCacheFactory(new SimpleDatabaseMetaDataCacheFactory());
    config.setStateManagerFactory(factory);
//    config.setDispatcherFactory(new JGroupsCommandDispatcherFactory());
    config.setDurabilityFactory(new FineDurabilityFactory());

    DataSource ds = new DataSource();
    ds.setCluster("cluster");
    ds.setConfigurationFactory(new SimpleDatabaseClusterConfigurationFactory<javax.sql.DataSource, DataSourceDatabase>(config));
   
    InvocationHandler<javax.sql.DataSource, DataSourceDatabase, javax.sql.DataSource, SQLException, ProxyFactory<javax.sql.DataSource, DataSourceDatabase, javax.sql.DataSource, SQLException>> handler = (InvocationHandler<javax.sql.DataSource, DataSourceDatabase, javax.sql.DataSource, SQLException, ProxyFactory<javax.sql.DataSource, DataSourceDatabase, javax.sql.DataSource, SQLException>>) Proxy.getInvocationHandler(ds.getProxy());
    ProxyFactory<javax.sql.DataSource, DataSourceDatabase, javax.sql.DataSource, SQLException> proxyFactory = handler.getProxyFactory();

    try
    {
      Connection c1 = proxyFactory.get(db1).getConnection();
      try
      {
        createTable(c1);
       
        try
        {
          Connection c2 = proxyFactory.get(db2).getConnection();
          try
          {
            createTable(c2);
           
            try
            {
              Connection c = ds.getConnection();
              try
              {
                c.setAutoCommit(false);
                PreparedStatement ps = c.prepareStatement("INSERT INTO test (id, name) VALUES (?, ?)");
                try
                {
                  ps.setInt(1, 1);
                  ps.setString(2, "1");
                  ps.addBatch();
                  ps.setInt(1, 2);
                  ps.setString(2, "2");
                  ps.addBatch();
                  ps.executeBatch();
                }
                finally
                {
                  Resources.close(ps);
                }
                c.commit();
               
                validate(c1);
                validate(c2);
              }
              finally
              {
                Resources.close(c);
              }
            }
            finally
            {
              dropTable(c2);
            }
          }
          finally
          {
            c2.close();
          }
        }
        finally
        {
          dropTable(c1);
        }
      }
      finally
      {
        c1.close();
      }
    }
    finally
    {
      ds.stop();
    }
  }
View Full Code Here

Examples of nexj.core.meta.persistence.DataSource

         DataLoader loader = new DataLoader(m_context);
        
         for (Iterator itr = loader.getDataSourceIterator(getDataSourceSet()); itr.hasNext();)
         {
            DataSource ds = (DataSource)itr.next();
            SchemaVersion version = loader.getSchemaVersion(ds);

            if (version != null)
            {
               printVersion(version.getNamespace(), version.getVersion());
View Full Code Here

Examples of nz.govt.natlib.fx.DataSource

    return "2.0";
  }

  public void adapt(File file, ParserContext ctx) throws IOException {
    // add the MetaData to the tree!
    DataSource ftk = null;
   
    try {
      ftk = new FileDataSource(file);
     
      ctx.fireStartParseEvent("WAV");
      writeFileInfo(file, ctx);
 
      ctx.fireStartParseEvent("RIFF");
 
      // move 4 bytes in (for the RIFF tag)
      ftk.setPosition(4);
      riffElement.read(ftk, ctx);
 
      ctx.fireEndParseEvent("RIFF");
 
      // 1. is there a chunk to be read...
      long chunkSize = 12;
      long riffHeaderLength = ctx.getIntAttribute("WAV.RIFF.length");
      while (chunkSize < riffHeaderLength) {
        // 2. read the chunk...
        // get the file position...
        long startPos = ftk.getPosition();
        long reportedLength = 0;
        // read the type;
        String st = FXUtil.getFixedStringValue(ftk, 4);
 
        // 3. process the chunk...
        Element parser = null;
        // get data for the type of block it is...
        if ("fmt ".equals(st)) {
          ctx.fireStartParseEvent("Wave");
          ctx.fireParseEvent("type", st);
          wavElement.read(ftk, ctx);
          ctx.fireEndParseEvent("Wave");
          reportedLength = ctx.getIntAttribute("WAV.Wave.length");
          // break; // only want the first format tag...
        } else if ("data".equals(st)) {
          ctx.fireStartParseEvent("data");
          ctx.fireParseEvent("type", st);
          genericElement.read(ftk, ctx);
          ctx.fireEndParseEvent("data");
          reportedLength = ctx.getIntAttribute("WAV.data.length");
        } else if ("bext".equals(st)) {
          // System.out.println("Broadcast Wave Format extension chunk
          // found");
          ctx.fireStartParseEvent("bext");
          ctx.fireParseEvent("type", st);
          bextElement.read(ftk, ctx);
          ctx.fireEndParseEvent("bext");
          reportedLength = ctx.getIntAttribute("WAV.bext.length");
 
          // debug the bext
          // System.out.println("BEXT ->");
          // for (int i=0;i<bextNames.length;i++) {
          // System.out.println(bextNames[i]+"="+ctx.getAttribute("WAV.bext."+bextNames[i]));
          // }
        } else {
          // System.out.println("Unknown RIFF chunk :"+st);
          ctx.fireStartParseEvent("unknown");
          ctx.fireParseEvent("type", st);
          genericElement.read(ftk, ctx);
          ctx.fireEndParseEvent("unknown");
          reportedLength = ctx.getIntAttribute("WAV.unknown.length");
        }
 
        // work out if there is any padding at the end of the chunk
        long endPos = ftk.getPosition();
        long moveTo = startPos + reportedLength + 8; // the 8's 'cause
        // there's a 2 word
        // format/length
        // added to the
        // chunk at the
        // start
 
        // repositioning
        // System.out.println("Repo :");
        // System.out.println(" Reported Length :"+reportedLength);
        // System.out.println(" End :"+endPos);
        // System.out.println(" Start :"+startPos);
        // System.out.println(" Move Formula :"+moveTo);
 
        // 4. move the file pointer to the next chunk...
        ftk.setPosition(moveTo);
        // 5. loop...
        chunkSize += (reportedLength + 8);
      }
      ctx.fireEndParseEvent("WAV");
    }
View Full Code Here

Examples of org.apache.hadoop.chukwa.extraction.engine.datasource.DataSource

    TreeMap<Long, List<Record>> records = new TreeMap<Long, List<Record>>();
    result.setRecords(records);

    for (int i = 0; i < dataSources.length; i++) {
      DataSource ds = dataSourceFactory.getDataSource(dataSources[i]);
      ds.search(result, cluster, dataSources[i], t0, t1, filter, token);
    }
    return result;
  }
View Full Code Here

Examples of org.apache.harmony.awt.datatransfer.DataSource

    public void onRestart() {
    }

    @Override
    public void setContents(Transferable contents, ClipboardOwner owner) {
        DataSource dc = new DataSource(contents);
        final DataSnapshot snapshot = new DataSnapshot(dc);

        WinEventQueue.Task task = new WinEventQueue.Task() {
            @Override
            public void perform() {
View Full Code Here

Examples of org.apache.olingo.odata2.annotation.processor.core.datasource.DataSource

  private DataSource mockedDataSource = Mockito.mock(DataSource.class);
  private ValueAccess mockedValueAccess = Mockito.mock(ValueAccess.class);

  @Test
  public void init() throws ODataException {
    DataSource dataSource = new AnnotationInMemoryDs(Building.class.getPackage().getName());
    ValueAccess valueAccess = new AnnotationValueAccess();
    ListsProcessor lp = new ListsProcessor(dataSource, valueAccess);

    Assert.assertNotNull(lp);
  }
View Full Code Here

Examples of org.apache.openejb.jee.DataSource

            dataSource.setName(d.name());
            dataSource.setClassName(d.className());
            dataSource.setTransactional(d.transactional());

            final DataSource existing = consumer.getDataSourceMap().get(dataSource.getKey());

            if (existing != null) return;

            // Optional properties
            if (!d.databaseName().isEmpty()) dataSource.setDatabaseName(d.databaseName());
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.