If you override this method, make sure to call the parent implementation so that the component can be marked as initialized. This method is invoked right after the db connection is established.The default implementation is to set the charset for My SQL, Maria DB and Postgre SQL database connections.For some databases (such as My SQL), this may need to be set true so that PDO can emulate the prepare support to bypass the buggy native prepare support.Note, this property is only effective for PHP 5.1.3 or above.Defaults to null, meaning using default charset as specified by the database.
CDb Connection works together with CDb Command, CDb Data Reader and CDb Transaction to provide data access to various DBMS in a common set of APIs. To establish a connection, set active to true after specifying connection String, username and password.You should be aware that logging parameter values could be expensive and have significant impact on the performance of your application.the ID of the cache application component that is used for query caching.The default value is null, which will not change the ATTR_EMULATE_PREPARES value of PDO.whether to log the values that are bound to a prepare SQL statement. During development, you may consider setting this property to true so that parameter values bound to SQL statements are logged for debugging purpose.If the same query is executed again, the result may be fetched from cache directly without actually executing the SQL statement. This can be either a string representing a SQL statement, or an array representing different fragments of a SQL statement.Please refer to CDb Command::__construct for more details about how to pass an array as the query.In order to use this method, enable Profiling has to be set true. By setting the $duration parameter to be 0, the query caching will be disabled.Otherwise, query results of the new SQL statements executed next will be saved in cache and remain valid for the specified duration.the number of SQL statements that need to be cached next.If this is 0, then even if query caching is enabled, no query will be cached.