当前位置: 首页>>代码示例>>Java>>正文


Java Savepoint.getSavepointName方法代码示例

本文整理汇总了Java中java.sql.Savepoint.getSavepointName方法的典型用法代码示例。如果您正苦于以下问题:Java Savepoint.getSavepointName方法的具体用法?Java Savepoint.getSavepointName怎么用?Java Savepoint.getSavepointName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.sql.Savepoint的用法示例。


在下文中一共展示了Savepoint.getSavepointName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: releaseSavepoint

import java.sql.Savepoint; //导入方法依赖的package包/类
/**
     * <!-- start generic documentation -->
     * Removes the given <code>Savepoint</code>
     * object from the current transaction. Any reference to the
     * savepoint after it have been removed will cause an
     * <code>SQLException</code> to be thrown. <p>
     *
     * <!-- end generic documentation -->
     *
     * @param savepoint the <code>Savepoint</code> object to be removed
     * @exception SQLException if a database access error occurs or
     *           the given <code>Savepoint</code> object is not a valid
     *           savepoint in the current transaction
     *
     * @see jdbcSavepoint
     * @see java.sql.Savepoint
     * @since JDK 1.4, HSQLDB 1.7.2
     */
//#ifdef JAVA4
    public synchronized void releaseSavepoint(Savepoint savepoint)
    throws SQLException {

        String        msg;
        jdbcSavepoint sp;
        Result        req;

        checkClosed();

        if (savepoint == null) {
            msg = "savepoint is null";

            throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg);
        }

// fredt - might someone call this with a Savepoint from a different driver???
        if (!(savepoint instanceof jdbcSavepoint)) {
            throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT);
        }

        sp = (jdbcSavepoint) savepoint;

        if (this != sp.connection) {
            msg = savepoint.getSavepointName()
                  + " was not issued on this connection";

            throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg);
        }

        req = Result.newReleaseSavepointRequest(sp.name);

        try {
            Result result = sessionProxy.execute(req);

            if (result.isError()) {
                Util.throwError(result);
            }
        } catch (HsqlException e) {
            Util.throwError(e);
        }
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:61,代码来源:jdbcConnection.java


注:本文中的java.sql.Savepoint.getSavepointName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。