Java Code Examples for java.sql.ClientInfoStatus

The following examples show how to use java.sql.ClientInfoStatus. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: gemfirexd-oss   Source File: FailedProperties40.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new <code>FailedProperties40</code> instance. Since
 * Derby doesn't support any properties, all the keys from the
 * <code>props</code> parameter are added to the
 * <code>failedProps_</code> member with value
 * REASON_UNKNOWN_PROPERTY.
 *
 * @param props a <code>Properties</code> value. Can be null or empty
 */   
public FailedProperties40(Properties props) {
    if (props == null || props.isEmpty()) {
        firstKey_ = null;
        firstValue_ = null;
        return;
    }
    Enumeration e = props.keys();
    firstKey_ = (String)e.nextElement();
    firstValue_ = props.getProperty(firstKey_);
    failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    while (e.hasMoreElements()) {
        failedProps_.put((String)e.nextElement(), 
                         ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
}
 
Example 2
Source Project: gemfirexd-oss   Source File: ClientConnection.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * <code>setClientInfo</code> will throw a <code>SQLClientInfoException</code>
 * uless the <code>properties</code> paramenter is empty, since GemFireXD does
 * not support any properties.
 */
@Override
public void setClientInfo(Properties properties)
    throws SQLClientInfoException {
  if (properties != null && !properties.isEmpty()) {
    HashMap<String, ClientInfoStatus> failedProperties =
        new HashMap<String, ClientInfoStatus>(properties.size());
    String firstKey = null;
    for (String key : properties.stringPropertyNames()) {
      if (firstKey == null) {
        firstKey = key;
      }
      failedProperties.put(key, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
    throw ThriftExceptionUtil.newSQLClientInfoException(
        SQLState.PROPERTY_UNSUPPORTED_CHANGE, failedProperties, null,
        firstKey, properties.getProperty(firstKey));
  }
}
 
Example 3
Source Project: gemfirexd-oss   Source File: FailedProperties40.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new <code>FailedProperties40</code> instance. Since
 * Derby doesn't support any properties, all the keys from the
 * <code>props</code> parameter are added to the
 * <code>failedProps_</code> member with value
 * REASON_UNKNOWN_PROPERTY.
 *
 * @param props a <code>Properties</code> value. Can be null or empty
 */
public FailedProperties40(Properties props) {
    if (props == null || props.isEmpty()) {
        firstKey_ = null;
        firstValue_ = null;
        return;
    }
    Enumeration e = props.keys();
    firstKey_ = (String)e.nextElement();
    firstValue_ = props.getProperty(firstKey_);
    failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    while (e.hasMoreElements()) {
        failedProps_.put((String)e.nextElement(), 
    ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
}
 
Example 4
Source Project: gemfirexd-oss   Source File: FailedProperties40.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new <code>FailedProperties40</code> instance. Since
 * Derby doesn't support any properties, all the keys from the
 * <code>props</code> parameter are added to the
 * <code>failedProps_</code> member with value
 * REASON_UNKNOWN_PROPERTY.
 *
 * @param props a <code>Properties</code> value. Can be null or empty
 */   
public FailedProperties40(Properties props) {
    if (props == null || props.isEmpty()) {
        firstKey_ = null;
        firstValue_ = null;
        return;
    }
    Enumeration e = props.keys();
    firstKey_ = (String)e.nextElement();
    firstValue_ = props.getProperty(firstKey_);
    failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    while (e.hasMoreElements()) {
        failedProps_.put((String)e.nextElement(), 
                         ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
}
 
Example 5
Source Project: gemfirexd-oss   Source File: ClientConnection.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * <code>setClientInfo</code> will throw a <code>SQLClientInfoException</code>
 * uless the <code>properties</code> paramenter is empty, since GemFireXD does
 * not support any properties.
 */
@Override
public void setClientInfo(Properties properties)
    throws SQLClientInfoException {
  if (properties != null && !properties.isEmpty()) {
    HashMap<String, ClientInfoStatus> failedProperties =
        new HashMap<String, ClientInfoStatus>(properties.size());
    String firstKey = null;
    for (String key : properties.stringPropertyNames()) {
      if (firstKey == null) {
        firstKey = key;
      }
      failedProperties.put(key, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
    throw ThriftExceptionUtil.newSQLClientInfoException(
        SQLState.PROPERTY_UNSUPPORTED_CHANGE, failedProperties, null,
        firstKey, properties.getProperty(firstKey));
  }
}
 
Example 6
Source Project: gemfirexd-oss   Source File: FailedProperties40.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new <code>FailedProperties40</code> instance. Since
 * Derby doesn't support any properties, all the keys from the
 * <code>props</code> parameter are added to the
 * <code>failedProps_</code> member with value
 * REASON_UNKNOWN_PROPERTY.
 *
 * @param props a <code>Properties</code> value. Can be null or empty
 */
public FailedProperties40(Properties props) {
    if (props == null || props.isEmpty()) {
        firstKey_ = null;
        firstValue_ = null;
        return;
    }
    Enumeration e = props.keys();
    firstKey_ = (String)e.nextElement();
    firstValue_ = props.getProperty(firstKey_);
    failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    while (e.hasMoreElements()) {
        failedProps_.put((String)e.nextElement(), 
    ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
}
 
Example 7
/**
 * Creates a new <code>FailedProperties40</code> instance. Since
 * Derby doesn't support any properties, all the keys from the
 * <code>props</code> parameter are added to the
 * <code>failedProps_</code> member with value
 * REASON_UNKNOWN_PROPERTY.
 *
 * @param props a <code>Properties</code> value. Can be null or empty
 */   
public FailedProperties40(Properties props) {
    if (props == null || props.isEmpty()) {
        firstKey_ = null;
        firstValue_ = null;
        return;
    }
    Enumeration e = props.keys();
    firstKey_ = (String)e.nextElement();
    firstValue_ = props.getProperty(firstKey_);
    failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    while (e.hasMoreElements()) {
        failedProps_.put((String)e.nextElement(), 
                         ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
}
 
Example 8
/**
 * Creates a new <code>FailedProperties40</code> instance. Since
 * Derby doesn't support any properties, all the keys from the
 * <code>props</code> parameter are added to the
 * <code>failedProps_</code> member with value
 * REASON_UNKNOWN_PROPERTY.
 *
 * @param props a <code>Properties</code> value. Can be null or empty
 */
public FailedProperties40(Properties props) {
    if (props == null || props.isEmpty()) {
        firstKey_ = null;
        firstValue_ = null;
        return;
    }
    Enumeration e = props.keys();
    firstKey_ = (String)e.nextElement();
    firstValue_ = props.getProperty(firstKey_);
    failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    while (e.hasMoreElements()) {
        failedProps_.put((String)e.nextElement(), 
    ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
}
 
Example 9
Source Project: gemfirexd-oss   Source File: ThriftExceptionUtil.java    License: Apache License 2.0 5 votes vote down vote up
public static SQLClientInfoException newSQLClientInfoException(
    String sqlState, Map<String, ClientInfoStatus> failedProperties,
    Throwable t, Object... args) {
  return new SQLClientInfoException(getMessageUtil().getCompleteMessage(
      sqlState, args), getSQLStateFromIdentifier(sqlState),
      getSeverityFromIdentifier(sqlState), failedProperties, t);
}
 
Example 10
Source Project: gemfirexd-oss   Source File: ClientConnection.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * <code>setClientInfo</code> will always throw a
 * <code>SQLClientInfoException</code> since GemFireXD does not support any
 * properties.
 */
@Override
public void setClientInfo(String name, String value)
    throws SQLClientInfoException {
  if (name != null || value != null) {
    HashMap<String, ClientInfoStatus> failedProperties =
        new HashMap<String, ClientInfoStatus>(1);
    if (name != null) {
      failedProperties.put(name, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
    throw ThriftExceptionUtil.newSQLClientInfoException(
        SQLState.PROPERTY_UNSUPPORTED_CHANGE, failedProperties, null, name,
        value);
  }
}
 
Example 11
Source Project: snowflake-jdbc   Source File: SnowflakeConnectionV1.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setClientInfo(Properties properties)
throws SQLClientInfoException
{
  Map<String, ClientInfoStatus> failedProps = new HashMap<>();
  Enumeration<?> propList = properties.propertyNames();
  while (propList.hasMoreElements())
  {
    String name = (String) propList.nextElement();
    failedProps.put(name, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
  }
  raiseSetClientInfoException(failedProps);
}
 
Example 12
Source Project: snowflake-jdbc   Source File: SnowflakeConnectionV1.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setClientInfo(String name, String value)
throws SQLClientInfoException
{
  Map<String, ClientInfoStatus> failedProps = new HashMap<>();
  failedProps.put(name, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
  raiseSetClientInfoException(failedProps);
}
 
Example 13
Source Project: snowflake-jdbc   Source File: SnowflakeConnectionV1.java    License: Apache License 2.0 5 votes vote down vote up
private void raiseSetClientInfoException(Map<String, ClientInfoStatus> failedProps) throws SQLClientInfoException
{
  if (isClosed)
  {
    throw new SQLClientInfoException(
        "The connection is not opened.",
        ErrorCode.CONNECTION_CLOSED.getSqlState(),
        ErrorCode.CONNECTION_CLOSED.getMessageCode(), failedProps);
  }

  throw new SQLClientInfoException(
      "The client property cannot be set by setClientInfo.",
      ErrorCode.INVALID_PARAMETER_VALUE.getSqlState(),
      ErrorCode.INVALID_PARAMETER_VALUE.getMessageCode(), failedProps);
}
 
Example 14
Source Project: gemfirexd-oss   Source File: ThriftExceptionUtil.java    License: Apache License 2.0 5 votes vote down vote up
public static SQLClientInfoException newSQLClientInfoException(
    String sqlState, Map<String, ClientInfoStatus> failedProperties,
    Throwable t, Object... args) {
  return new SQLClientInfoException(getMessageUtil().getCompleteMessage(
      sqlState, args), getSQLStateFromIdentifier(sqlState),
      getSeverityFromIdentifier(sqlState), failedProperties, t);
}
 
Example 15
Source Project: gemfirexd-oss   Source File: ClientConnection.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * <code>setClientInfo</code> will always throw a
 * <code>SQLClientInfoException</code> since GemFireXD does not support any
 * properties.
 */
@Override
public void setClientInfo(String name, String value)
    throws SQLClientInfoException {
  if (name != null || value != null) {
    HashMap<String, ClientInfoStatus> failedProperties =
        new HashMap<String, ClientInfoStatus>(1);
    if (name != null) {
      failedProperties.put(name, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    }
    throw ThriftExceptionUtil.newSQLClientInfoException(
        SQLState.PROPERTY_UNSUPPORTED_CHANGE, failedProperties, null, name,
        value);
  }
}
 
Example 16
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 17
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 18
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 19
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 20
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 21
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 22
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 23
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 24
public SQLClientInfoExceptionTests() {
    map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
    map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
 
Example 25
Source Project: gemfirexd-oss   Source File: FailedProperties40.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <code>getProperties</code> provides a
 * <code>Map<String,ClientInfoStatus></code> object describing the
 * failed properties (as specified in the javadoc for
 * java.sql.SQLClientInfoException).
 *
 * @return a <code>Map<String,ClientInfoStatus></code> object with
 * the failed property keys and the reason why each failed
 */
public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }
 
Example 26
Source Project: gemfirexd-oss   Source File: FailedProperties40.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <code>getProperties</code> provides a
 * <code>Map<String,ClientInfoStatus></code> object describing the
 * failed properties (as specified in the javadoc for
 * java.sql.SQLClientInfoException).
 *
 * @return a <code>Map<String,ClientInfoStatus></code> object with
 * the failed property keys and the reason why each failed
 */
public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }
 
Example 27
Source Project: gemfirexd-oss   Source File: FailedProperties40.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <code>getProperties</code> provides a
 * <code>Map<String,ClientInfoStatus></code> object describing the
 * failed properties (as specified in the javadoc for
 * java.sql.SQLClientInfoException).
 *
 * @return a <code>Map<String,ClientInfoStatus></code> object with
 * the failed property keys and the reason why each failed
 */
public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }
 
Example 28
Source Project: gemfirexd-oss   Source File: FailedProperties40.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <code>getProperties</code> provides a
 * <code>Map<String,ClientInfoStatus></code> object describing the
 * failed properties (as specified in the javadoc for
 * java.sql.SQLClientInfoException).
 *
 * @return a <code>Map<String,ClientInfoStatus></code> object with
 * the failed property keys and the reason why each failed
 */
public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }
 
Example 29
/**
 * <code>getProperties</code> provides a
 * <code>Map<String,ClientInfoStatus></code> object describing the
 * failed properties (as specified in the javadoc for
 * java.sql.SQLClientInfoException).
 *
 * @return a <code>Map<String,ClientInfoStatus></code> object with
 * the failed property keys and the reason why each failed
 */
public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }
 
Example 30
/**
 * <code>getProperties</code> provides a
 * <code>Map<String,ClientInfoStatus></code> object describing the
 * failed properties (as specified in the javadoc for
 * java.sql.SQLClientInfoException).
 *
 * @return a <code>Map<String,ClientInfoStatus></code> object with
 * the failed property keys and the reason why each failed
 */
public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }