Package com.jengine.orm.db

Examples of com.jengine.orm.db.DBException


    public Field copy() throws DBException {
        try {
            return getClass().getConstructor(getClass()).newInstance(this);
        } catch (Exception e) {
            throw new DBException(e);
        }
    }
View Full Code Here


                    generatedKeys.add(rs.getObject(1));
                }
                dbConnection.setGeneratedKeys(generatedKeys);
            }
        } catch (Exception e) {
            throw new DBException(e);
        } finally {
            if (pstmt != null) {
                try {
                    pstmt.close();
                } catch (SQLException e) {
                    new DBException(e);
                }
            }
        }
    }
View Full Code Here

                    record[i] = rs.getObject(i+1);
                }
                items.add(record);
            }
        } catch (Exception e) {
            throw new DBException(e);
        } finally {
            if (pstmt != null) {
                try {
                    pstmt.close();
                } catch (SQLException e) {
                    new DBException(e);
                }
            }
        }

        return items;
View Full Code Here

                remove(obj);
                insert(obj);
                connection.commit();
            } catch (Exception e) {
                connection.rollback();
                throw new DBException(e);
            } finally {
                connection.finishTransaction();
            }
        } else {
            DBSavePoint point = connection.savePoint();
            try{
                remove(obj);
                insert(obj);
            } catch (Exception e) {
                connection.rollback(point);
                throw new DBException(e);
            } finally {
                connection.releasePoint(point);
            }
        }
    }
View Full Code Here

    public void close() throws DBException {
        try {
            getNativeConnection().close();
        } catch (SQLException e) {
            throw new DBException(e);
        }
    }
View Full Code Here

    public void startTransaction() throws DBException {
        try {
            getNativeConnection().setAutoCommit(false);
            logger.info("Transaction started!");
        } catch (SQLException e) {
            throw new DBException(e);
        }
    }
View Full Code Here

    public void commit() throws DBException {
        try {
            getNativeConnection().commit();
            logger.info("Transaction committed!");
        } catch (SQLException e) {
            throw new DBException(e);
        }
    }
View Full Code Here

    public void rollback() throws DBException {
        try {
            getNativeConnection().rollback();
            logger.info("Transaction rollback!");
        } catch (SQLException e) {
            throw new DBException(e);
        }
    }
View Full Code Here

    public void finishTransaction() throws DBException {
        try {
            getNativeConnection().setAutoCommit(true);
            logger.info("Transaction finish!");
        } catch (SQLException e) {
            throw new DBException(e);
        }
    }
View Full Code Here

    public DBSavePoint savePoint(String name) throws DBException {
        try {
            logger.info("Save Point '" + name + "' start");
            return new DBSavePoint(getNativeConnection().setSavepoint(name));
        } catch (SQLException e) {
            throw new DBException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.jengine.orm.db.DBException

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.