case class JdbcTableConnection(id: ConnectionId, url: String, driver: String, authMode: Option[AuthMode] = None, db: Option[String] = None, maxParallelConnections: Int = 1, connectionPoolMaxIdleTimeSec: Int = 3, metadata: Option[ConnectionMetadata] = None) extends Connection with SmartDataLakeLogger with Product with Serializable
Connection information for jdbc tables. If authentication is needed, user and password must be provided.
- id
unique id of this connection
- url
jdbc connection url
- driver
class name of jdbc driver
- authMode
optional authentication information: for now BasicAuthMode is supported.
- db
jdbc database
- maxParallelConnections
number of parallel jdbc connections created by an instance of this connection Note that Spark manages JDBC Connections on its own. This setting only applies to JDBC connection used by SDL for validating metadata or pre/postSQL.
- connectionPoolMaxIdleTimeSec
timeout to close unused connections in the pool
- Annotations
- @Scaladoc()
- Alphabetic
- By Inheritance
- JdbcTableConnection
- Serializable
- Serializable
- Product
- Equals
- SmartDataLakeLogger
- Connection
- AtlasExportable
- ParsableFromConfig
- SdlConfigObject
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
JdbcTableConnection(id: ConnectionId, url: String, driver: String, authMode: Option[AuthMode] = None, db: Option[String] = None, maxParallelConnections: Int = 1, connectionPoolMaxIdleTimeSec: Int = 3, metadata: Option[ConnectionMetadata] = None)
- id
unique id of this connection
- url
jdbc connection url
- driver
class name of jdbc driver
- authMode
optional authentication information: for now BasicAuthMode is supported.
- db
jdbc database
- maxParallelConnections
number of parallel jdbc connections created by an instance of this connection Note that Spark manages JDBC Connections on its own. This setting only applies to JDBC connection used by SDL for validating metadata or pre/postSQL.
- connectionPoolMaxIdleTimeSec
timeout to close unused connections in the pool
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
atlasName: String
- Definition Classes
- Connection → AtlasExportable
-
def
atlasQualifiedName(prefix: String): String
- Definition Classes
- AtlasExportable
- val authMode: Option[AuthMode]
- val catalog: JdbcCatalog
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
- val connectionPoolMaxIdleTimeSec: Int
-
def
createTableFromSchema(tableName: String, schema: StructType, rawOptions: Map[String, String])(implicit session: SparkSession): Unit
Code partly copied from Spark:JdbcUtils to adapt schemaString method to not quote identifiers if Spark is in case-insensitive mode.
Code partly copied from Spark:JdbcUtils to adapt schemaString method to not quote identifiers if Spark is in case-insensitive mode.
- Annotations
- @Scaladoc()
- val db: Option[String]
- val driver: String
- def dropTable(tableName: String, logging: Boolean = true): Boolean
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
execJdbcQuery[A](sql: String, evalResultSet: (ResultSet) ⇒ A): A
Execute an SQL query and evaluate its ResultSet
Execute an SQL query and evaluate its ResultSet
- sql
sql query to execute
- evalResultSet
function to evaluate the JDBC ResultSet
- returns
the evaluated result
- Annotations
- @Scaladoc()
-
def
execJdbcStatement(sql: String, logging: Boolean = true, doCommit: Boolean = false): Boolean
Execute an SQL statement
Execute an SQL statement
- returns
true if the first result is a ResultSet object; false if it is an update count or there are no results
- Annotations
- @Scaladoc()
-
def
execWithJdbcConnection[A](func: (java.sql.Connection) ⇒ A): A
Get a connection from the pool and execute an arbitrary function
Get a connection from the pool and execute an arbitrary function
- Annotations
- @Scaladoc()
-
def
execWithJdbcStatement[A](doCommit: Boolean = false)(func: (Statement) ⇒ A): A
Get a JDBC connection from the pool, create a JDBC statement and execute an arbitrary function
Get a JDBC connection from the pool, create a JDBC statement and execute an arbitrary function
- Annotations
- @Scaladoc()
-
def
factory: FromConfigFactory[Connection]
Returns the factory that can parse this type (that is, type
CO).Returns the factory that can parse this type (that is, type
CO).Typically, implementations of this method should return the companion object of the implementing class. The companion object in turn should implement FromConfigFactory.
- returns
the factory (object) for this class.
- Definition Classes
- JdbcTableConnection → ParsableFromConfig
- def getAuthModeSparkOptions: Map[String, String]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
val
id: ConnectionId
A unique identifier for this instance.
A unique identifier for this instance.
- Definition Classes
- JdbcTableConnection → Connection → SdlConfigObject
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
logger: Logger
- Attributes
- protected
- Definition Classes
- SmartDataLakeLogger
- Annotations
- @transient()
- val maxParallelConnections: Int
-
val
metadata: Option[ConnectionMetadata]
Additional metadata for the Connection
Additional metadata for the Connection
- Definition Classes
- JdbcTableConnection → Connection
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val pool: GenericObjectPool[java.sql.Connection]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def test(): Unit
-
def
toStringShort: String
- Definition Classes
- Connection
- val url: String
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated