代码优化
This commit is contained in:
@@ -4,7 +4,6 @@ import com.yanghuanglin.seq.enums.DbType;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
@@ -134,9 +133,8 @@ public class GeneratorConfig {
|
||||
|
||||
public DbType getDbType() {
|
||||
if (this.dbType == null) {
|
||||
Connection connection = null;
|
||||
try {
|
||||
connection = dataSource.getConnection();
|
||||
Connection connection = dataSource.getConnection();
|
||||
String productName = connection.getMetaData().getDatabaseProductName();
|
||||
this.dbType = DbType.of(productName);
|
||||
} catch (SQLException e) {
|
||||
|
||||
Reference in New Issue
Block a user