Class PreparedStatementManagerImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int executeUpdate​(java.sql.PreparedStatement stmnt, java.lang.String sql, RowImpl row)
      This method is to provide override for non-JDBC or JDBC-like implementation of executing update.
      void flush()
      This method must be called after the last row has been flushed, to flush any remaining statements.
      void flush​(RowImpl row)
      Flush the given row.
      protected void flushAndUpdate​(RowImpl row)
      Flush the given row immediately.
      protected void flushInternal​(RowImpl row)
      Flush the given row.
      protected java.lang.String[] getAutoAssignColNames​(Column[] autoAssign, RowImpl row)  
      protected Column[] getAutoAssignColumns​(RowImpl row)  
      java.util.Collection<java.lang.Exception> getExceptions()
      Return the exceptions encountered during all flushes.
      protected java.util.List<java.lang.Object> getGeneratedKeys​(java.sql.PreparedStatement stmnt, java.lang.String[] autoAssignColNames)
      This method will only be called when the database supports getGeneratedKeys.
      protected java.util.List<java.lang.Object> getGeneratedKeys​(java.sql.PreparedStatement stmnt, DBIdentifier[] autoAssignColNames)  
      protected void logSQLWarnings​(java.sql.PreparedStatement stmt)
      Provided the JDBC log category is logging warnings, this method will log any SQL warnings that result from the execution of a SQL statement.
      protected void logSQLWarnings​(java.sql.Statement stmt)  
      protected java.util.List<java.lang.Object> populateAutoAssignCols​(java.sql.PreparedStatement stmnt, Column[] autoAssign, java.lang.String[] autoAssignColNames, RowImpl row)  
      protected java.util.List<java.lang.Object> populateAutoAssignCols​(java.sql.PreparedStatement stmnt, Column[] autoAssign, DBIdentifier[] autoAssignColNames, RowImpl row)
      This method will only be called when there is auto assign columns.
      protected java.sql.PreparedStatement prepareStatement​(java.lang.String sql)
      This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.
      protected java.sql.PreparedStatement prepareStatement​(java.lang.String sql, java.lang.String[] autoAssignColNames)
      This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.
      protected void setObjectId​(java.util.List vals, Column[] autoAssign, java.lang.String[] autoAssignColNames, RowImpl row)  
      protected void setObjectId​(java.util.List vals, Column[] autoAssign, DBIdentifier[] autoAssignColNames, RowImpl row)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _conn

        protected final java.sql.Connection _conn
      • _log

        protected transient Log _log
      • _exceptions

        protected final java.util.Collection<java.lang.Exception> _exceptions
    • Constructor Detail

      • PreparedStatementManagerImpl

        public PreparedStatementManagerImpl​(JDBCStore store,
                                            java.sql.Connection conn)
        Constructor. Supply connection.
    • Method Detail

      • flushInternal

        protected void flushInternal​(RowImpl row)
                              throws java.sql.SQLException
        Flush the given row.
        Throws:
        java.sql.SQLException
      • flushAndUpdate

        protected void flushAndUpdate​(RowImpl row)
                               throws java.sql.SQLException
        Flush the given row immediately.
        Throws:
        java.sql.SQLException
      • populateAutoAssignCols

        protected java.util.List<java.lang.Object> populateAutoAssignCols​(java.sql.PreparedStatement stmnt,
                                                                          Column[] autoAssign,
                                                                          DBIdentifier[] autoAssignColNames,
                                                                          RowImpl row)
                                                                   throws java.sql.SQLException
        This method will only be called when there is auto assign columns. If database supports getGeneratedKeys, the keys will be obtained from the result set associated with the stmnt. If not, a separate sql to select the key will be issued from DBDictionary.
        Throws:
        java.sql.SQLException
      • populateAutoAssignCols

        protected java.util.List<java.lang.Object> populateAutoAssignCols​(java.sql.PreparedStatement stmnt,
                                                                          Column[] autoAssign,
                                                                          java.lang.String[] autoAssignColNames,
                                                                          RowImpl row)
                                                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • setObjectId

        protected void setObjectId​(java.util.List vals,
                                   Column[] autoAssign,
                                   java.lang.String[] autoAssignColNames,
                                   RowImpl row)
                            throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • setObjectId

        protected void setObjectId​(java.util.List vals,
                                   Column[] autoAssign,
                                   DBIdentifier[] autoAssignColNames,
                                   RowImpl row)
                            throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getGeneratedKeys

        protected java.util.List<java.lang.Object> getGeneratedKeys​(java.sql.PreparedStatement stmnt,
                                                                    java.lang.String[] autoAssignColNames)
                                                             throws java.sql.SQLException
        This method will only be called when the database supports getGeneratedKeys.
        Throws:
        java.sql.SQLException
      • getGeneratedKeys

        protected java.util.List<java.lang.Object> getGeneratedKeys​(java.sql.PreparedStatement stmnt,
                                                                    DBIdentifier[] autoAssignColNames)
                                                             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getAutoAssignColumns

        protected Column[] getAutoAssignColumns​(RowImpl row)
      • getAutoAssignColNames

        protected java.lang.String[] getAutoAssignColNames​(Column[] autoAssign,
                                                           RowImpl row)
      • executeUpdate

        protected int executeUpdate​(java.sql.PreparedStatement stmnt,
                                    java.lang.String sql,
                                    RowImpl row)
                             throws java.sql.SQLException
        This method is to provide override for non-JDBC or JDBC-like implementation of executing update.
        Throws:
        java.sql.SQLException
      • prepareStatement

        protected java.sql.PreparedStatement prepareStatement​(java.lang.String sql)
                                                       throws java.sql.SQLException
        This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.
        Throws:
        java.sql.SQLException
      • prepareStatement

        protected java.sql.PreparedStatement prepareStatement​(java.lang.String sql,
                                                              java.lang.String[] autoAssignColNames)
                                                       throws java.sql.SQLException
        This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.
        Throws:
        java.sql.SQLException
      • logSQLWarnings

        protected void logSQLWarnings​(java.sql.PreparedStatement stmt)
        Provided the JDBC log category is logging warnings, this method will log any SQL warnings that result from the execution of a SQL statement.
      • logSQLWarnings

        protected void logSQLWarnings​(java.sql.Statement stmt)