Package org.sqlproc.engine.jdbc
Class JdbcSessionFactory
- java.lang.Object
-
- org.sqlproc.engine.jdbc.JdbcSessionFactory
-
- All Implemented Interfaces:
SqlSessionFactory
public class JdbcSessionFactory extends Object implements SqlSessionFactory
The simple implementation of the factorySqlSessionFactory
for the JDBC stack.For more info please see the Tutorials.
- Author:
- Vladimir Hudec
-
-
Field Summary
Fields Modifier and Type Field Description private Connection
connection
The connection to the database.private String
name
The name of the database related to this session.
-
Constructor Summary
Constructors Constructor Description JdbcSessionFactory(Connection connection)
Creates a new instance.JdbcSessionFactory(Connection connection, String name)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlSession
getSqlSession()
The main contract of this factory.
-
-
-
Field Detail
-
connection
private Connection connection
The connection to the database. It should be opened.
-
name
private String name
The name of the database related to this session. It's usage is implementation specific.
-
-
Constructor Detail
-
JdbcSessionFactory
public JdbcSessionFactory(Connection connection)
Creates a new instance.- Parameters:
connection
- the connection to the database
-
JdbcSessionFactory
public JdbcSessionFactory(Connection connection, String name)
Creates a new instance.- Parameters:
connection
- the connection to the databasename
- the name of the database related to this session
-
-
Method Detail
-
getSqlSession
public SqlSession getSqlSession()
The main contract of this factory.- Specified by:
getSqlSession
in interfaceSqlSessionFactory
- Returns:
- the instance of the SqlSession
-
-