mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
add DbTypeUtilTest.java
This commit is contained in:
parent
867651b64d
commit
765aa0f520
@ -87,7 +87,7 @@ public class DbTypeUtil {
|
||||
* @param jdbcUrl jdbcURL
|
||||
* @return 返回数据库类型
|
||||
*/
|
||||
private static DbType parseDbType(String jdbcUrl) {
|
||||
public static DbType parseDbType(String jdbcUrl) {
|
||||
jdbcUrl = jdbcUrl.toLowerCase();
|
||||
if (jdbcUrl.contains(":mysql:") || jdbcUrl.contains(":cobar:")) {
|
||||
return DbType.MYSQL;
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package com.mybatisflex.coretest;
|
||||
|
||||
import com.mybatisflex.core.dialect.DbType;
|
||||
import com.mybatisflex.core.dialect.DbTypeUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
public class DbTypeUtilTest {
|
||||
|
||||
@Test
|
||||
public void testParseUrl(){
|
||||
String url01 = "jdbc:sqlserver://127.0.0.1";
|
||||
DbType dbType01 = DbTypeUtil.parseDbType(url01);
|
||||
System.out.println(dbType01);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user