The invention relates to a method for controlling switching between systems through a third-party database. The method comprises the steps that (1) a host address is called, and state information of the database is obtained; (2) a database label is set for the database, and a service corresponding to the database label is established; (3) a connection relation and the database label are stored in a shared memory; (4) the service is called; (5) whether the called service is long connection or not is judged, if yes, the step (6) is executed, and if not, the step (8) is executed; (6) whether the current database label is consistent with the database label in the shared memory is judged, if yes, connection is achieved, operation is finished, and if not, the step (7) is executed; (7) the current database is closed; (8) a corresponding database is opened according to the database label corresponding to the current service, and operation is finished. The method can achieve random switching between an access layer, a service layer and a data layer between the systems, configuration is flexible, control is convenient, service persistence can also be guaranteed, and the timeliness ratio of switching between the systems is improved.