add function createSql, modify db connection.