public enum DataBaseType extends Enum<DataBaseType>
文件名:DataBaseType.java
用途: 枚举可操作的数据库类型
编码时间:2020年12月15日上午8:26:38
修改时间:2020年12月15日上午8:26:38
Enum Constant and Description |
---|
ACCESS
连接Access数据库
|
MYSQL
连接MySQL数据库
|
ORACLE
连接Oracle数据库
|
SQL_SERVER
连接SQL Server数据库
|
Modifier and Type | Method and Description |
---|---|
String |
getClassName()
用于返回数据库加载的类名
|
String |
getUrl()
用于返回数据库连接的URL,URL为带格式化字符的字符串,可通过以下方法格式化当前数据库连接的URL:
|
static DataBaseType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataBaseType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DataBaseType ORACLE
public static final DataBaseType MYSQL
public static final DataBaseType SQL_SERVER
public static final DataBaseType ACCESS
public static DataBaseType[] values()
for (DataBaseType c : DataBaseType.values()) System.out.println(c);
public static DataBaseType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getUrl()
String.format(dataBaseType.getUrl(), host, dataBaseName)
public String getClassName()
Copyright © 2024. All rights reserved.