Change the value of the sharding key property in the connection request information.

@param shardingKey the new value.
@throws SQLException if the connection request information is not editable.
769368
public void setShardingKey(Object shardingKey) throws SQLException {
        if (!changable)
            throw new SQLException(AdapterUtil.getNLSMessage("WS_INTERNAL_ERROR",
                "ConnectionRequestInfo cannot be modified, doing so may result in corruption: shardingKey, cri", shardingKey, this));

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "Setting sharding key on the CRI to: " + shardingKey);

        ivShardingKey = shardingKey;
    }
762361
private void cacheShardValue(TableDefinition tableDef,
                                 Integer         shardNumber,
                                 Date            shardStart) {
        // Get or create the app name -> table map
        String appName = tableDef.getAppDef().getAppName();
        Map<String, Map<Integer, Date>> tableShardNumberMap = m_appShardMap.get(appName);
        if (tableShardNumberMap == null) {
            tableShardNumberMap = new HashMap<String, Map<Integer,Date>>();
            m_appShardMap.put(appName, tableShardNumberMap);
        }
        
        // Get or create the table name -> shard number map
        String tableName = tableDef.getTableName();
        Map<Integer, Date> shardNumberMap = tableShardNumberMap.get(tableName);
        if (shardNumberMap == null) {
            shardNumberMap = new HashMap<Integer, Date>();
            tableShardNumberMap.put(tableName, shardNumberMap);
        }
        
        // Add the shard number -> start date
        shardNumberMap.put(shardNumber, shardStart);
        m_logger.debug("Sharding date for {}.{} shard #{} set to: {} ({})",
                       new Object[]{appName, tableName, shardNumber, shardStart.getTime(), Utils.formatDateUTC(shardStart)});
    }
1218132
public void addTableShardingValue(final String logicTable, final Comparable<?> value) {
        tableShardingValues.put(logicTable, value);
        databaseShardingOnly = false;
    }
972506
public void in(Object key, Object value, Integer type) throws SQLException {
        if (key instanceof Integer) {
            if (type == null) {
                base.setObject((Integer) key, value);
            } else {
                base.setObject((Integer) key, value, type);
            }
        } else {
            if (type == null) {
                base.setObject((String) key, value);
            } else {
                base.setObject((String) key, value, type);
            }
        }
    }
1150243
public static void init(SQLInputs sqlInputs) throws Exception {
        if (sqlInputs != null) {
            sqlInputs.setStrDelim(",");
            sqlInputs.setStrColumns("");
            sqlInputs.setLRows(new ArrayList<String>());
            sqlInputs.setIUpdateCount(0);
            sqlInputs.setSqlCommand(null);
            sqlInputs.setDbServer(null);
            sqlInputs.setDbName(null);
            sqlInputs.setDbType(null);
            sqlInputs.setUsername(null);
            sqlInputs.setPassword(null);
            sqlInputs.setAuthenticationType(null);
            sqlInputs.setDbUrl(null);
            sqlInputs.setDbClass(null);
            sqlInputs.setNetcool(false);
            sqlInputs.setLRowsFiles(new ArrayList<List<String>>());
            sqlInputs.setLRowsNames(new ArrayList<List<String>>());
            sqlInputs.setSkip(0L);
            sqlInputs.setInstance(null);
            sqlInputs.setTimeout(0);
            sqlInputs.setKey(null);
            sqlInputs.setIgnoreCase(false);
            sqlInputs.setResultSetConcurrency(-1000000);
            sqlInputs.setResultSetType(-1000000);
            sqlInputs.setTrustAllRoots(false);
            sqlInputs.setTrustStore("");
        } else throw new Exception("Cannot init null Sql inputs!");
    }
1177186
@Override
  public void setTransactionIsolation(int level) throws SQLException
  {
    logger.debug(
        "void setTransactionIsolation(int level), level = {}", level);
    raiseSQLExceptionIfConnectionIsClosed();
    if (level == Connection.TRANSACTION_NONE
        || level == Connection.TRANSACTION_READ_COMMITTED)
    {
      this.transactionIsolation = level;
    }
    else
    {
      throw new SQLFeatureNotSupportedException(
          "Transaction Isolation " + level + " not supported.",
          FEATURE_UNSUPPORTED.getSqlState(),
          FEATURE_UNSUPPORTED.getMessageCode());
    }
  }
