Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.sqlproc.engine.spring;
 
The Spring stack implementation of the SQL Engine session contract. In fact it's a simple wrapper for the org.springframework.jdbc.core.JdbcTemplate. It's the first parameter to all primary methods in the org.sqlproc.engine.SqlQueryEngine and org.sqlproc.engine.SqlCrudEngine.

The primary contract is the method for the org.sqlproc.engine.SqlQuery instance creation.

For more info please see the Tutorials.

Author(s):
Vladimir Hudec
public class SpringSimpleSession implements SqlSession {

    
The Spring JdbcTemplate, the central class for all Spring database operations.
    JdbcTemplate jdbcTemplate;

    
The name of the database related to this session. It's usage is implementation specific.
    private String name;

    
Creates a new instance.

Parameters:
jdbcTemplate the Spring JdbcTemplate instance
    public SpringSimpleSession(JdbcTemplate jdbcTemplate) {
        this. = jdbcTemplate;
    }

    
Creates a new instance.

Parameters:
jdbcTemplate the Spring JdbcTemplate instance
name the name of the database
    public SpringSimpleSession(JdbcTemplate jdbcTemplateString name) {
        this(jdbcTemplate);
        this. = name;
    }

    
Returns the internal Spring JdbcTemplate instance.

Returns:
the internal Spring JdbcTemplate instance
    public JdbcTemplate getJdbcTemplate() {
        return ;
    }

    
    @Override
    public SqlQuery createSqlQuery(String queryStringthrows SqlProcessorException {
        return new SpringQuery(queryString);
    }

    
    @Override
    public int[] executeBatch(String[] statementsthrows SqlProcessorException {
        SqlQuery sqlQuery = createSqlQuery(null);
        return sqlQuery.executeBatch(statements);
    }

    

Returns:
the name of the database related to this session. It's usage is implementation specific.
    public String getName() {
        return ;
    }
New to GrepCode? Check out our FAQ X