Examples of DbSource


Examples of org.exist.source.DBSource

                resource = broker.getXMLResource(pathUri, Lock.READ_LOCK);

                if(resource != null) {
                    LOG.info("Resource [" + xqueryResourcePath + "] exists.");
                    source = new DBSource(broker, (BinaryDocument)resource, true);
                } else {
                    LOG.error("Resource [" + xqueryResourcePath + "] does not exist.");
                    return;
                }
View Full Code Here

Examples of org.exist.source.DBSource

        } else {
            // process the xpointer or the stored XQuery
            try {
                Source source;
                if (xpointer == null)
                    {source = new DBSource(serializer.broker, (BinaryDocument) doc, true);}
                else {
                    xpointer = checkNamespaces(xpointer);
                    source = new StringSource(xpointer);
                }
                final XQuery xquery = serializer.broker.getXQueryService();
View Full Code Here

Examples of org.exist.source.DBSource

                                "declares a wrong mime-type");
                        return null;
                    }
                    final String controllerPath = controllerDoc.getCollection().getURI().getRawCollectionPath();
                   
                    sourceInfo = new SourceInfo(new DBSource(broker, (BinaryDocument) controllerDoc, true), "xmldb:exist://" + controllerPath);
                    sourceInfo.controllerPath = controllerPath.substring(locationUri.getCollectionPath().length());

                    return sourceInfo;
                } finally {
                    if (controllerDoc != null) {
View Full Code Here

Examples of org.exist.source.DBSource

                        {throw new ServletException("XQuery resource: " + query + " not found in database");}
                    if (sourceDoc.getResourceType() != DocumentImpl.BINARY_FILE ||
                            !"application/xquery".equals(sourceDoc.getMetadata().getMimeType()))
                        {throw new ServletException("XQuery resource: " + query + " is not an XQuery or " +
                                "declares a wrong mime-type");}
                    sourceInfo = new SourceInfo(new DBSource(broker, (BinaryDocument) sourceDoc, true),
                        locationUri.toString());
                } catch (final PermissionDeniedException e) {
                    throw new ServletException("permission denied to read module source from " + query);
                } finally {
                    if(sourceDoc != null)
View Full Code Here

Examples of org.exist.source.DBSource

            broker = brokerPool.get(user);
            final DocumentImpl resource = broker.getResource(new XmldbURI(uri), Permission.READ | Permission.EXECUTE);
            if(resource == null) {
                throw new XMLDBException(ErrorCodes.INVALID_URI, "No stored XQuery exists at: " + uri);
            }
            final Source xquerySource = new DBSource(broker, (BinaryDocument)resource, false);
            return execute(xquerySource);
        } catch(final EXistException ee) {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, ee.getMessage(), ee);
        } catch(final PermissionDeniedException pde) {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, pde.getMessage(), pde);
View Full Code Here

