|
@@ -628,7 +628,7 @@ public class TableInfoServiceImpl implements ITableInfoService {
|
|
|
//创建数据库
|
|
|
String createDatabaseSql = null;
|
|
|
|
|
|
-
|
|
|
+ //判断租户是哪种数据源,初始化对应创建信息
|
|
|
if(dataSource.getDatabaseType().equals(DataSourceType.MYSQL.getDataSourceName())){
|
|
|
driverName = LoadDriverConstants.MYSQL;
|
|
|
dbURL = "jdbc:mysql://"+dataSource.getDatabaseIp()+":"+dataSource.getPortNumber();
|
|
@@ -651,7 +651,7 @@ public class TableInfoServiceImpl implements ITableInfoService {
|
|
|
|
|
|
try
|
|
|
{
|
|
|
- Class.forName(driverName); //jdk版本6.0以上可以省略这句话
|
|
|
+ Class.forName(driverName);
|
|
|
con=DriverManager.getConnection(dbURL,userName,userPwd);
|
|
|
st=con.createStatement();
|
|
|
|
|
@@ -663,16 +663,15 @@ public class TableInfoServiceImpl implements ITableInfoService {
|
|
|
return AjaxResult.warn("数据库已存在!");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
//创建数据库
|
|
|
st.executeUpdate(createDatabaseSql);
|
|
|
|
|
|
}catch(Exception e)
|
|
|
{
|
|
|
e.printStackTrace();
|
|
|
+ return AjaxResult.warn("初始化数据库异常,请确保连接信息无误!");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|