public class DialectFactory extends Object implements DriverNamePool
DRIVER_CLICK_HOUSE, DRIVER_DB2, DRIVER_DERBY, DRIVER_DM7, DRIVER_GAUSS, DRIVER_GBASE, DRIVER_H2, DRIVER_HIGHGO, DRIVER_HIVE, DRIVER_HIVE2, DRIVER_HSQLDB, DRIVER_IGNITE_THIN, DRIVER_KINGBASE8, DRIVER_MARIADB, DRIVER_MYSQL, DRIVER_MYSQL_V6, DRIVER_OCEANBASE, DRIVER_OPENGAUSS, DRIVER_ORACLE, DRIVER_ORACLE_OLD, DRIVER_OSCAR, DRIVER_PHOENIX, DRIVER_POSTGRESQL, DRIVER_SQLLITE3, DRIVER_SQLSERVER, DRIVER_SYBASE, DRIVER_XUGU
Modifier and Type | Method and Description |
---|---|
static Dialect |
getDialect(DataSource ds)
获取共享方言
|
static String |
identifyDriver(String nameContainsProductInfo)
通过JDBC URL等信息识别JDBC驱动名
|
static String |
identifyDriver(String nameContainsProductInfo,
ClassLoader classLoader)
通过JDBC URL等信息识别JDBC驱动名
|
static Dialect |
newDialect(Connection conn)
创建方言
|
static Dialect |
newDialect(DataSource ds)
创建方言
|
static Dialect |
newDialect(String driverName)
根据驱动名创建方言
驱动名是不分区大小写完全匹配的 |
public static Dialect newDialect(String driverName)
driverName
- JDBC驱动类名public static String identifyDriver(String nameContainsProductInfo)
nameContainsProductInfo
- 包含数据库标识的字符串public static String identifyDriver(String nameContainsProductInfo, ClassLoader classLoader)
nameContainsProductInfo
- 包含数据库标识的字符串classLoader
- 类加载器,null
表示默认上下文的类加载器public static Dialect getDialect(DataSource ds)
ds
- 数据源,每一个数据源对应一个唯一方言Dialect
方言public static Dialect newDialect(DataSource ds)
ds
- 数据源public static Dialect newDialect(Connection conn)
conn
- 数据库连接对象Copyright © 2024. All rights reserved.