database.DBTransaction.kt Maven / Gradle / Ivy
package database
import java.sql.Connection
/**
* 数据库事务类
* @property db DB 数据库类型
* @property conn Connection? 数据库连接
* @property isTransaction Boolean 值为true,代表是事务操作
* @constructor
*/
class DBTransaction(override var db: DB, var conn: Connection? = null) : DataBaseImpl() {
override val isTransaction: Boolean = true
/**
* 获取一个数据库连接
* @return Connection 数据库连接
*/
override fun getConnection(): Connection {
return this.conn!!
}
}