Package org.gdbms.engine.data.driver

Examples of org.gdbms.engine.data.driver.DriverException


    public void open(File file) throws DriverException {
    }

    public void close() throws DriverException {
        if (failOnClose ) {
            throw new DriverException();
        }
    }
View Full Code Here


        values.add("cadena3");
        values.add("cadena4");
    }

    public void write(DataSource dataWare) throws DriverException {
        throw new DriverException();       
    }
View Full Code Here

    public void write(DataSource dataWare) throws DriverException {
        throw new DriverException();       
    }
   
    public void write(SpatialDataSource dataSource) throws DriverException {
        throw new DriverException();
    }
View Full Code Here

    }

    @Override
    public void removeField(int index) throws DriverException {
        if (isPK(getFields().get(index))) {
            throw new DriverException("Cannot remove the primary key");
        }

        Field toDelete = fields.get(index);

        if (toDelete.getOriginalIndex() != -1) {
View Full Code Here

    }

    @Override
    public void setFieldName(int index, String name) throws DriverException {
        if (isPK(getFields().get(index))) {
            throw new DriverException("Cannot change primary key name");
        }
        super.setFieldName(index, name);
    }
View Full Code Here

    }

    @Override
    public void removeField(int index) throws DriverException {
        if (isPK(getFields().get(index))) {
            throw new DriverException("Cannot remove the primary key");
        }

        Field toDelete = fields.get(index);

        if (toDelete.getOriginalIndex() != -1) {
View Full Code Here

    public void commitTrans() throws DriverException, FreeingResourcesException {
        if (driver instanceof DBTransactionalDriver) {
            try {
                ((DBTransactionalDriver) driver).beginTrans(ds.getConnection());
            } catch (SQLException e) {
                throw new DriverException(e);
            }
        }
       
        StringBuffer totalSQL = new StringBuffer();
        try {
            mes.commit(ds.getConnection());
       
            String sql = "";
            for (int i = 0; i < dbws.getInstructionCount(); i++) {
                    sql = dbws.getInstruction(i);
                    logger.log(Level.INFO, "instruction " + i + ": " + sql);
                    if (sql != null) {
                        totalSQL.append(sql).append(";");
                    }
            }
            ds.execute(totalSQL.toString());
        } catch (SQLException e) {
            if (driver instanceof DBTransactionalDriver) {
                try {
                    ((DBTransactionalDriver) driver)
                            .rollBackTrans(ds.getConnection());
                } catch (SQLException e1) {
                    throw new DriverException(e1);
                }
            }
            throw new DriverException(e.getMessage() + ":" + totalSQL, e);
        }

        if (driver instanceof DBTransactionalDriver) {
            try {
                ((DBTransactionalDriver) driver).commitTrans(ds.getConnection());
            } catch (SQLException e) {
                throw new DriverException(e);
            }
        }

        try {
            dbws = null;
View Full Code Here

    }
   
    @Override
    public void beginTrans(long rc) throws DriverException {
        if (((PKEditableDataSource)ds).getPKNames().length ==0 ){
            throw new DriverException("No primary key was found");
        }
        super.beginTrans(rc);
        for (int i = 0; i < rc; i++) {
            original.add(Boolean.TRUE);
            info.add(new NoEditionInfo(((PKEditableDataSource)ds).getPKValue(i), i));
View Full Code Here

     */
    public void open(Connection con, String tableName, String orderFieldName) throws DriverException {
        try {
            jdbcSupport = JDBCSupport.newJDBCSupport(con, tableName, orderFieldName);
        } catch (SQLException e) {
            throw new DriverException(e);
        }
    }
View Full Code Here

     */
    public void close() throws DriverException {
        try {
            jdbcSupport.close();
        } catch (SQLException e) {
            throw new DriverException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.gdbms.engine.data.driver.DriverException

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.