1305775
public void commit() throws SQLException {
        if (useConnection == null) {
            LOG.info("Commit operation not supported when using datasets unless using withTransaction or cacheConnection - attempt to commit ignored");
            return;
        }
        try {
            useConnection.commit();
        } catch (SQLException e) {
            LOG.warning("Caught exception committing connection: " + e.getMessage());
            throw e;
        }
    }
1206030
public final void setAutoCommit(boolean value) throws SQLException 
    {
        if (value != currentAutoCommit || helper.alwaysSetAutoCommit()) 
        {
            if( (dsConfig.get().isolationLevel == Connection.TRANSACTION_NONE) && (value == false) )
                throw new SQLException(AdapterUtil.getNLSMessage("DSRA4010.tran.none.autocommit.required", dsConfig.get().id));
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "Set AutoCommit to " + value); 

            // Don't update values until AFTER the operation completes successfully on the
            // underlying Connection. 

            sqlConn.setAutoCommit(value); 
            currentAutoCommit = value; 
        }
        if (cachedConnection != null) 
            cachedConnection.setCurrentAutoCommit(currentAutoCommit, key);
    }
829121
private void setAnsiMode() throws SQLException {
        Statement s = conn.createStatement();
        s.executeUpdate("SET sql_mode = 'ansi'");
        s.close();
    }
1277992
public void setSqlSource(MappedStatement ms, MapperTemplate mapperTemplate) {
        try {
            if (mapperTemplate != null) {
                mapperTemplate.setSqlSource(ms);
            }
        } catch (Exception e) {
            throw new MapperException(e);
        }
    }
252128
public static void setEncryptionKey(final String key) {

		if (key == null) {

			logger.info("set_encryption_key() was called with null parameter, resetting global secret key");

			// reset hash
			secretKeyHash = null;
			return;
		}

		try {

			secretKeyHash = MessageDigest.getInstance(HASH_ALGO).digest(key.getBytes("UTF-8"));

		} catch (Throwable t) {
			logger.error("Unable to set secret key: {}", t.getMessage());
		}
	}
95611
public void update(final byte[] key, final U value) {
    if ((key == null) || (key.length == 0)) { return; }
    insertOrIgnore(MurmurHash3.hash(key, DEFAULT_UPDATE_SEED)[0] >>> 1, value);
  }
734950
public static DataSource createDataSource(
            final Map<String, DataSource> dataSourceMap, final ShardingRuleConfiguration shardingRuleConfig, final Properties props) throws SQLException {
        return new ShardingDataSource(dataSourceMap, new ShardingRule(shardingRuleConfig, dataSourceMap.keySet()), props);
    }
1017965
public void set(PropertyKey key, Object value, Source source) {
    Preconditions.checkArgument(key != null && value != null && !value.equals(""),
        String.format("The key value pair (%s, %s) cannot be null", key, value));
    Preconditions.checkArgument(!value.equals(""),
        String.format("The key \"%s\" cannot be have an empty string as a value. Use "
            + "ServerConfiguration.unset to remove a key from the configuration.", key));
    mProperties.put(key, String.valueOf(value), source);
  }
713722
private void setDbCodeCollection() {
        dbCodeCollection = new ArrayList<String>(shardingNum);
        int codeLength = Integer.toBinaryString(shardingNum - 1).length();
        for (int i = 0; i < shardingNum; i++) {
            String dbcode = Integer.toBinaryString(i);
            for (int j = dbcode.length(); j < codeLength; j++) {
                dbcode = "0" + dbcode;
            }
            dbCodeCollection.add(i, dbcode);
        }
    }
463477
public void setProperty(String key, String value)
	{
		if (properties == null)
			properties = new Hashtable<String, String>();
		properties.put(key, value);
	}
379505
public int updateId(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache)
			throws SQLException {
		if (mappedUpdateId == null) {
			mappedUpdateId = MappedUpdateId.build(dao, tableInfo);
		}
		int result = mappedUpdateId.execute(databaseConnection, data, newId, objectCache);
		if (dao != null && !localIsInBatchMode.get()) {
			dao.notifyChanges();
		}
		return result;
	}