added database query, added functionality with tomcat