Class SqlConnection
- java.lang.Object
-
- io.vertigo.database.sql.connection.SqlConnection
-
- All Implemented Interfaces:
VTransactionResource,AutoCloseable
public final class SqlConnection extends Object implements VTransactionResource
Connexion à une base de données JDBC. Une connexion est une ressource qui participe à la transaction. Le commit (ou rollback) de la transaction commit (ou rollback) les différentes resources participant à la transaction puis libére (release) les différentes ressources.- Author:
- pchretien, npiedeloup
-
-
Constructor Summary
Constructors Constructor Description SqlConnection(Connection jdbcConnection, SqlDataBase dataBase)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcommit()SqlDataBasegetDataBase()ConnectiongetJdbcConnection()Retourne la connexion JDBC.voidrollback()
-
-
-
Constructor Detail
-
SqlConnection
public SqlConnection(Connection jdbcConnection, SqlDataBase dataBase) throws SQLException
Constructor.- Parameters:
jdbcConnection- Connexion JDBCdataBase- Base de données- Throws:
SQLException- Exception sql
-
-
Method Detail
-
getJdbcConnection
public Connection getJdbcConnection()
Retourne la connexion JDBC.- Returns:
- Connexion JDBC
-
getDataBase
public SqlDataBase getDataBase()
- Returns:
- Base de données dont est issue la connexion.
-
commit
public void commit() throws SQLException- Specified by:
commitin interfaceVTransactionResource- Throws:
SQLException
-
rollback
public void rollback() throws SQLException- Specified by:
rollbackin interfaceVTransactionResource- Throws:
SQLException
-
close
public void close() throws SQLException- Specified by:
closein interfaceAutoCloseable- Throws:
SQLException
-
-