Add connection interface, query exception and query interface