Examples of org.gdbms.engine.data.db.DBSource

      createFiles(basedir);

    //Setup de las tablas
    dsf.registerDataSource("persona", new FileSourceDefinition(new File(basedir + "/src/test/resources/persona.csvf")));
    dsf.registerDataSource("sort", new FileSourceDefinition(basedir + "/src/test/resources/sort.csv"));
    dsf.registerDataSource("hsqldbpersona", new DBTableSourceDefinition(new DBSource(null, 0, basedir + "/src/test/resources/testdb", "sa", "",
        "persona", "jdbc:hsqldb:file")));
    dsf.registerDataSource("hsqldbpersonatransactional", new DBTableSourceDefinition(new DBSource(null, 0, basedir + "/src/test/resources/testdb", "sa", "",
        "persona", "jdbc:hsqldb:file")));
    dsf.registerDataSource("hsqldbapellido", new DBQuerySourceDefinition(new DBSource(null, 0,
            basedir + "/src/test/resources/testdb", "sa", "", null, "jdbc:hsqldb:file"), "select apellido from persona"));
    dsf.registerDataSource("nulos", new FileSourceDefinition(basedir + "/src/test/resources/nulos.csv"));
   
        dsf.registerDataSource("points0", new SpatialDBTableSourceDefinition(new DBSpatialSource("127.0.0.1", 5432,
                "orbiscad", "postgres", "", "points0", "the_geom", "jdbc:postgresql")));
        dsf.registerDataSource("pgWithGDBMS", new SpatialDBTableSourceDefinition(new DBSpatialSource("127.0.0.1", 5432,
                "orbiscad", "postgres", "", "polygon0", "the_geom", "jdbc:postgresql")));
   
    dsf.registerDataSource("foo", new DBTableSourceDefinition(new DBSource(null, 0, null, null, null, null, "jdbc:foo")));
    dsf.registerDataSource("shppuntos", new SpatialFileSourceDefinition(basedir + "/src/test/resources/puntos.shp"));
    dsf.registerDataSource("shplineas", new SpatialFileSourceDefinition(basedir + "/src/test/resources/lineas.shp"));
    dsf.registerDataSource("shppoligonos", new SpatialFileSourceDefinition(basedir + "/src/test/resources/poligonos.shp"));
    dsf.registerDataSource("dxfprueba", new SpatialFileSourceDefinition(basedir + "/src/test/resources/dxfprueba.dxf"));
    dsf.registerDataSource("spatialobjectpersona", new SpatialObjectSourceDefinition(new FakeSpatialObjectDriver()));
View Full Code Here

Examples of org.gdbms.engine.data.db.DBSource

        ddm.addField("entero", "TINYINT");
        ddm.addField("decimal", "DECIMAL", new String[]{"SCALE", "PRECISION"}, new String[]{"2", "5"});
        ddm.addField("decimal2", "DECIMAL");
        ddm.addField("texto2", "CHAR");
        ddm.setPrimaryKey(new String[]{"entero"});
        DBSource dbsd = new DBSource(null, 0, "src/test/resources/testdb", "sa", "",
        "nuevo", "jdbc:hsqldb:file");
        ds.createDataSource(new DBSourceCreation(dbsd, ddm));
        ds.registerDataSource("nuevoDataSource", new DBTableSourceDefinition(dbsd));
        DataSource d = ds.getDataSource("nuevoDataSource");
        d.start();
View Full Code Here

Examples of org.gdbms.engine.data.db.DBSource

  @Override
  public DataSource createDataSource(String tableName, String tableAlias, String driverName) throws DataSourceCreationException {

    ((GDBMSDriver) driver).setDataSourceFactory(getDataSourceFactory());

        DBSource dbs = new DBSource(null, 0, null, null, null, null, null);
    DBTableDataSourceAdapter adapter = new DBTableDataSourceAdapter(
        tableName, tableAlias, dbs, (AlphanumericDBDriver) driver);
    adapter.setDataSourceFactory(getDataSourceFactory());

    getDataSourceFactory().getDelegatingStrategy().registerView(tableName,
        dbs.getTableName());

    return adapter;
  }
View Full Code Here

Examples of org.gdbms.engine.data.db.DBSource

    /*
     * addDBDataSource("mysql", "192.168.0.1", -1, "root", "root", "mysql",
     * new String[]{"*"}, "user", null, "mysql");
     */

    ds.registerDataSource("pb", new DBTableSourceDefinition(new DBSource(
        "127.0.0.1", 5432, "sigusal", "root", "", "pbedifihistpol",
        "jdbc:postgresql")));
    ds.registerDataSource("person", new DBTableSourceDefinition(
        new DBSource("www.freesql.org", 3306, "fergonco", "fergonco",
            "fergonco", "person", "jdbc:mysql")));
    ds.registerDataSource("fernando", new DBTableSourceDefinition(
        new DBSource("www.freesql.org", 3306, "fergonco", "fergonco",
            "fergonco", "person", "mysql")));
    ds
        .registerDataSource(
            "ages",
            new DBQuerySourceDefinition(
                new DBSource("www.freesql.org", 3306,
                    "elfernan", "elfernan", "elfernan",
                    null, "jdbc:mysql"),
                "select 3*p1.age as tripleage from person p1, person p2, person p3, person p4, person p5"));

    // CustomQueries
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.