Database adapter template and sample code from history added