下面列出了怎么用java.sql.ClientInfoStatus的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* 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);
}
}
/**
* <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));
}
}
/**
* 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);
}
}
/**
* 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);
}
}
/**
* <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));
}
}
/**
* 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);
}
}
/**
* 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);
}
}
/**
* 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);
}
}
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);
}
/**
* <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);
}
}
@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);
}
@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);
}
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);
}
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);
}
/**
* <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);
}
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
public SQLClientInfoExceptionTests() {
map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
}
/**
* <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_; }
/**
* <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_; }
/**
* <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_; }
/**
* <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_; }
/**
* <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_; }
/**
* <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_; }