|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
- * Copyright [2020] [MaxKey of copyright http:
|
|
+ * Copyright [2022] [MaxKey of copyright http:
|
|
*
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -18,6 +18,7 @@
|
|
package org.maxkey.web;
|
|
package org.maxkey.web;
|
|
|
|
|
|
import java.sql.Connection;
|
|
import java.sql.Connection;
|
|
|
|
+import java.sql.DatabaseMetaData;
|
|
import java.sql.SQLException;
|
|
import java.sql.SQLException;
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -29,8 +30,10 @@ import javax.servlet.http.HttpServlet;
|
|
|
|
|
|
import org.apache.commons.lang.SystemUtils;
|
|
import org.apache.commons.lang.SystemUtils;
|
|
import org.apache.commons.lang3.ArchUtils;
|
|
import org.apache.commons.lang3.ArchUtils;
|
|
|
|
+import org.apache.mybatis.jpa.util.JpaWebContext;
|
|
import org.joda.time.DateTime;
|
|
import org.joda.time.DateTime;
|
|
import org.maxkey.configuration.ApplicationConfig;
|
|
import org.maxkey.configuration.ApplicationConfig;
|
|
|
|
+import org.maxkey.crypto.Md5Sum;
|
|
import org.maxkey.util.PathUtils;
|
|
import org.maxkey.util.PathUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -64,7 +67,7 @@ public class InitializeContext extends HttpServlet {
|
|
|
|
|
|
WebContext.applicationContext = applicationContext;
|
|
WebContext.applicationContext = applicationContext;
|
|
|
|
|
|
- org.apache.mybatis.jpa.util.WebContext.applicationContext = applicationContext;
|
|
+ JpaWebContext.applicationContext = applicationContext;
|
|
|
|
|
|
|
|
|
|
listEnvVars();
|
|
listEnvVars();
|
|
@@ -110,7 +113,7 @@ public class InitializeContext extends HttpServlet {
|
|
((javax.sql.DataSource) applicationContext.getBean("dataSource"))
|
|
((javax.sql.DataSource) applicationContext.getBean("dataSource"))
|
|
.getConnection();
|
|
.getConnection();
|
|
|
|
|
|
- java.sql.DatabaseMetaData databaseMetaData = connection.getMetaData();
|
|
+ DatabaseMetaData databaseMetaData = connection.getMetaData();
|
|
ApplicationConfig.databaseProduct = databaseMetaData.getDatabaseProductName();
|
|
ApplicationConfig.databaseProduct = databaseMetaData.getDatabaseProductName();
|
|
|
|
|
|
_logger.debug("DatabaseProductName : {}",
|
|
_logger.debug("DatabaseProductName : {}",
|
|
@@ -142,6 +145,9 @@ public class InitializeContext extends HttpServlet {
|
|
_logger.debug("UserName : {}" ,
|
|
_logger.debug("UserName : {}" ,
|
|
databaseMetaData.getUserName());
|
|
databaseMetaData.getUserName());
|
|
_logger.debug("-----------------------------------------------------------");
|
|
_logger.debug("-----------------------------------------------------------");
|
|
|
|
+ if(Md5Sum.checkVersion()) {
|
|
|
|
+ _logger.trace("The Version dependent on is Reliable .");
|
|
|
|
+ }
|
|
} catch (SQLException e) {
|
|
} catch (SQLException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
_logger.error("DatabaseMetaData Variables Error .",e);
|
|
_logger.error("DatabaseMetaData Variables Error .",e);
|
|
@@ -164,11 +170,13 @@ public class InitializeContext extends HttpServlet {
|
|
.getAppliedPropertySources()
|
|
.getAppliedPropertySources()
|
|
.get(PropertySourcesPlaceholderConfigurer.ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME)
|
|
.get(PropertySourcesPlaceholderConfigurer.ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME)
|
|
.getSource();
|
|
.getSource();
|
|
-
|
|
+
|
|
Iterator<PropertySource<?>> it =WebContext.properties.getPropertySources().iterator();
|
|
Iterator<PropertySource<?>> it =WebContext.properties.getPropertySources().iterator();
|
|
while(it.hasNext()) {
|
|
while(it.hasNext()) {
|
|
_logger.debug("propertySource {}" , it.next());
|
|
_logger.debug("propertySource {}" , it.next());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ JpaWebContext.properties = WebContext.properties;
|
|
_logger.trace("-----------------------------------------------------------");
|
|
_logger.trace("-----------------------------------------------------------");
|
|
}
|
|
}
|
|
}
|
|
}
|