Java Code Examples for java.sql.ResultSet.CLOSE_CURSORS_AT_COMMIT

The following are Jave code examples for showing how to use CLOSE_CURSORS_AT_COMMIT of the java.sql.ResultSet class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: spanner-jdbc   File: AbstractCloudSpannerConnection.java   View Source Code Vote up 5 votes
@Override
public void setHoldability(int holdability) throws SQLException
{
	checkClosed();
	if (holdability != ResultSet.CLOSE_CURSORS_AT_COMMIT)
		throw new SQLFeatureNotSupportedException();
}
 
Example 2
Project: spanner-jdbc   File: AbstractCloudSpannerConnectionTest.java   View Source Code Vote up 5 votes
@Test
public void testSetHoldability() throws Exception
{
	AbstractCloudSpannerConnection testSubject;
	int holdability = ResultSet.CLOSE_CURSORS_AT_COMMIT;

	testSubject = createTestSubject();
	testSubject.setHoldability(holdability);

	thrown.expect(SQLFeatureNotSupportedException.class);
	testSubject.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
}
 
Example 3
Project: aceql-http   File: TransactionUtil.java   View Source Code Vote up 5 votes
private static int getHoldability(String actionValue) {

	if (actionValue.equals(HttpParameter.HOLD_CURSORS_OVER_COMMIT)) {
	    return ResultSet.HOLD_CURSORS_OVER_COMMIT;
	} else if (actionValue.equals(HttpParameter.CLOSE_CURSORS_AT_COMMIT)) {
	    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
	} else {
	    throw new IllegalArgumentException("Unsupported Holdability: "
		    + actionValue);
	}
    }
 
Example 4
Project: aceql-http   File: TransactionUtil.java   View Source Code Vote up 5 votes
private static String getHoldabilityAsString(int holdability) {

	if (holdability == ResultSet.HOLD_CURSORS_OVER_COMMIT) {
	    return HttpParameter.HOLD_CURSORS_OVER_COMMIT;
	} else if (holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT) {
	    return HttpParameter.CLOSE_CURSORS_AT_COMMIT;
	}else {
	    throw new IllegalArgumentException("Unsupported Holdability: "
		    + holdability);
	}
    }
 
Example 5
Project: Saturn   File: SyncConn.java   View Source Code Vote up 5 votes
protected void checkCursor(int rst, int rsc, int rsh) throws SQLException {
    if (rst != ResultSet.TYPE_FORWARD_ONLY)
        throw new SQLException("SQLite only supports TYPE_FORWARD_ONLY cursors");
    if (rsc != ResultSet.CONCUR_READ_ONLY)
        throw new SQLException("SQLite only supports CONCUR_READ_ONLY cursors");
    if (rsh != ResultSet.CLOSE_CURSORS_AT_COMMIT)
        throw new SQLException("SQLite only supports closing cursors at commit");
}
 
Example 6
Project: calcite-avatica   File: AvaticaConnection.java   View Source Code Vote up 5 votes
public void setHoldability(int holdability) throws SQLException {
  if (!(holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT
      || holdability == ResultSet.HOLD_CURSORS_OVER_COMMIT)) {
    throw new SQLException("invalid value");
  }
  this.holdability = holdability;
}
 
Example 7
Project: spanner-jdbc   File: CloudSpannerDatabaseMetaData.java   View Source Code Vote up 4 votes
@Override
public boolean supportsResultSetHoldability(int holdability) throws SQLException
{
	return holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
Example 8
Project: spanner-jdbc   File: CloudSpannerDatabaseMetaData.java   View Source Code Vote up 4 votes
@Override
public int getResultSetHoldability() throws SQLException
{
	return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
Example 9
Project: spanner-jdbc   File: AbstractCloudSpannerConnection.java   View Source Code Vote up 4 votes
@Override
public int getHoldability() throws SQLException
{
	checkClosed();
	return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
 
Example 10
Project: sstore-soft   File: JDBC4Connection.java   View Source Code Vote up 3 votes
/**
 * 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();
    }
}
 
Example 11
Project: s-store   File: JDBC4Connection.java   View Source Code Vote up 3 votes
/**
 * 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();
    }
}