Bläddra i källkod

还原POM配置,修改JDBC关连接代码

will.chen 6 år sedan
förälder
incheckning
53e1c553e8

+ 13 - 0
.settings/.jsdtscope

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/webapp"/>
+	<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+		<attributes>
+			<attribute name="hide" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+	<classpathentry kind="output" path=""/>
+</classpath>

+ 2 - 2
Dockerfile

@@ -35,12 +35,12 @@ ENV PATH=${M2_HOME}/bin:${PATH}
 ENV JAVA_HOME=/usr/lib/jvm/java-8-oracle
 ENV JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
 ADD ca.crt ./
-#COPY ./additional_jars ./additional_jars
+COPY ./additional_jars ./additional_jars
 COPY tomcat-users.xml ${CATALINA_HOME}/conf/tomcat-users.xml
 COPY context.xml ${CATALINA_HOME}/webapps/manager/META-INF/context.xml
 RUN keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -noprompt -alias maven2.ca -file ca.crt
 RUN keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/jssecacerts -storepass changeit -noprompt -alias maven2.ca -file ca.crt
-#RUN mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.2.0.1.0 -Dpackaging=jar -Dfile=./additional_jars/ojdbc7.jar
+RUN mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.2.0.1.0 -Dpackaging=jar -Dfile=./additional_jars/ojdbc7.jar
 COPY sonar-runner.properties ./sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
 EXPOSE 84
 EXPOSE 8080

BIN
lib/ojdbc6-11.2.0.1.0.jar


+ 3 - 5
pom.xml

@@ -83,11 +83,9 @@
 
     <!-- oracle -->
     <dependency>
-      <groupId>org.oracle</groupId>
-      <artifactId>oracle</artifactId>
-      <version>1.0</version>
-      <scope>system</scope>
-      <systemPath>${project.basedir}/lib/ojdbc6-11.2.0.1.0.jar</systemPath>
+      <groupId>com.oracle</groupId>
+      <artifactId>ojdbc7</artifactId>
+      <version>12.2.0.1.0</version>
     </dependency>
 
     <!-- 引入json处理包 -->

+ 3 - 1
src/main/java/com/util/BasesSource/DynamicDataSourceRegister.java

@@ -124,7 +124,7 @@ public class DynamicDataSourceRegister implements ImportBeanDefinitionRegistrar,
                 DataSource ds = buildDataSource(dsMap);
                 slaveDataSources.put(rs.getString("id"), ds);
             }
-            } catch (ClassNotFoundException e) {
+        } catch (ClassNotFoundException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         } catch (SQLException e) {
@@ -132,6 +132,8 @@ public class DynamicDataSourceRegister implements ImportBeanDefinitionRegistrar,
             e.printStackTrace();
         }finally {
             try {
+            	rs.close();
+            	pstmt.close();
                 conn.close();
             } catch (SQLException e) {
                 e.printStackTrace();