All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.sylinx.hbatis.springboot.starter.ValidateQuery Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package cn.sylinx.hbatis.springboot.starter;

import java.util.HashMap;
import java.util.Map;

import cn.sylinx.hbatis.db.dialect.DbType;

public enum ValidateQuery {

	ME;

	private Map validateQueryMaps;

	private ValidateQuery() {
		
		if (validateQueryMaps == null) {
			validateQueryMaps = new HashMap();
		}

		validateQueryMaps.put(DbType.DB2, "select 1 from sysibm.sysdummy1");
		validateQueryMaps.put(DbType.DERBY, "values 1");
		validateQueryMaps.put(DbType.MYSQL, "select 1");
		validateQueryMaps.put(DbType.ORACLE, "select 1 from dual");
		validateQueryMaps.put(DbType.SQLSERVER, "select 1");
	}

	public String getValidateQuery(String dbtype) {
		DbType dt = DbType.getDbType(dbtype);
		return validateQueryMaps.get(dt);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy