Bug fixed in an SQL statement
Bug fixes in getting db connection
Merge pull request #2142 from atsareg/fix-v6r12

[v6r12] Bug fixes