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 void
close()
void
commit()
SqlDataBase
getDataBase()
Connection
getJdbcConnection()
Retourne la connexion JDBC.void
rollback()
-
-
-
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:
commit
in interfaceVTransactionResource
- Throws:
SQLException
-
rollback
public void rollback() throws SQLException
- Specified by:
rollback
in interfaceVTransactionResource
- Throws:
SQLException
-
close
public void close() throws SQLException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
SQLException
-
-