public class DriverUtil extends Object
| Constructor and Description |
|---|
DriverUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Driver |
createDriver(String driverName)
创建驱动
|
static Driver |
createDriver(String driverName,
ClassLoader classLoader)
创建驱动
|
static String |
identifyDriver(Connection conn)
识别JDBC驱动名
|
static String |
identifyDriver(DataSource ds)
识别JDBC驱动名
|
static String |
identifyDriver(String nameContainsProductInfo)
通过JDBC URL等信息识别JDBC驱动名
|
public static Driver createDriver(String driverName)
driverName - 驱动类名public static Driver createDriver(String driverName, ClassLoader classLoader)
driverName - 驱动类名classLoader - 类加载器public static String identifyDriver(String nameContainsProductInfo)
nameContainsProductInfo - 包含数据库标识的字符串DriverIdentifier.identifyDriver(String)public static String identifyDriver(DataSource ds)
ds - 数据源public static String identifyDriver(Connection conn) throws DbException
conn - 数据库连接对象DbException - SQL异常包装,获取元数据信息失败Copyright © 2025. All rights reserved.