pom.xml
<dependency> <groupId>ojdbc6</groupId> <artifactId>oracle</artifactId> <version>11.2.0.1.0</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.12</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>1.7.12</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>1.2.3</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> </dependency> <dependency> <groupId>com.googlecode.log4jdbc</groupId> <artifactId>log4jdbc</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>com.zaxxer</groupId> <artifactId>HikariCP-java6</artifactId> <version>2.3.13</version> </dependency>
报错信息如下:
-
#log4jdbc+druid不能连接数据,log4jdbc会从oracle.jar包里搜索出两个驱动类,druid不认报错:not support oracle driver 1.0 #17:10:51.826 [main] DEBUG log4jdbc.debug.debug - FOUND DRIVER oracle.jdbc.OracleDriver #17:10:51.827 [main] DEBUG log4jdbc.debug.debug - FOUND DRIVER oracle.jdbc.driver.OracleDriver #17:10:51.838 [main] DEBUG log4jdbc.debug.debug - ... log4jdbc initialized! ...
尝试更换为号称为最快的连接池HikariCp,好使。旧项目使用的jdk是1.6,故用2.3.13版本