// Path: src/main/java/com/elong/pb/newdda/client/exception/DatabaseTypeUnsupportedException.java
// public class DatabaseTypeUnsupportedException extends RuntimeException {
// 
//     private static final long serialVersionUID = -7807395469148925091L;
// 
//     private static final String MESSAGE = "Can not support database type [%s].";
// 
//     public DatabaseTypeUnsupportedException(final String databaseType) {
//         super(String.format(MESSAGE, databaseType));
//     }
//     
// }


import com.elong.pb.newdda.client.exception.DatabaseTypeUnsupportedException;
package com.elong.pb.newdda.client.constants;


/**
 * Created by zhangyong on 2016/8/2.
 */
public enum DatabaseType {

    H2, MySQL, Oracle, SQLServer, DB2;

    public static DatabaseType valueFrom(final String databaseName) {
        try {
            return DatabaseType.valueOf(databaseName);
        } catch (final IllegalArgumentException ex) {
// Path: src/main/java/com/elong/pb/newdda/client/exception/DatabaseTypeUnsupportedException.java
// public class DatabaseTypeUnsupportedException extends RuntimeException {
// 
//     private static final long serialVersionUID = -7807395469148925091L;
// 
//     private static final String MESSAGE = "Can not support database type [%s].";
// 
//     public DatabaseTypeUnsupportedException(final String databaseType) {
//         super(String.format(MESSAGE, databaseType));
//     }
//     
// }


// Path: src/main/java/com/elong/pb/newdda/client/constants/DatabaseType.java
import com.elong.pb.newdda.client.exception.DatabaseTypeUnsupportedException;

package com.elong.pb.newdda.client.constants;


/**
 * Created by zhangyong on 2016/8/2.
 */
public enum DatabaseType {

    H2, MySQL, Oracle, SQLServer, DB2;

    public static DatabaseType valueFrom(final String databaseName) {
        try {
            return DatabaseType.valueOf(databaseName);
        } catch (final IllegalArgumentException ex) {
            throw new DatabaseTypeUnsupportedException(databaseName);