com.alibaba.druid.pool.DruidDataSource 报错 5C

使用springboot2.0.1,数据源使用alibaba的druid,数据库是oracle。启动程序启动报如下错误。同样的程序打包后在其他人电脑可以正常运行,在我电脑上运行就报如下错误。但是在我电脑上用plsql也可以正常连接数据库 ,求大神指点迷津

2018-06-06 10:45:21.242 ERROR 10508 --- [nfoReplicator-0] com.alibaba.druid.pool.DruidDataSource : init datasource error, url: jdbc:oracle:thin:@172.20.26.21:1521:dbtest

java.sql.SQLRecoverableException: IO 错误: Got minus one from a read call, connect lapse 3 ms., Authentication lapse 0 ms.
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:794)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:156)
at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218)
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:150)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1560)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1623)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:861)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1229)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1225)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:90)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:324)
at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.getProduct(DataSourceHealthIndicator.java:122)
at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.doDataSourceHealthCheck(DataSourceHealthIndicator.java:109)
at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.doHealthCheck(DataSourceHealthIndicator.java:104)
at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:84)
at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:68)
at org.springframework.cloud.netflix.eureka.EurekaHealthCheckHandler.getHealthStatus(EurekaHealthCheckHandler.java:103)
at org.springframework.cloud.netflix.eureka.EurekaHealthCheckHandler.getStatus(EurekaHealthCheckHandler.java:99)
at com.netflix.discovery.DiscoveryClient.refreshInstanceInfo(DiscoveryClient.java:1382)
at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:117)
at com.netflix.discovery.InstanceInfoReplicator$1.run(InstanceInfoReplicator.java:101)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Got minus one from a read call, connect lapse 3 ms., Authentication lapse 0 ms.
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:790)


0

3个回答

没有引用的druid的jar包你换一个版本更新一下

1
gaoliang998
志狼奔月 如果是驱动版本问题的话,打包后在其他人电脑为啥可以运行。
大约一年之前 回复
0

是不是驱动的版本有问题啊

