public class JdbcSimpleSession extends Object implements SqlSession
Connection.
It's the first parameter to all primary methods in the SqlQueryEngine and SqlCrudEngine.
The primary contract is the method for the SqlQuery instance creation.
For more info please see the Tutorials.
| Modifier and Type | Field and Description |
|---|---|
private Connection |
connection
The connection to the database.
|
private String |
name
The name of the database related to this session.
|
| Constructor and Description |
|---|
JdbcSimpleSession(Connection connection)
Creates a new instance.
|
JdbcSimpleSession(Connection connection,
String name)
Creates a new instance of this dynamic proxy.
|
| Modifier and Type | Method and Description |
|---|---|
SqlQuery |
createSqlQuery(String queryString)
Creates a new instance of
SqlQuery, which is a wrapper around the SQL query command. |
int[] |
executeBatch(String... statements)
Submits a batch of commands to the database for execution and if all commands execute successfully, returns an
array of update counts.
|
Connection |
getConnection()
Returns the internal connection to the database.
|
String |
getName()
The name of the database related to this session.
|
private Connection connection
private String name
public JdbcSimpleSession(Connection connection)
connection - the connection to the databasepublic JdbcSimpleSession(Connection connection, String name)
connection - the connection to the databasename - the name of the databasepublic Connection getConnection()
public SqlQuery createSqlQuery(String queryString) throws SqlProcessorException
SqlQuery, which is a wrapper around the SQL query command.createSqlQuery in interface SqlSessionqueryString - the SQL query commandSqlProcessorException - in the case of any problem in ORM or JDBC stackpublic int[] executeBatch(String... statements) throws SqlProcessorException
executeBatch in interface SqlSessionstatements - SQL statements to be executed in batchSqlProcessorException - in the case of any problem in ORM or JDBC stackpublic String getName()
SqlSessiongetName in interface SqlSessionCopyright © 2016. All rights reserved.