Examples of JdbcSession


Examples of com.jcabi.jdbc.JdbcSession

     * @throws IOException If an IO Exception occurs.
     */
    H2DomainStatsData(final File file) throws IOException {
        this.jdbc = String.format("jdbc:h2:file:%s", file.getAbsolutePath());
        try {
            new JdbcSession(this.connection()).sql(CREATE).execute();
        } catch (final SQLException ex) {
            throw new IOException(ex);
        }
    }
View Full Code Here

Examples of com.jcabi.jdbc.JdbcSession

    }

    @Override
    public void put(final String domain, final Stats stats) throws IOException {
        try {
            new JdbcSession(this.connection())
                .sql(INSERT)
                .set(domain)
                .set(stats.bytesTransferred())
                .execute();
        } catch (final SQLException ex) {
View Full Code Here

Examples of com.jcabi.jdbc.JdbcSession

    }

    @Override
    public Stats get(final String domain) throws IOException {
        try {
            final JdbcSession session = new JdbcSession(this.connection())
                .autocommit(false);
            // @checkstyle LineLength (2 lines)
            final Stats result = session
                .sql("SELECT SUM(BYTES) FROM DOMAIN_STATS WHERE DOMAIN = ? FOR UPDATE")
                .set(domain)
                .select(STATS);
            session.sql("DELETE FROM DOMAIN_STATS WHERE DOMAIN = ?")
                .set(domain)
                .execute()
                .commit();
            return result;
        } catch (final SQLException ex) {
View Full Code Here

Examples of com.jcabi.jdbc.JdbcSession

    @Override
    @SuppressWarnings("PMD.UseConcurrentHashMap")
    public Map<String, Stats> all() throws IOException {
        try {
            final JdbcSession session = new JdbcSession(this.connection())
                .autocommit(false);
            // @checkstyle LineLength (2 lines)
            final Map<String, Stats> result = session
                .sql("SELECT DOMAIN, SUM(BYTES) FROM DOMAIN_STATS GROUP BY DOMAIN FOR UPDATE")
                .select(STATS_ALL);
            session.sql("DELETE FROM DOMAIN_STATS").execute().commit();
            return result;
        } catch (final SQLException ex) {
            throw new IOException(ex);
        }
    }
View Full Code Here

Examples of org.jitterbit.integration.server.engine.jdbc.JdbcSession

    @Override
    public WsJdbcStartNewSessionResult startNewSession(String jitterbitUser, String md5Pwd) throws RemoteException {
        try {
            JdbcEngine engine = JdbcEngine.getEngine();
            JdbcSession session = engine.newSession(jitterbitUser, md5Pwd);
            return new WsJdbcStartNewSessionResult(createForSuccess(), session.getId().toString());
        } catch (Exception e) {
          return new WsJdbcStartNewSessionResult(createForException(e, "startNewSession"), null);
        }
    }
View Full Code Here

Examples of org.jitterbit.integration.server.engine.jdbc.JdbcSession

    }

    @Override
    public WsJdbcError commitTransactions(WsJdbcSessionId sessionId) throws RemoteException {
        try {
            JdbcSession session = getSession(sessionId);
            session.commitTransactions();
            return createForSuccess();
        } catch (Exception e) {
          return createForException(e, "commitTransactions");
        }
    }
View Full Code Here

Examples of org.jitterbit.integration.server.engine.jdbc.JdbcSession

    }

    @Override
    public WsJdbcError rollbackTransactions(WsJdbcSessionId sessionId) throws RemoteException {
        try {
            JdbcSession session = getSession(sessionId);
            session.rollbackTransactions();
            return createForSuccess();
        } catch (Exception e) {
          return createForException(e, "rollbackTransactions");
        }
    }
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.