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


Java ResultSet.TYPE_SCROLL_SENSITIVE属性代码示例

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


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

示例1: supportsResultSetConcurrency

/**
 * JDBC 2.0 Does the database support the concurrency type in combination
 * with the given result set type?
 * 
 * @param type
 *            defined in java.sql.ResultSet
 * @param concurrency
 *            type defined in java.sql.ResultSet
 * @return true if so
 * @exception SQLException
 *                if a database-access error occurs.
 * @see Connection
 */
public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException {
    switch (type) {
        case ResultSet.TYPE_SCROLL_INSENSITIVE:
            if ((concurrency == ResultSet.CONCUR_READ_ONLY) || (concurrency == ResultSet.CONCUR_UPDATABLE)) {
                return true;
            }
            throw SQLError.createSQLException("Illegal arguments to supportsResultSetConcurrency()", SQLError.SQL_STATE_ILLEGAL_ARGUMENT,
                    getExceptionInterceptor());

        case ResultSet.TYPE_FORWARD_ONLY:
            if ((concurrency == ResultSet.CONCUR_READ_ONLY) || (concurrency == ResultSet.CONCUR_UPDATABLE)) {
                return true;
            }
            throw SQLError.createSQLException("Illegal arguments to supportsResultSetConcurrency()", SQLError.SQL_STATE_ILLEGAL_ARGUMENT,
                    getExceptionInterceptor());

        case ResultSet.TYPE_SCROLL_SENSITIVE:
            return false;
        default:
            throw SQLError.createSQLException("Illegal arguments to supportsResultSetConcurrency()", SQLError.SQL_STATE_ILLEGAL_ARGUMENT,
                    getExceptionInterceptor());
    }

}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:37,代码来源:DatabaseMetaData.java

示例2: updateScrollableSupport

/**
 * Determine if DBMS/Driver supports scrollable resultsets to be able to
 * determine complete row count for a given SQL.
 *
 * @param conn established JDBC connection
 * @param dc connection information
 * @param sql the sql to be executed
 */
private void updateScrollableSupport(Connection conn, DatabaseConnection dc,
        String sql) {
    useScrollableCursors = dc.isUseScrollableCursors();
    if (!useScrollableCursors) {
        return;
    }
    String driverName = dc.getDriverClass();
    /* Derby fails to support scrollable cursors when invoking 'stored procedures'
     which return resultsets - it fails hard: not throwing a SQLException,
     but terminating the connection - so don't try to use scrollable cursor
     on derby, for "non"-selects */
    if (driverName != null && driverName.startsWith("org.apache.derby")) { //NOI18N
        if (!isSelectStatement(sql)) {
            resultSetScrollType = ResultSet.TYPE_FORWARD_ONLY;
            return;
        }
    }
    /* Try to get a "good" scrollable ResultSet and follow the DBs support */
    try {
        if (conn.getMetaData().supportsResultSetType(
                ResultSet.TYPE_SCROLL_INSENSITIVE)) {
            resultSetScrollType = ResultSet.TYPE_SCROLL_INSENSITIVE;
        } else if (conn.getMetaData().supportsResultSetType(
                ResultSet.TYPE_SCROLL_SENSITIVE)) {
            resultSetScrollType = ResultSet.TYPE_SCROLL_SENSITIVE;
        }
    } catch (Exception ex) {
        LOGGER.log(Level.WARNING, "Exception while querying" //NOI18N
                + " database for scrollable resultset support"); //NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:SQLExecutionHelper.java

示例3: supportsResultSetType

public boolean supportsResultSetType(int type) throws SQLException {
	if (type == ResultSet.TYPE_FORWARD_ONLY) {
		return true;
	}
	if (type == ResultSet.TYPE_SCROLL_INSENSITIVE) {
		// TODO あとでよく見る。
		return false;
	}
	if (type == ResultSet.TYPE_SCROLL_SENSITIVE) {
		// TODO あとでよく見る。
		return true;
	}
	return false;
}
 
开发者ID:igapyon,项目名称:blanco-sfdc-jdbc-driver,代码行数:14,代码来源:AbstractBlancoGenericJdbcDatabaseMetaData.java

示例4: rowSetScrollTypes

@DataProvider(name = "rowSetScrollTypes")
protected Object[][] rowSetScrollTypes() throws Exception {
    RowSet rs = newInstance();

    return new Object[][]{
        {rs, ResultSet.TYPE_FORWARD_ONLY},
        {rs, ResultSet.TYPE_SCROLL_INSENSITIVE},
        {rs, ResultSet.TYPE_SCROLL_SENSITIVE}
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:CommonRowSetTests.java

示例5: createStatement

@Override
   public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) {
    throw new SQLException(
	    String.format("Statement with resultset concurrency %d is not supported", resultSetConcurrency));
}
if (resultSetType == ResultSet.TYPE_SCROLL_SENSITIVE) {
    throw new SQLException(String.format("Statement with resultset type %d is not supported", resultSetType));
}
return new TsfileStatement(this, client, sessionHandle);
   }
 
开发者ID:thulab,项目名称:iotdb-jdbc,代码行数:11,代码来源:TsfileConnection.java


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