Examples of JNDIDataSource


Examples of com.volantis.synergetics.reporting.config.JNDIDatasource

     * @throws JiBXException if unmarshalling failed
     */
    private DatasourceConfiguration unmarshalJNDIDatasource(
            UnmarshallingContext ctx) throws JiBXException {
       
        JNDIDatasource source = new JNDIDatasource();

        ctx.parsePastStartTag(ctx.getNamespace(),
                JNDI_DATASOURCE_TAG_NAME);

        source.setJndiName(getTagsTextContent(ctx, JNDI_NAME_TAG_NAME));

        unmarshalName(ctx, source);
       
        ctx.toEnd();
        ctx.parsePastEndTag(ctx.getNamespace(),
View Full Code Here

Examples of com.volantis.synergetics.reporting.config.JNDIDatasource

            marshalName(index, ctx, internalPoolDatasource.getName());
           
            ctx.endTag(index, INTERNAL_POOL_DATASOURCE_TAG_NAME);           
        } else if (type == DataSourceType.JNDI_DATASOURCE) {
            JNDIDatasource jndiDatasource = (JNDIDatasource) dataSource;
            ctx.startTag(index, JNDI_DATASOURCE_TAG_NAME);
           
            writeTagsTextContent(ctx, JNDI_NAME_TAG_NAME,
                    jndiDatasource.getJndiName());

            marshalName(index, ctx, jndiDatasource.getName());
           
            ctx.endTag(index, JNDI_DATASOURCE_TAG_NAME);           
        } else {
            throw new JiBXException(EXCEPTION_LOCALIZER
                    .format("invalid-datasource-type"));
View Full Code Here

Examples of com.volantis.synergetics.reporting.config.JNDIDatasource

        DatasourceConfiguration datasource = parseDatasource(
                new ByteArrayInputStream(ANONYMOUS_JNDI_DATASOURCE.getBytes()));

        assertEquals(DataSourceType.JNDI_DATASOURCE, datasource.getType());
       
        JNDIDatasource jndiDatasource =
            (JNDIDatasource) datasource;
    
        assertEquals("jdbc/TestDB", jndiDatasource.getJndiName());
    }   
View Full Code Here

Examples of no.priv.garshol.duke.datasources.JNDIDataSource

        currentobj = datasource;
      } else if (localName.equals("jdbc")) {
        datasource = new JDBCDataSource();
        currentobj = datasource;
      } else if (localName.equals("jndi")) {
        datasource = new JNDIDataSource();
        currentobj = datasource;
      } else if (localName.equals("sparql")) {
        datasource = new SparqlDataSource();
        currentobj = datasource;
      } else if (localName.equals("ntriples")) {
View Full Code Here

Examples of no.priv.garshol.duke.datasources.JNDIDataSource

    Configuration config = new ConfigurationImpl();
    ((ConfigurationImpl) config).setProperties(props);
    ((ConfigurationImpl) config).setThreshold(0.85);
    ((ConfigurationImpl) config).setMaybeThreshold(0.7);

    JNDIDataSource jndi = new JNDIDataSource();
    jndi.setJndiPath("path");
    jndi.setQuery("select");
    jndi.addColumn(new Column("id", "ID", null, null));
    jndi.addColumn(new Column("name", "NAME", null, null));
    jndi.addColumn(new Column("email", "EMAIL", null, null));
    ((ConfigurationImpl) config).addDataSource(0, jndi);
   
    // --- write and reload
    File outfile = tmpdir.newFile("config.xml");           
    ConfigWriter.write(config, outfile.getAbsolutePath());
    config = ConfigLoader.load(outfile.getAbsolutePath());
   
    // --- verify loaded correctly   
    assertEquals(1, config.getDataSources().size());

    jndi = (JNDIDataSource) config.getDataSources().iterator().next();
    assertEquals("select", jndi.getQuery());
    assertEquals(3, jndi.getColumns().size());
    // FIXME: check the columns (kind of hard given lack of ordering)
   
    assertTrue(config.getDataSources(1).isEmpty());
    assertTrue(config.getDataSources(2).isEmpty());
    assertEquals(config.getThreshold(), 0.85);
View Full Code Here

Examples of no.priv.garshol.duke.datasources.JNDIDataSource

  private static void writeDataSource(XMLPrettyPrinter pp, DataSource src) {
    String name = null;
    if (src instanceof JNDIDataSource) {
      name = "jndi";
      JNDIDataSource jndi = (JNDIDataSource) src;
      pp.startElement(name, null);

      writeParam(pp, "jndi-path", jndi.getJndiPath());
      writeParam(pp, "query", jndi.getQuery());
    } else if (src instanceof JDBCDataSource) {
      name = "jdbc";
      JDBCDataSource jdbc = (JDBCDataSource) src;
      pp.startElement(name, null);
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.