use of org.apache.derby.iapi.jdbc.FailedProperties40 in project derby by apache.
the class EmbedConnection method setClientInfo.
/**
* <code>setClientInfo</code> will always throw a
* <code>SQLClientInfoException</code> since Derby does not support
* any properties.
*
* @param name a property key <code>String</code>
* @param value a property value <code>String</code>
* @exception SQLClientInfoException unless both name and value are null
*/
public void setClientInfo(String name, String value) throws SQLClientInfoException {
Properties p = FailedProperties40.makeProperties(name, value);
try {
checkIfClosed();
} catch (SQLException se) {
FailedProperties40 fp = new FailedProperties40(p);
throw new SQLClientInfoException(se.getMessage(), se.getSQLState(), se.getErrorCode(), fp.getProperties());
}
// arguments)
if (name == null && value == null) {
return;
}
setClientInfo(p);
}
use of org.apache.derby.iapi.jdbc.FailedProperties40 in project derby by apache.
the class EmbedConnection method setClientInfo.
/**
* <code>setClientInfo</code> will throw a
* <code>SQLClientInfoException</code> unless the <code>properties</code>
* parameter is empty, since Derby does not support any
* properties. All the property keys in the
* <code>properties</code> parameter are added to failedProperties
* of the exception thrown, with REASON_UNKNOWN_PROPERTY as the
* value.
*
* @param properties a <code>Properties</code> object with the
* properties to set
* @exception SQLClientInfoException unless properties parameter
* is null or empty
*/
public void setClientInfo(Properties properties) throws SQLClientInfoException {
FailedProperties40 fp = new FailedProperties40(properties);
try {
checkIfClosed();
} catch (SQLException se) {
throw new SQLClientInfoException(se.getMessage(), se.getSQLState(), se.getErrorCode(), fp.getProperties());
}
// An empty properties object is meaningless, but allowed
if (properties == null || properties.isEmpty()) {
return;
}
StandardException se = StandardException.newException(SQLState.PROPERTY_UNSUPPORTED_CHANGE, fp.getFirstKey(), fp.getFirstValue());
throw new SQLClientInfoException(se.getMessage(), se.getSQLState(), se.getErrorCode(), fp.getProperties());
}
Aggregations