validate connection against database