java.sql.ResultSet#CLOSE_CURSORS_AT_COMMIT源码实例Demo

下面列出了java.sql.ResultSet#CLOSE_CURSORS_AT_COMMIT 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: snowflake-jdbc   文件: SnowflakeConnectionV1.java
public PreparedStatement prepareStatement(String sql, boolean skipParsing)
throws SQLException
{
  logger.debug(
      "PreparedStatement prepareStatement(String sql, boolean skipParsing)");
  raiseSQLExceptionIfConnectionIsClosed();
  PreparedStatement stmt = new SnowflakePreparedStatementV1(
      this,
      sql,
      skipParsing,
      ResultSet.TYPE_FORWARD_ONLY,
      ResultSet.CONCUR_READ_ONLY,
      ResultSet.CLOSE_CURSORS_AT_COMMIT);
  openStatements.add(stmt);
  return stmt;
}
 
源代码2 项目: gemfirexd-oss   文件: ClientDBMetaData.java
/**
 * {@inheritDoc}
 */
@Override
public boolean supportsResultSetHoldability(int holdability)
    throws SQLException {
  this.conn.lock();
  try {
    initServiceMetaData();
    Set<ServiceFeature> supportedFeatures = this.serviceMetaData
        .getSupportedFeatures();
    switch (holdability) {
      case ResultSet.CLOSE_CURSORS_AT_COMMIT:
        return supportedFeatures.contains(
            ServiceFeature.RESULTSET_HOLDABILITY_CLOSE_CURSORS_AT_COMMIT);
      case ResultSet.HOLD_CURSORS_OVER_COMMIT:
        return supportedFeatures.contains(
            ServiceFeature.RESULTSET_HOLDABILITY_HOLD_CURSORS_OVER_COMMIT);
      default:
        return false;
    }
  } finally {
    this.conn.unlock();
  }
}
 
@Override
public boolean supportsResultSetHoldability(int holdability)
throws SQLException
{
  logger.debug(
      "public boolean supportsResultSetHoldability(int holdability)");
  raiseSQLExceptionIfConnectionIsClosed();
  return holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码4 项目: phoenix   文件: PhoenixConnection.java
@Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency,
        int resultSetHoldability) throws SQLException {
    if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
        throw new SQLFeatureNotSupportedException();
    }
    return prepareStatement(sql, resultSetType, resultSetConcurrency);
}
 
源代码5 项目: gemfirexd-oss   文件: ResultSetTest.java
/**
 * Convert holdability from an integer to a readable string.
 *
 * @param holdability an <code>int</code> value representing a holdability
 * @return a <code>String</code> value representing the same holdability
 *
 */
private static String holdabilityString(int holdability) {
    switch (holdability) {
    case ResultSet.HOLD_CURSORS_OVER_COMMIT:
        return "HOLD_CURSORS_OVER_COMMIT";
    case ResultSet.CLOSE_CURSORS_AT_COMMIT:
        return "CLOSE_CURSORS_AT_COMMIT";
    default:
        return "UNKNOWN HOLDABILITY";
    }
}
 
源代码6 项目: gemfirexd-oss   文件: EmbedXAConnection.java
/**
	Are held cursors allowed. If the connection is attached to
       a global transaction then downgrade the result set holdabilty
       to CLOSE_CURSORS_AT_COMMIT if downgrade is true, otherwise
       throw an exception.
       If the connection is in a local transaction then the
       passed in holdabilty is returned.
*/
public int  checkHoldCursors(int holdability, boolean downgrade)
       throws SQLException
   {
	if (holdability == ResultSet.HOLD_CURSORS_OVER_COMMIT) {		
		if (isGlobal()) {
               if (!downgrade)
                   throw Util.generateCsSQLException(SQLState.CANNOT_HOLD_CURSOR_XA);
               
               holdability = ResultSet.CLOSE_CURSORS_AT_COMMIT;
           }
	}

	return super.checkHoldCursors(holdability, downgrade);
}
 
@Override
public ClickHouseStatement createStatement(int resultSetType, int resultSetConcurrency,
                                           int resultSetHoldability) throws SQLException {
    if (resultSetType == ResultSet.TYPE_SCROLL_SENSITIVE || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY
        || resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
        throw new SQLFeatureNotSupportedException();
    }
    return createStatement(resultSetType);
}
 
源代码8 项目: snowflake-jdbc   文件: SnowflakeConnectionV1.java
public CallableStatement prepareCall(String sql, boolean skipParsing) throws SQLException
{
  logger.debug(
      " public CallableStatement prepareCall(String sql, boolean skipParsing)");
  raiseSQLExceptionIfConnectionIsClosed();
  CallableStatement stmt = new SnowflakeCallableStatementV1(
      this, sql, skipParsing, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
      ResultSet.CLOSE_CURSORS_AT_COMMIT);
  openStatements.add(stmt);
  return stmt;
}
 
源代码9 项目: gemfirexd-oss   文件: ClientDBMetaData.java
/**
 * {@inheritDoc}
 */
@Override
public int getResultSetHoldability() throws SQLException {
  this.conn.lock();
  try {
    initServiceMetaData();
    return this.serviceMetaData
        .isDefaultResultSetHoldabilityHoldCursorsOverCommit() ? ResultSet.HOLD_CURSORS_OVER_COMMIT
        : ResultSet.CLOSE_CURSORS_AT_COMMIT;
  } finally {
    this.conn.unlock();
  }
}
 
源代码10 项目: phoenix   文件: PhoenixConnection.java
@Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency,
        int resultSetHoldability) throws SQLException {
    if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
        throw new SQLFeatureNotSupportedException();
    }
    return prepareStatement(sql, resultSetType, resultSetConcurrency);
}
 
@Override
public final int getHoldability() throws SQLException {
    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码12 项目: tddl   文件: TGroupConnection.java
public int getHoldability() throws SQLException {
    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码13 项目: tddl   文件: TConnection.java
@Override
public int getHoldability() throws SQLException {
    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码14 项目: phoenix   文件: PhoenixConnection.java
@Override
public int getHoldability() throws SQLException {
    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码15 项目: sql-layer   文件: JDBCDatabaseMetaData.java
@Override
public boolean supportsResultSetHoldability(int holdability) throws SQLException {
    return (holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT);
}
 
源代码16 项目: herddb   文件: HerdDBDatabaseMetadata.java
@Override
public int getResultSetHoldability() throws SQLException {
    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码17 项目: spotbugs   文件: Ideas_2013_01_29.java
int foobar() {
    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码18 项目: snowflake-jdbc   文件: SnowflakeDatabaseMetaData.java
@Override
public int getResultSetHoldability() throws SQLException
{
  logger.debug("public int getResultSetHoldability()");
  return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码19 项目: tddl5   文件: TConnection.java
@Override
public int getHoldability() throws SQLException {
    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
源代码20 项目: phoenix   文件: PhoenixStatement.java
@Override
public int getResultSetHoldability() throws SQLException {
    // TODO: not sure this matters
    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}