Class JdbcSimpleSession

    • 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

      • JdbcSimpleSession

        public JdbcSimpleSession​(Connection connection)
        Creates a new instance.
        Parameters:
        connection - the connection to the database
      • JdbcSimpleSession

        public JdbcSimpleSession​(Connection connection,
                                 String name)
        Creates a new instance of this dynamic proxy.
        Parameters:
        connection - the connection to the database
        name - the name of the database
    • Method Detail

      • getConnection

        public Connection getConnection()
        Returns the internal connection to the database.
        Returns:
        the connection to the database
      • setConnection

        public void setConnection​(Connection connection)
        Sets the internal connection to the database.
        Parameters:
        connection - the connection to the database
      • executeBatch

        public int[] executeBatch​(String... statements)
                           throws SqlProcessorException
        Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.
        Specified by:
        executeBatch in interface SqlSession
        Parameters:
        statements - SQL statements to be executed in batch
        Returns:
        an array of update counts containing one element for each command in the batch
        Throws:
        SqlProcessorException - in the case of any problem in ORM or JDBC stack
      • getName

        public String getName()
        Description copied from interface: SqlSession
        The name of the database related to this session. It's usage is implementation specific.
        Specified by:
        getName in interface SqlSession
        Returns:
        the name of the database related to this session. It's usage is implementation specific.