當前位置: 首頁>>代碼示例>>Java>>正文


Java ResultSet.TYPE_SCROLL_INSENSITIVE屬性代碼示例

本文整理匯總了Java中java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE屬性的典型用法代碼示例。如果您正苦於以下問題:Java ResultSet.TYPE_SCROLL_INSENSITIVE屬性的具體用法?Java ResultSet.TYPE_SCROLL_INSENSITIVE怎麽用?Java ResultSet.TYPE_SCROLL_INSENSITIVE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.sql.ResultSet的用法示例。


在下文中一共展示了ResultSet.TYPE_SCROLL_INSENSITIVE屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: supportsResultSetConcurrency

@Override
public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException
{
    checkClosed();
    if (type == ResultSet.TYPE_SCROLL_INSENSITIVE && concurrency == ResultSet.CONCUR_READ_ONLY)
        return true;
    return false;
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:8,代碼來源:JDBC4DatabaseMetaData.java

示例4: supportsResultSetType

@Override
public boolean supportsResultSetType(int type) throws SQLException
{
    checkClosed();
    if (type == ResultSet.TYPE_SCROLL_INSENSITIVE)
        return true;
    return false;
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:8,代碼來源:JDBC4DatabaseMetaData.java

示例5: prepareCall

@Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
    if (resultSetType == ResultSet.TYPE_SCROLL_INSENSITIVE && resultSetConcurrency == ResultSet.CONCUR_READ_ONLY)
        return prepareCall(sql);
    checkClosed();
    throw SQLError.noSupport();
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:8,代碼來源:JDBC4Connection.java

示例6: 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

示例7: prepareStatement

@Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
    if (resultSetType == ResultSet.TYPE_SCROLL_INSENSITIVE && resultSetConcurrency == ResultSet.CONCUR_READ_ONLY)
        return prepareStatement(sql);
    checkClosed();
    throw SQLError.noSupport();
}
 
開發者ID:s-store,項目名稱:s-store,代碼行數:8,代碼來源:JDBC4Connection.java

示例8: 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:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:10,代碼來源:CommonRowSetTests.java

示例9: getResultSetType

@Override
public int getResultSetType() throws SQLException
{
    checkClosed();
    return ResultSet.TYPE_SCROLL_INSENSITIVE;
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:6,代碼來源:JDBC4Statement.java

示例10: checkCreateStatementSupported

/**
 * Check if the createStatement() options are supported
 *
 * See http://docs.oracle.com/javase/7/docs/api/index.html?java/sql/DatabaseMetaData.html
 *
 * The following flags are supported:
 *  - The type must either be TYPE_SCROLL_INSENSITIVE or TYPE_FORWARD_ONLY.
 *  - The concurrency must be CONCUR_READ_ONLY.
 *  - The holdability must be CLOSE_CURSORS_AT_COMMIT.
 *
 * @param resultSetType  JDBC result set type option
 * @param resultSetConcurrency  JDBC result set concurrency option
 * @param resultSetHoldability  JDBC result set holdability option
 * @throws SQLException  if not supported
 */
private static void checkCreateStatementSupported(
        int resultSetType, int resultSetConcurrency, int resultSetHoldability)
                throws SQLException
{
    if (   (   (resultSetType != ResultSet.TYPE_SCROLL_INSENSITIVE
            &&  resultSetType != ResultSet.TYPE_FORWARD_ONLY))
        || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY
        || resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
        throw SQLError.noSupport();
    }
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:26,代碼來源:JDBC4Connection.java

示例11: supportsResultSetType

/**
 * JDBC 2.0 Does the database support the given result set type?
 * 
 * @param type
 *            defined in java.sql.ResultSet
 * @return true if so
 * @exception SQLException
 *                if a database-access error occurs.
 * @see Connection
 */
public boolean supportsResultSetType(int type) throws SQLException {
    return (type == ResultSet.TYPE_SCROLL_INSENSITIVE);
}
 
開發者ID:JuanJoseFJ,項目名稱:ProyectoPacientes,代碼行數:13,代碼來源:DatabaseMetaData.java


注:本文中的java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。