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

org.onetwo.common.db.DataBase Maven / Gradle / Ivy

The newest version!
package org.onetwo.common.db;


public enum DataBase {
	MySQL("mysql"),
	Oracle("oracle"),
	PostgreSQL("postgresql"),
	Sqlserver("sqlserver"),
	H2("h2"),
	Access("access");
//	Unknow("unknow");
	
	private String name;
	
	DataBase(String name){
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	public boolean isOracle(){
		return this.equals(Oracle);
	}
	
	public boolean isMySQL(){
		return this.equals(MySQL);
	}
	
	public static DataBase of(String name){
		name = name.toLowerCase();
		for(DataBase db : values()){
			if(name.indexOf(db.name)!=-1){
				return db;
			}
		}
		throw new IllegalArgumentException("Unknown Database");
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy