public class SQLClientInfoException
extends SQLException
java.lang.Object | ||||
↳ | java.lang.Throwable | |||
↳ | java.lang.Exception | |||
↳ | java.sql.SQLException | |||
↳ | java.sql.SQLClientInfoException |
的子类SQLException
当一个或多个客户端信息属性不能在设置抛出Connection
。 除了SQLClientInfoException
提供的信息SQLException
, SQLClientInfoException
还提供了未设置的客户端信息属性列表。 某些数据库不允许以原子方式设置多个客户端信息属性。 对于这些数据库,即使Connection.setClientInfo
方法引发异常,也可能会设置一些客户端信息属性。 应用程序可以使用getFailedProperties
方法来检索未设置的客户端信息属性列表。 属性通过将Map<String,ClientInfoStatus>
传递给适当的SQLClientInfoException
构造函数来标识。
Public constructors |
|
---|---|
SQLClientInfoException() 构造一个 |
|
SQLClientInfoException(Map<String, ClientInfoStatus> failedProperties) 构造一个用给定的 |
|
SQLClientInfoException(Map<String, ClientInfoStatus> failedProperties, Throwable cause) 构造一个用给定的 |
|
SQLClientInfoException(String reason, Map<String, ClientInfoStatus> failedProperties) 构造一个使用给定的 |
|
SQLClientInfoException(String reason, Map<String, ClientInfoStatus> failedProperties, Throwable cause) 构造一个 |
|
SQLClientInfoException(String reason, String SQLState, Map<String, ClientInfoStatus> failedProperties) 构造一个 |
|
SQLClientInfoException(String reason, String SQLState, Map<String, ClientInfoStatus> failedProperties, Throwable cause) 构造一个 |
|
SQLClientInfoException(String reason, String SQLState, int vendorCode, Map<String, ClientInfoStatus> failedProperties) 构造一个 |
|
SQLClientInfoException(String reason, String SQLState, int vendorCode, Map<String, ClientInfoStatus> failedProperties, Throwable cause) 构造一个 |
Public methods |
|
---|---|
Map<String, ClientInfoStatus> |
getFailedProperties() 返回无法设置的客户端信息属性列表。 |
Inherited methods |
|
---|---|
From class java.sql.SQLException
|
|
From class java.lang.Throwable
|
|
From class java.lang.Object
|
|
From interface java.lang.Iterable
|
SQLClientInfoException ()
构造一个SQLClientInfoException
对象。 的reason
, SQLState
,和failedProperties列表被初始化为null
和供应商代码被初始化为0。 cause
没有初始化,随后可以通过向一个呼叫进行初始化initCause(java.lang.Throwable)
方法。
SQLClientInfoException (Map<String, ClientInfoStatus> failedProperties)
构造一个用给定的failedProperties
初始化的SQLClientInfoException
对象。 reason
和SQLState
被初始化为null
,并且供应商代码被初始化为cause
未被初始化,并且随后可以通过调用initCause(java.lang.Throwable)
方法来初始化。
Parameters | |
---|---|
failedProperties |
Map : A Map containing the property values that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus |
SQLClientInfoException (Map<String, ClientInfoStatus> failedProperties, Throwable cause)
构造一个使用给定的cause
和failedProperties
初始化的SQLClientInfoException
对象。 reason
初始化为null
如果为cause==null
或cause.toString()
如果cause!=null
且供应商代码初始化为0)。
Parameters | |
---|---|
failedProperties |
Map : A Map containing the property values that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus |
cause |
Throwable : the (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown. |
SQLClientInfoException (String reason, Map<String, ClientInfoStatus> failedProperties)
构造一个用给定的reason
和failedProperties
初始化的SQLClientInfoException
对象。 SQLState
初始化为null
,并且供应商代码初始化为0. cause
未初始化,并可能随后通过调用initCause(java.lang.Throwable)
方法进行初始化。
Parameters | |
---|---|
reason |
String : a description of the exception |
failedProperties |
Map : A Map containing the property values that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus |
SQLClientInfoException (String reason, Map<String, ClientInfoStatus> failedProperties, Throwable cause)
构造一个SQLClientInfoException
与给定的初始化的对象reason
, cause
和failedProperties
。 SQLState
初始化为null
,供应商代码初始化为0。
Parameters | |
---|---|
reason |
String : a description of the exception |
failedProperties |
Map : A Map containing the property values that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus |
cause |
Throwable : the underlying reason for this SQLException (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown. |
SQLClientInfoException (String reason, String SQLState, Map<String, ClientInfoStatus> failedProperties)
Constructs a SQLClientInfoException
object initialized with a given reason
, SQLState
and failedProperties
. The cause
is not initialized, and may subsequently be initialized by a call to the initCause(java.lang.Throwable)
method. The vendor code is initialized to 0.
Parameters | |
---|---|
reason |
String : a description of the exception |
SQLState |
String : an XOPEN or SQL:2003 code identifying the exception |
failedProperties |
Map : A Map containing the property values that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus |
SQLClientInfoException (String reason, String SQLState, Map<String, ClientInfoStatus> failedProperties, Throwable cause)
构造一个SQLClientInfoException
与给定的初始化的对象reason
, SQLState
, cause
和failedProperties
。 供应商代码初始化为0。
Parameters | |
---|---|
reason |
String : a description of the exception |
SQLState |
String : an XOPEN or SQL:2003 code identifying the exception |
failedProperties |
Map : A Map containing the property values that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus |
cause |
Throwable : the underlying reason for this SQLException (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown. |
SQLClientInfoException (String reason, String SQLState, int vendorCode, Map<String, ClientInfoStatus> failedProperties)
构造一个SQLClientInfoException
与给定的初始化的对象reason
, SQLState
, vendorCode
和failedProperties
。 cause
未初始化,并可能随后通过调用initCause(java.lang.Throwable)
方法进行初始化。
Parameters | |
---|---|
reason |
String : a description of the exception |
SQLState |
String : an XOPEN or SQL:2003 code identifying the exception |
vendorCode |
int : a database vendor-specific exception code |
failedProperties |
Map : A Map containing the property values that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus |
SQLClientInfoException (String reason, String SQLState, int vendorCode, Map<String, ClientInfoStatus> failedProperties, Throwable cause)
构造一个 SQLClientInfoException
与给定的初始化的对象 reason
, SQLState
, cause
, vendorCode
和 failedProperties
。
Parameters | |
---|---|
reason |
String : a description of the exception |
SQLState |
String : an XOPEN or SQL:2003 code identifying the exception |
vendorCode |
int : a database vendor-specific exception code |
failedProperties |
Map : A Map containing the property values that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus |
cause |
Throwable : the underlying reason for this SQLException (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown. |
Map<String, ClientInfoStatus> getFailedProperties ()
Returns the list of client info properties that could not be set. The keys in the Map contain the names of the client info properties that could not be set and the values contain one of the reason codes defined in ClientInfoStatus
Returns | |
---|---|
Map<String, ClientInfoStatus> |
Map list containing the client info properties that could not be set |