Package org.jitterbit.integration.server.db.lookup

Examples of org.jitterbit.integration.server.db.lookup.DbLookup


                                        throws ServerDbException, ServerAccessException, SQLException {
        checkArgument(entityId instanceof SourceId || entityId instanceof TargetId,
                        "entityId must be the ID of a Source or a Target");
        Key key = new Key(entityId, params);
        synchronized (lock) {
            DbLookup lookup = dbLookups.get(key);
            if (lookup == null) {
                lookup = createAndStoreDbLookup(key);
            }
            return lookup;
        }
View Full Code Here


     */
    public DbLookup getCachedDbLookup(IntegrationEntityId entityId, ConnectionParams params)
                                        throws ServerDbException, ServerAccessException, SQLException {
        Key key = new Key(entityId, params);
        synchronized (lock) {
            DbLookup lookup = cachedDbLookups.get(key);
            if (lookup == null) {
                lookup = new CachedDbLookup(createAndStoreDbLookup(key));
                cachedDbLookups.put(key, lookup);
            }
            return lookup;
View Full Code Here

    }

    private DbLookup createAndStoreDbLookup(Key key)
                                        throws ServerDbException, ServerAccessException, SQLException {
        Connection conn = connectToExternalDB(key);
        DbLookup lookup = new DefaultDbLookup(conn);
        dbLookups.put(key, lookup);
        return lookup;
    }
View Full Code Here

    }

    @Override
    protected DbLookupResult doWork(JdbcSession session) throws EngineSessionException, ServerAccessException {
        try {
            DbLookup lookup = session.getDbLookup(entityId, connParams);
            lookup.setAutoCommit(autoCommit);
            return lookup.lookup(sql);
        } catch (ServerDbException e) {
            throw new EngineSessionException(e);
        } catch (SQLException e) {
            throw new EngineSessionException(e);
        }
View Full Code Here

    @Override
    protected DbLookupResult doWork(JdbcSession session) throws EngineSessionException, ServerAccessException,
                    ServerDbException {
        try {
            DbLookup lookup = session.getCachedDbLookup(entityId, connParams);
            lookup.setAutoCommit(autoCommit);
            return lookup.lookup(sql);
        } catch (SQLException e) {
            throw new EngineSessionException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.server.db.lookup.DbLookup

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.