0
gaoliang998
志狼奔月 我感觉应该是与电脑环境有关,打成jar包后,在我电脑运行 java -jar xx,运行报错,在其他人电脑运行没问题
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
错误如下: java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezo...
springMVC 用 com.alibaba.druid.pool.DruidDataSource 报错
七月 24, 2016 9:07:46 上午 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [conf/spring-mybatis.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [conf/spring-mybatis.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.alibaba.druid.pool.DruidDataSource] for bean with name 'dataSource' defined in class path resource [conf/spring-mybatis.xml]; nested exception is java.lang.ClassNotFoundException: com.alibaba.druid.pool.DruidDataSourcern at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1102)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:674)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [conf/spring-mybatis.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.alibaba.druid.pool.DruidDataSource] for bean with name 'dataSource' defined in class path resource [conf/spring-mybatis.xml]; nested exception is java.lang.ClassNotFoundException: com.alibaba.druid.pool.DruidDataSourcern at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)rn ... 24 morernCaused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.alibaba.druid.pool.DruidDataSource] for bean with name 'dataSource' defined in class path resource [conf/spring-mybatis.xml]; nested exception is java.lang.ClassNotFoundException: com.alibaba.druid.pool.DruidDataSourcern at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:433)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)rn ... 34 morernCaused by: java.lang.ClassNotFoundException: com.alibaba.druid.pool.DruidDataSourcern at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)rn at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)rn at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)rn at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)rn ... 40 morernrn七月 24, 2016 9:07:46 上午 org.apache.catalina.core.StandardContext startInternalrn严重: Error listenerStartrn七月 24, 2016 9:07:46 上午 org.apache.catalina.core.StandardContext startInternalrn严重: Context [/baobiao] startup failed due to previous errorsrn七月 24, 2016 9:07:46 上午 org.apache.catalina.core.ApplicationContext logrn信息: Closing Spring root WebApplicationContextrn七月 24, 2016 9:07:46 上午 org.apache.coyote.AbstractProtocol startrn信息: Starting ProtocolHandler ["http-bio-8080"]rn七月 24, 2016 9:07:46 上午 org.apache.coyote.AbstractProtocol startrn信息: Starting ProtocolHandler ["ajp-bio-8009"]rn七月 24, 2016 9:07:46 上午 org.apache.catalina.startup.Catalina startrn信息: Server startup in 6950 ms
求大神帮忙看看怎么解决,JFinal的报错
2018-11-29 12:15:14 [ERROR]-[Thread: Druid-ConnectionPool-Create-1062709130]-[com.alibaba.druid.pool.DruidDataSourceKaTeX parse error: Expected 'EOF', got '&' at position 119: …erEncoding=utf8&amp...
druid连接derby数据库报错的问题——2016.12.06
背景描述:根据项目需求,使用druid连接池连接mysql数据库和derby数据库; 问题描述:在derby数据库环境下报错:init dataSource error Encounter "" at~~~。 分析方法:初始化数据时报错,应为配置文件中有错误,分段屏蔽配置文件,确认产生报错的配置项为:validationQuery:SELECT 'x'。 将该配置项注释后又报错:
常见问题整理
1.Tomcat启动项目时,报数据库连接异常 2018-07-27 09:27:46,727 ERROR Druid-ConnectionPool-Create-1731490877 com.alibaba.druid.pool.DruidDataSource - create connection error, url: jdbc:mysql://127.0.0.1:3306/xiaoyaoj...
荐大家使用数据库连接池 DruidDataSource
推荐大家使用数据库连接池 DruidDataSource. http://code.alibabatech.com/wiki/display/Druid/DruidDataSource DruidDataSource经过阿里巴巴数百个应用一年多生产环境运行验证,稳定可靠。 它最重要的特点是:监控、扩展和性能。 下载和Maven配置看这里: https://github...
旧版本Druid回收连接引发的'recyle error'
公司官网上的心跳交易不执行了,按理说是定时任务做的,怎么会不执行呢,遂去查看日志发现: [ERROR] [2018-09-25 20:30:37,933] (AgtForwardServiceImpl.java,31) - 转发数据推送异常:{}nested exception is org.apache.ibatis.exceptions.PersistenceException: ### E...
启动tomcat时,日志里大量输出创建数据源dataSource的日志
晚上十二点上线过程中,出现了一个严重问题,记录一下: 运维部署好代码之后,重启tomcat,日志里输出大量的以下信息 00:03:27.311 [localhost-startStop-1] INFO  com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited 00:03:27.319 [localhost-
SpringMVC启动一直卡的解决
当加载Spring MVC如下情况卡住时,有可能是JDK版本问题。 ... At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLD
spring、mybatis整合源码简单分析
配置 <bean id="localDataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <property name="url" value="jdbc:mysql://192.168.31.
druid升级1.0.26遇到的连接闲置断开的问题
1. 背景 之前处理了一个mybatis的bug(详见之前的文章),在给系统升级mybatis的时候,想顺便把所有系统的druid也升级了,从版本(0.2.18~1.0.18不等)升级到统一的最新版本(1.0.26)。 但是在beta测试期间,遇到如下异常: ERROR com.alibaba.druid.pool.DruidDataSource:1243 discard connect
SpringBoot2.X版本使用druid连接池报ClassNotFound异常原因及解决办法
SpringBoot2.0以上版本删除了RelaxedDataBinder相关类(详情可以自行百度),使用druid连接池时如果使用较低版本,例如 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifa...
JNDI学习总结(三)——Tomcat下使用Druid配置JNDI数据源
  com.alibaba.druid.pool.DruidDataSourceFactory实现了javax.naming.spi.ObjectFactory,可以作为JNDI数据源来配置。 一、下载Druid的jar包   下载地址:http://mvnrepository.com/artifact/com.alibaba/druid/1.0.9,如下图所示:      druid.j...
DruidDataSource数据源配置详解
可以帮助你了解,以及配置实现DruidDataSource数据源的配置
druid连接池配置Druid
Druid 有两种配置方法:一种是基于Spring的配置,另一种是手动创建链接。 下面简述这两种方法。 一、Spring配置 把数据源改为以下配置:
druid连接池问题
he last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.GeneratedConstructorAccessor34.newInstance(Unknown Sourc
奇怪的错误 com.alibaba.druid.pool.DruidDataSource
错误如下:rn本地测试没报错(估计跑的不够久),,布到服务器上后,一直收到报错邮件,基本下面的错误。。。rn,貌似也不影响系统使用,,就是一直报错。rn困扰好久了。。。求救大神《》《》!rn[ErrorMessage] 2016-09-23 15:36 - com.alibaba.druid.pool.DruidDataSource -346367553 [Druid-ConnectionPool-Create-3454745] ERROR com.alibaba.druid.pool.DruidDataSource - create connection errorrncom.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failurernrnThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.rnat sun.reflect.GeneratedConstructorAccessor84.newInstance(Unknown Source)rnat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rnat java.lang.reflect.Constructor.newInstance(Constructor.java:526)rnat com.mysql.jdbc.Util.handleNewInstance(Util.java:411)rnat com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)rnat com.mysql.jdbc.MysqlIO.(MysqlIO.java:344)rnat com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2333)rnat com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2370)rnat com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154)rnat com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:792)rnat com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)rnat sun.reflect.GeneratedConstructorAccessor85.newInstance(Unknown Source)rnat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rnat java.lang.reflect.Constructor.newInstance(Constructor.java:526)rnat com.mysql.jdbc.Util.handleNewInstance(Util.java:411)rnat com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)rnat com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)rnat com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148)rnat com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211)rnat com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142)rnat com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377)rnat com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431)rnat com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1844)rnCaused by: java.net.ConnectException: Connection timed outrnat java.net.PlainSocketImpl.socketConnect(Native Method)rnat java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)rnat java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)rnat java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)rnat java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)rnat java.net.Socket.connect(Socket.java:579)rnat java.net.Socket.connect(Socket.java:528)rnat java.net.Socket.(Socket.java:425)rnat java.net.Socket.(Socket.java:241)rnat com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)rnat com.mysql.jdbc.MysqlIO.(MysqlIO.java:294)rn... 17 morernrn数据库连接配置如下rn[code=java]rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn [/code]rn
一个小错误费我半天时间
spring+mybatis,启动时,停止在 2015-09-09 10:40:22.627:INFO:oejs.Server:jetty-8.1.14.v20131031 2015-09-09 10:40:22.878:INFO:/:No Spring WebApplicationInitializer types detected on classpath log4j:WARN No s
druid数据库连接池配置
1. 引入jar包<dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>${druid-version}</version> </dependency>2. 在spring配置文件里配置dataSource<!--配置wxsr数据源 使用druid数据库连接池 -
SpringMVC配置太多?试试SpringBoot
SpringMVC相信大家已经不再陌生了,大家可能对于Spring的各种XML配置已经产生了厌恶的感觉,Spring官方发布的Springboot 已经很长时间了,Springboot是一款“约定优于配置”的轻量级框架;Springboot首先解决的就是各种繁琐的XML配置,你可以不用任何XML配置,进行web服务的搭建,其次是Sprin...
Druid连接池
package Test01; import com.alibaba.druid.pool.DruidDataSourceFactory; import org.junit.Test; /* 步骤: 1.导包:(druid-1.0.9.jar)+(mysql-connector-java-5.1.7-bin.jar) 2.创建DruidDataSourceFac...
[转]阿里巴巴数据库连接池 druid配置详解
一、背景   java程序很大一部分要操作数据库,为了提高性能操作数据库的时候,又不得不使用数据库连接池。数据库连接池有很多选择,c3p、dhcp、proxool等,druid作为一名后起之秀,凭借其出色的性能,也逐渐映入了大家的眼帘。接下来本教程就说一下druid的简单使用。 二、jar包下载、配置详解及配置示例 1. jar包获取 可以从 http://repo1.maven.or...
完美解决Tomcat关闭后报错
今天关闭Tomcat时报如下错: 06-May-2019 16:00:49.348 警告 [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ROOT] registered the JDBC driver [oracle...
讲一个比较丢人的找BUG经历
调试的时候运行遇到CNF 2018-08-31 11:16:52.265 [main] ERROR com.alibaba.druid.pool.DruidDataSource - {dataSource-1} init error java.sql.SQLException: oracle.jdbc.driver.OracleDriver         at com.alibaba.drui...
常用数据库连接池dbcp/c3p0/druid
数据库连接的建立和关闭是极耗费系统资源的操作,频繁的打开、关闭连接,将造成系统性能下降。数据库连接池的解决方案是:当应用程序启动时,系统主动建立足够的数据库连接,并将这些连接组成一个连接池。每次应用程序请求数据库连接时,无需重新打开连接,而是从连接池中取出已有的连接使用,使用完不再关闭数据库连接,而是直接将连接归还给连接池。 jdbc的数据库连接池使用java.sql.DataSource来表示...
SpringMVC配置数据库连接池使用druid进行加密
&amp;lt;bean id=&quot;dataSource&quot; class=&quot;com.alibaba.druid.pool.DruidDataSource&quot; init-method=&quot;init&quot; destroy-method=&quot;close&quot;&amp;gt; &amp;lt;!-- 基本属性 url、user、password --&amp;gt; &amp;lt;property name=&quot;url&quot;
单元测试(一) dbutil篇
一、前言 本项目基于git项目地址:https://github.com/yangchangyong0/unitTest点击打开链接(项目关联的其他附带东西,以提供测试,里面有initsql,执行sql 即是可以) 由于最近公司要求单元测试,达到指定覆盖率,所以最近可以写写单元测试,为了自己和部门能够达标,所以单侧很重要了哦。这一篇主要讲解跟jdbc一个很像,但是很轻量级的工具类。主要用于连接
DruidDataSource的参考配置
以下是Druid连接池的参考配置,可根据不同的应用场景进行相应的修改:
springboot - 集成mysql实现方式之一,DruidDataSource 完整代码实现
首先springboot 集成mysql的方式很多,jdbcTemplate ,mybatis 都可以; 这里选用的是阿里开源数据持久层处理框架:druid;    【强大到爆炸的工具,但也只是工具】 1.配置数据源 .properties 文件配置数据源,加载驱动 #集成mysql #spring.datasource.driver-class-name=com.mysql.
druid连接池jar包
这是淘宝用的数据库连接池,里面提供了druid所有jar包
Springboot整合druid的具体过程
网上的教程要么不全,要么有点坑,所以成功了之后留作纪念,仅供自己参考,水平有限,不足之处多多包涵。 1.建立一个springboot项目的过程网上都有,自己配置好数据库连接什么的,就不多叙述了。 2.application.properties里面配置上相关参数:(为什么不用yml文件,yml里面有的属性设置不了,暂时不想深究)具体参数如下:参数的具体意思去看看druid的项目,注意添加drui
使用Druid批量更新报错解决方案
Druid批量更新报错 Caused by: java.sql.SQLException: sql injection violation, multi-statement not allowcom.alibaba.druid.wall.WallFilter.check(WallFilter.java:714) atcom.alibaba.druid.wall.WallFilter.conne...
SSM整合系列之 配置阿里DruidDataSource并实现SQL监控
Druid是阿里巴巴开源平台上一个数据库连接池实现,它结合了C3P0、DBCP、PROXOOL等DB池的优点,同时加入了日志监控,可以很好的监控DB池连接和SQL的执行情况。正常访问路IP地址/项目名/druid/index.html
druid 连接池异常
springmvc框架集成druid链接池启动无法初始化链接异常 尝试了很多方法都没弄好,后来查询到两个方向 1.jdk版本 有人说jdk1.8 socket使用代理造成的。换了1.6.1.7都没修复 2.网络问题 The last packet sent successfully to the server was 0 milliseconds ago. The drive...
druid数据连接池实例化失败的问题
最近在用druid的数据库连接池,在eclipse代码运行正常,当打包成jar就会报  java.lang.NoClassDefFoundError: Could not initialize class***的错误,因为开发进度的原因只能抽时间查问题.后来发现是连接池类中static初始化的问题.原来参考的代码出处:点击打开链接. 其中涉及到静态块、静态变量、静态方法、构造函数的加载顺序
canal配置使用
canal配置使用 项目中遇到mysql与redis同步问题,之前使用gearman,需要编写mysql触发器与同步的逻辑代码,复杂并且不易于维护。 尝试使用阿里的canal组件实现mysql redis同步。 canal项目地址 https://github.com/alibaba/canal mysql配置 目前canal test已支持mysql 5.7.13 / 5....
druid配置数据库连接使用密文密码
druid配置数据库连接使用密文密码 spring使用druid配置dataSource片段代码 dataSource配置 <!-- 基于Druid数据库链接池的数据源配置 --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method=
Druid使用说明书
欢迎大家使用Druid,常见问题在这里解答,希望对大家有所帮助。 1. Druid是什么? Druid是Java语言中最好的数据库连接池。Druid能够提供强大的监控和扩展功能。 2. 在哪里下载druid 正式版本下载: maven中央仓库: http://central.maven.org/maven2/com/alibaba/druid/  3.
druid在spring中的配置已经maven中的配置
com.alibaba druid 1.0.18 org.wisdom-framework mysql-connector-java 5.1.34_1 org.springframework spring-jdbc ${version.spring-framework} 这里不用mysql中的mysq
DBCP和Druid数据库连接池使用
需要用到的jar包,commons-dbcp2-*.jar、commons-logging-*.jar、commons-pool2-*.jar,*代表版本号DataSourceTest类package com.edu.zzu.Util;import org.apache.commons.dbcp2.BasicDataSourceFactory; import org.apache.commons.l