类 SimpleJdbcConnectionProvider
- java.lang.Object
-
- org.apache.seatunnel.connectors.seatunnel.jdbc.internal.connection.SimpleJdbcConnectionProvider
-
- 所有已实现的接口:
Serializable,JdbcConnectionProvider
- 直接已知子类:
HiveJdbcConnectionProvider
public class SimpleJdbcConnectionProvider extends Object implements JdbcConnectionProvider, Serializable
Simple JDBC connection provider.- 另请参阅:
- 序列化表格
-
-
字段概要
字段 修饰符和类型 字段 说明 protected Connectionconnectionprotected JdbcConnectionConfigjdbcConfig
-
构造器概要
构造器 构造器 说明 SimpleJdbcConnectionProvider(@NonNull JdbcConnectionConfig jdbcConfig)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcloseConnection()Close possible existing connection.ConnectiongetConnection()Get existing connection.JdbcConnectionConfiggetJdbcConfig()protected DrivergetLoadedDriver()ConnectiongetOrEstablishConnection()Get existing connection or establish an new one if there is none.booleanisConnectionValid()Check whether possible existing connection is valid or not throughConnection.isValid(int).ConnectionreestablishConnection()Close possible existing connection and establish an new one.voidsetConnection(Connection connection)
-
-
-
字段详细资料
-
jdbcConfig
protected final JdbcConnectionConfig jdbcConfig
-
connection
protected transient Connection connection
-
-
构造器详细资料
-
SimpleJdbcConnectionProvider
public SimpleJdbcConnectionProvider(@NonNull @NonNull JdbcConnectionConfig jdbcConfig)
-
-
方法详细资料
-
getConnection
public Connection getConnection()
从接口复制的说明:JdbcConnectionProviderGet existing connection.- 指定者:
getConnection在接口中JdbcConnectionProvider- 返回:
- existing connection
-
isConnectionValid
public boolean isConnectionValid() throws SQLException从接口复制的说明:JdbcConnectionProviderCheck whether possible existing connection is valid or not throughConnection.isValid(int).- 指定者:
isConnectionValid在接口中JdbcConnectionProvider- 返回:
- true if existing connection is valid
- 抛出:
SQLException- sql exception throw fromConnection.isValid(int)
-
getLoadedDriver
protected Driver getLoadedDriver() throws SQLException, ClassNotFoundException
-
getOrEstablishConnection
public Connection getOrEstablishConnection() throws SQLException, ClassNotFoundException
从接口复制的说明:JdbcConnectionProviderGet existing connection or establish an new one if there is none.- 指定者:
getOrEstablishConnection在接口中JdbcConnectionProvider- 返回:
- existing connection or newly established connection
- 抛出:
SQLException- sql exceptionClassNotFoundException- driver class not found
-
closeConnection
public void closeConnection()
从接口复制的说明:JdbcConnectionProviderClose possible existing connection.- 指定者:
closeConnection在接口中JdbcConnectionProvider
-
reestablishConnection
public Connection reestablishConnection() throws SQLException, ClassNotFoundException
从接口复制的说明:JdbcConnectionProviderClose possible existing connection and establish an new one.- 指定者:
reestablishConnection在接口中JdbcConnectionProvider- 返回:
- newly established connection
- 抛出:
SQLException- sql exceptionClassNotFoundException- driver class not found
-
getJdbcConfig
public JdbcConnectionConfig getJdbcConfig()
-
setConnection
public void setConnection(Connection connection)
-
-