Browse Source

oracle 添加

huangzhiyong 8 years ago
parent
commit
945446d3d5

+ 10 - 10
hos-web-framework/src/main/java/com/yihu/hos/web/framework/util/springutil/SpringBeanUtil.java

@ -3,6 +3,7 @@ package com.yihu.hos.web.framework.util.springutil;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
 * 服务管理器。服务管理器是所有顶级服务的生成器。若是单元测试使用此服务工厂,Spring Context会被ServiceFactory创建。
@ -27,7 +28,6 @@ public class SpringBeanUtil  {
    public static void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        springContext = applicationContext;
        System.out.println("springBeanUtil 初始化成功~,springContext is null: "+ (springContext==null));
    }
    public static <T> T getBean(String beanName){
@ -43,15 +43,15 @@ public class SpringBeanUtil  {
     * @return
     */
    public static <T> T getService(String serviceName) {
//        if (springContext == null) {
//            springContext = new ClassPathXmlApplicationContext(new String[]
//                    {
//                            "spring/applicationContext.xml"
//                    }
//            );
//        }
        return (T) getApplicationContext().getBean(serviceName);
        if (springContext == null) {
            springContext = new ClassPathXmlApplicationContext(new String[]
                    {
                            "spring/applicationContext.xml"
                    }
            );
        }
        return (T) springContext.getBean(serviceName);
    }
    /**

+ 5 - 0
pom.xml

@ -197,6 +197,11 @@
            <version>3.15-beta1</version>
        </dependency>
        <!-- swagger end -->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3.0</version>
        </dependency>
    </dependencies>
    <build>