Package com.mysql.cj.jdbc
Class ClientInfoProviderSP
java.lang.Object
com.mysql.cj.jdbc.ClientInfoProviderSP
- All Implemented Interfaces:
ClientInfoProvider
public class ClientInfoProviderSP extends java.lang.Object implements ClientInfoProvider
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPNAME_clientInfoDatabasestatic java.lang.StringPNAME_clientInfoGetBulkSPNamestatic java.lang.StringPNAME_clientInfoGetSPNamestatic java.lang.StringPNAME_clientInfoSetSPName -
Constructor Summary
Constructors Constructor Description ClientInfoProviderSP() -
Method Summary
Modifier and Type Method Description voiddestroy()Called once by the driver when the connection this provider instance belongs to is being closed.java.util.PropertiesgetClientInfo(java.sql.Connection conn)Returns the client info for the connection that this provider instance belongs to.java.lang.StringgetClientInfo(java.sql.Connection conn, java.lang.String name)Returns the client info for the connection that this provider instance belongs to.voidinitialize(java.sql.Connection conn, java.util.Properties configurationProps)Called once by the driver when it needs to configure the provider.voidsetClientInfo(java.sql.Connection conn, java.lang.String name, java.lang.String value)Sets the client info for the connection that this provider instance belongs to.voidsetClientInfo(java.sql.Connection conn, java.util.Properties properties)Sets the client info for the connection that this provider instance belongs to.
-
Field Details
-
PNAME_clientInfoSetSPName
public static final java.lang.String PNAME_clientInfoSetSPName- See Also:
- Constant Field Values
-
PNAME_clientInfoGetSPName
public static final java.lang.String PNAME_clientInfoGetSPName- See Also:
- Constant Field Values
-
PNAME_clientInfoGetBulkSPName
public static final java.lang.String PNAME_clientInfoGetBulkSPName- See Also:
- Constant Field Values
-
PNAME_clientInfoDatabase
public static final java.lang.String PNAME_clientInfoDatabase- See Also:
- Constant Field Values
-
-
Constructor Details
-
ClientInfoProviderSP
public ClientInfoProviderSP()
-
-
Method Details
-
initialize
public void initialize(java.sql.Connection conn, java.util.Properties configurationProps) throws java.sql.SQLExceptionDescription copied from interface:ClientInfoProviderCalled once by the driver when it needs to configure the provider.- Specified by:
initializein interfaceClientInfoProvider- Parameters:
conn- the connection that the provider belongs too.configurationProps- a java.util.Properties instance that contains configuration information for the connection.- Throws:
java.sql.SQLException- if initialization fails.
-
destroy
public void destroy() throws java.sql.SQLExceptionDescription copied from interface:ClientInfoProviderCalled once by the driver when the connection this provider instance belongs to is being closed. Implementations are expected to clean up and resources at this point in time.- Specified by:
destroyin interfaceClientInfoProvider- Throws:
java.sql.SQLException- if an error occurs.
-
getClientInfo
public java.util.Properties getClientInfo(java.sql.Connection conn) throws java.sql.SQLExceptionDescription copied from interface:ClientInfoProviderReturns the client info for the connection that this provider instance belongs to. The connection instance is passed as an argument for convenience's sake. Providers can use the connection to communicate with the database, but it will be within the scope of any ongoing transactions, so therefore implementations should not attempt to change isolation level, autocommit settings or call rollback() or commit() on the connection.- Specified by:
getClientInfoin interfaceClientInfoProvider- Parameters:
conn- connection object- Returns:
- client info as Properties
- Throws:
java.sql.SQLException- if an error occurs- See Also:
Connection.getClientInfo()
-
getClientInfo
public java.lang.String getClientInfo(java.sql.Connection conn, java.lang.String name) throws java.sql.SQLExceptionDescription copied from interface:ClientInfoProviderReturns the client info for the connection that this provider instance belongs to. The connection instance is passed as an argument for convenience's sake. Providers can use the connection to communicate with the database, but it will be within the scope of any ongoing transactions, so therefore implementations should not attempt to change isolation level, autocommit settings or call rollback() or commit() on the connection.- Specified by:
getClientInfoin interfaceClientInfoProvider- Parameters:
conn- connection objectname- property name- Returns:
- the client info by given property name
- Throws:
java.sql.SQLException- if an error occurs- See Also:
Connection.getClientInfo(java.lang.String)
-
setClientInfo
public void setClientInfo(java.sql.Connection conn, java.util.Properties properties) throws java.sql.SQLClientInfoExceptionDescription copied from interface:ClientInfoProviderSets the client info for the connection that this provider instance belongs to. The connection instance is passed as an argument for convenience's sake. Providers can use the connection to communicate with the database, but it will be within the scope of any ongoing transactions, so therefore implementations should not attempt to change isolation level, autocommit settings or call rollback() or commit() on the connection.- Specified by:
setClientInfoin interfaceClientInfoProvider- Parameters:
conn- connection objectproperties- Properties object- Throws:
java.sql.SQLClientInfoException- if an error occurs- See Also:
Connection.setClientInfo(java.util.Properties)
-
setClientInfo
public void setClientInfo(java.sql.Connection conn, java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoExceptionDescription copied from interface:ClientInfoProviderSets the client info for the connection that this provider instance belongs to. The connection instance is passed as an argument for convenience's sake. Providers can use the connection to communicate with the database, but it will be within the scope of any ongoing transactions, so therefore implementations should not attempt to change isolation level, autocommit settings or call rollback() or commit() on the connection.- Specified by:
setClientInfoin interfaceClientInfoProvider- Parameters:
conn- connection objectname- property namevalue- property value- Throws:
java.sql.SQLClientInfoException- if an error occurs- See Also:
Connection.setClientInfo(java.lang.String,java.lang.String)
-