用c3p0链接mysql总是出现Unknown system variable 'query_cache_size'

在进行DBCP没有错误而在尝试c3p0链接mysql的时候总是出现这几个问题,之前一直以为是版本的问题就把
mysql的版本和驱动版本都更新到最新,可是还是一样的错误,然后又调大的xml的配置可还是同样的问题

警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@605b17a1 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
java.sql.SQLException: Unknown system variable 'query_cache_size'
....
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@48140564 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
java.sql.SQLException: Connections could not be acquired from the underlying database!
...

Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
...
Caused by: java.sql.SQLException: Unknown system variable 'query_cache_size'
...
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@48140564 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.

配置信息:

<default-config>
        <!-- 基本配置 -->
        <property name="driverClass">com.mysql.cj.jdbc.Driver</property>
        <property name="jdbcUrl">jdbc:mysql://127.0.0.1:3306/day07?useSSL=false&amp;serverTimezone=UTC</property>
        <property name="user">root</property>
        <property name="password">123456</property>

        <!--扩展配置-->
        <property name="checkoutTimeout">50000</property>
        <property name="idleConnectionTestPeriod">30</property>
        <property name="initialPoolSize">10</property>
        <property name="maxIdleTime">50</property>
        <property name="maxPoolSize">5000</property>
        <property name="minPoolSize">10</property>
        <property name="maxStatements">200</property>
    </default-config> 

3个回答

好歹配置信息发错来,你这个错误是数据库链接配置有错误。发出来,看看就知道了

qq_23126581
渊渟无迹静涛君 回复Dell.Chen: 还用户是user?还是username? <property name="user">root</property>
4 个月之前 回复
qq_23126581
渊渟无迹静涛君 回复Dell.Chen: pom文件里改如下:<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.19</version> </dependency>
4 个月之前 回复
csw3186016056
Dell.Chen 原本用DBCP的时候都可以,然后改用c3p0就不行了
4 个月之前 回复
csw3186016056
Dell.Chen 谢谢啦,不过这个我有检查过,我驱动的版本和mysql的版本都已经是最新的了都是8.0.19
4 个月之前 回复

更新:
我把驱动换成5.1.48后就没报错了,但是我自己的数据库明明是8.0.12,怎么都没想到竟然要用5.1.48!


请问你最后解决了吗。我也是这个问题,之前单元测试的时候提示过了,我已经把驱动改成了8.0.11,测试通过;后来接口测试的时候又出现Unknown system variable 'query_cache_size',把8.0.11到8.0.19都用遍了还是不行,同时单元测试里面插入数据是没问题的。卡了两天了

walterfilan
walterfilan 回复Dell.Chen: 我把驱动换成5.1.48后就没报错了,但是我自己的数据库明明是8.0.12,怎么都没想到竟然要用5.1.48
4 个月之前 回复
csw3186016056
Dell.Chen 之前的还是总有问题,所以我索性就换成了mysql5和驱动了,然后就好了
4 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
c3p0关于mysql8小时的问题

jar包:c3p0-0.9.5-pre6.jar mchange-commons-java-0.2.6.3.jar 背景:以前在使用ORM框架的情况下,使用连接池没出现过空闲连接超时的问题,现在新建个项目没什么框架,使用c3p0,代码如下: [code="java"] private static ComboPooledDataSource ds = null; static { try { ds = new ComboPooledDataSource(); ds.setDriverClass(Constant.DRIVER_CLASS_NAME); ds.setJdbcUrl(Constant.URL); ds.setUser(Constant.USERNAME); ds.setPassword(Constant.PASSWORD); ds.setMaxPoolSize(40); ds.setMinPoolSize(5); ds.setAutomaticTestTable("C3P0TestTable"); ds.setIdleConnectionTestPeriod(1800); ds.setTestConnectionOnCheckin(true); ds.setTestConnectionOnCheckout(true); ds.setMaxIdleTime(25000); } catch (PropertyVetoException e) { gLog.error("ComboPooledDataSource", e); } } public static synchronized Connection getConn() { Connection con = null; try { con = ds.getConnection(); } catch (SQLException e1) { gLog.error("getConn", e1); } return con; } [/code] [color=red]有个线程用 getConn()获取连接后,长时间不进行数据库操作,隔天触发数据库操作时会报异常[/color] [code="java"] com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Software caused connection abort: socket write error STACKTRACE: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:144) ** END NESTED EXCEPTION ** Last packet sent to the server was 0 ms ago. at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2652) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:144) [/code] 有个线程一直有进行数据库操作,则正常,因此判断是MYSQL8小时问题。但是代码里几个重要属性已经配置了,是否哪里还漏了,错了。 求教!

关于数据库连接(c3p0连接mysql)出现的问题

本来是想通过jsp页面添加一个数据,跳转到访问serlvlet页面通过jbutils连接mqsql保存数据,但是我检查了c3p0的配置文件和datasource对象,queryrunner对象都可以正常新建,具体问题找不到,谢谢大家了这是访问页面的报错代码 HTTP Status 500 - java.lang.RuntimeException: java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in type Exception report message java.lang.RuntimeException: java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in serviceimp.FoodTypeService.save(FoodTypeService.java:62) servlet.FoodTypeServlet.addFoodType(FoodTypeServlet.java:65) servlet.FoodTypeServlet.doGet(FoodTypeServlet.java:44) servlet.FoodTypeServlet.doPost(FoodTypeServlet.java:105) javax.servlet.http.HttpServlet.service(HttpServlet.java:643) javax.servlet.http.HttpServlet.service(HttpServlet.java:723) root cause java.lang.RuntimeException: java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in daoimp.FoodTypeDao.save(FoodTypeDao.java:36) serviceimp.FoodTypeService.save(FoodTypeService.java:59) servlet.FoodTypeServlet.addFoodType(FoodTypeServlet.java:65) servlet.FoodTypeServlet.doGet(FoodTypeServlet.java:44) servlet.FoodTypeServlet.doPost(FoodTypeServlet.java:105) javax.servlet.http.HttpServlet.service(HttpServlet.java:643) javax.servlet.http.HttpServlet.service(HttpServlet.java:723) root cause java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:200) org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:437) daoimp.FoodTypeDao.save(FoodTypeDao.java:34) serviceimp.FoodTypeService.save(FoodTypeService.java:59) servlet.FoodTypeServlet.addFoodType(FoodTypeServlet.java:65) servlet.FoodTypeServlet.doGet(FoodTypeServlet.java:44) servlet.FoodTypeServlet.doPost(FoodTypeServlet.java:105) javax.servlet.http.HttpServlet.service(HttpServlet.java:643) javax.servlet.http.HttpServlet.service(HttpServlet.java:723) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.39 logs.

c3p0连接mysql报错,c3p0配置都没问题

连不上数据库,这是什么问题?c3p0和数据库都是最新的,怎么解决呀刚学完数据库 **c3p0配置文件:** ![图片说明](https://img-ask.csdn.net/upload/202005/26/1590495445_795157.png) **错误信息:** ![图片说明](https://img-ask.csdn.net/upload/202005/26/1590495336_729782.png) 信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hgery9aamg43f4v0ld9h|1e1c931e, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hgery9aamg43f4v0ld9h|1e1c931e, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc:mysql://localhost:3306/jdbctest?useSSL=false&serverTimezone=UTC, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 30, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 100, maxStatements -> 200, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]

使用c3p0连接ORACLE数据库查询不到数据,SQLPLUS执行相同SQL可以查到

搭建一个webservice 使用c3p0连接oracle数据库,在执行查询语句,查询同一条数据的时候,有的时候查询不到结果,而有的时候查询到结果,服务还不报错,在使用SQLPLUS执行该语句的时候每次都能查到结果,求大神帮忙推测一下是什么问题。 使用c3p0创建一个静态的ComboPooledDataSource对象,当需要的时候从这里获取连接 Connection conn = comb.getConnection(); 数据库是按照日期建的分区表,执行查询语句的时候没有按照分区表查询,这会不会有影响。

c3p0连接数据库的时候出现报错

在写项目是出现以下报错:Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgeby99jtb023ayfd55l|55facbdb, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgeby99jtb023ayfd55l|55facbdb, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, jdbcUrl -> jdbc:mysql://localhost:3306/bookstore, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 8, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 2, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, statementDestroyerNumActiveThreads -> -1, statementDestroyerNumConnectionsInUseAllUsers -> -1, statementDestroyerNumConnectionsInUseDefaultUser -> -1, statementDestroyerNumConnectionsWithDeferredDestroyStatementsAllUsers -> -1, statementDestroyerNumConnectionsWithDeferredDestroyStatementsDefaultUser -> -1, statementDestroyerNumDeferredDestroyStatementsAllUsers -> -1, statementDestroyerNumDeferredDestroyStatementsDefaultUser -> -1, statementDestroyerNumIdleThreads -> -1, statementDestroyerNumTasksPending -> -1, statementDestroyerNumThreads -> -1, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]是怎么回事?怎样去解决?求大牛指导

求助:SSM用c3p0连接mysql时Could not get JDBC Connection

【控制台log】 严重: Servlet.service() for servlet [spring_mvc] in context with path [/P_AI] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database! ### The error may exist in config/mybatis/mapper/CommAdminMapper.xml ### The error may involve cn.java.demo.mapper.CommAdminMapper.selectAdminByInfo ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!] with root cause com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1002) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:293) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:348) at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:120) at com.mchange.v2.c3p0.ComboPooledDataSource.getConnection(ComboPooledDataSource.java:601) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336) at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) at com.sun.proxy.$Proxy13.selectOne(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at com.sun.proxy.$Proxy14.selectAdminByInfo(Unknown Source) at cn.java.demo.dao.impl.CommAdminDaoImpl.selectAdminByInfo(CommAdminDaoImpl.java:21) at cn.java.demo.logic.impl.CommAdminLogicImpl.selectAdminByInfo(CommAdminLogicImpl.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy18.selectAdminByInfo(Unknown Source) at cn.java.demo.controller.CommAdminController.admin(CommAdminController.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:175) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

使用c3p0连接池是出现了空指针异常

连接不上我的mysql数据库,但是我单独测试又可以连接上,测试代码如下: Connection conn = null; Statement stmt = null; ResultSet rs = null; try { Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/shi"; String name = "root"; String password = "root"; conn = DriverManager.getConnection(url, name, password); String sql = "select * from t_user"; stmt = conn.createStatement(); rs = stmt.executeQuery(sql); while(rs.next()) { String username = rs.getString("name"); System.out.println(username); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } finally { if(rs != null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } if(stmt != null) { try { stmt.close(); } catch (SQLException e) { e.printStackTrace(); } } if(rs != null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } } 但是使用c3p0的时候就出问题了: c3p0的配置如下: <?xml version="1.0" encoding="UTF-8"?> <c3p0-config> <default-config> <property name="jdbcUrl">jdbc:mysql://localhost:3306/shi?useUnicode=true&amp;characterEncoding=utf8</property> <property name="driverClass">com.mysql.jdbc.Driver</property> <property name="user">root</property> <property name="password">root</property> <!-- <property name="jdbcUrl">jdbc:oracle:thin:@localhost:1521:orcl</property> <property name="driverClass">oracle.jdbc.driver.OracleDriver</property> <property name="user">scott</property> <property name="password">tiger</property> --> <property name="c3p0.testConnectionOnCheckout">true</property> <property name="acquireIncrement">3</property> <property name="initialPoolSize">10</property> <property name="minPoolSize">2</property> <property name="maxPoolSize">10</property> </default-config> </c3p0-config> 出现的异常如下: kate Tom 2014-8-9 9:31:05 com.mchange.v2.log.MLog 信息: MLog clients using java 1.4+ standard logging. 2014-8-9 9:31:06 com.mchange.v2.c3p0.C3P0Registry 信息: Initializing c3p0-0.9.5-pre8 [built 04-April-2014 04:20:15 -0700; debug? true; trace: 10] 2014-8-9 9:31:06 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource 信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 2sa1hd931f5tqer1kt6lht|2c766a24, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> null, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceUseNamedDriverClass -> false, identityToken -> 2sa1hd931f5tqer1kt6lht|2c766a24, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ] 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6c3b78cf -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:278) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:158) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1814) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@5c1fe88d is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@53416c84 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:278) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:158) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1814) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) at jdbcUtils.JdbcUtils.getConnection(JdbcUtils.java:44) at jdbcUtils.TestUtils.main(TestUtils.java:59) Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1422) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683) ... 3 more 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@5c1fe88d is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@58a2353d -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:278) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:158) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1814) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@5c1fe88d is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.

Hibernate配置C3P0连接池报错

Hibernate+MySQL部署出现了java.net.SocketException: Broken pipe (Write failed)这个错误,查百度说是因为MySQL默认连接8小时的问题,所以想采用C3P0,附上Hibernate.xml配置如下: ``` <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <!-- Generated by MyEclipse Hibernate Tools. --> <hibernate-configuration> <session-factory> <property name="myeclipse.connection.profile">sces</property> <property name="connection.url"><![CDATA[jdbc:mysql://localhost:3306/sces?useUnicode=true&characterEncoding=UTF-8]]></property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="dialect"> org.hibernate.dialect.MySQLDialect </property> <property name="connection.password">123456</property> <property name="connection.username">root</property> <!--c3p0设置--> <!--<property name="connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property>--> <!--<property name="hibernate.c3p0.min_size">5</property>--> <!--<property name="hibernate.c3p0.max_size">20</property>--> <!--<property name="hibernate.c3p0.max_statements">100</property>--> <!--<property name="hibernate.c3p0.timeout">3600</property>--> <!--<property name="hibernate.c3p0.idle_test_period">120</property>--> <!--<property name="hibernate.c3p0.acquire_increment">2</property>--> <mapping resource="entity/DCharacteristic.hbm.xml" /> <mapping resource="entity/DIops.hbm.xml" /> <mapping resource="entity/DPool.hbm.xml" /> <mapping resource="entity/DStatus.hbm.xml" /> <mapping resource="entity/Device.hbm.xml" /> <mapping resource="entity/User.hbm.xml" /> <mapping resource="entity/DDl.hbm.xml" /> <mapping resource="entity/Systeminfo.hbm.xml" /> <mapping resource="entity/DCapacity.hbm.xml"/> <mapping resource="entity/DErrlog.hbm.xml"/> <mapping resource="entity/DRack.hbm.xml"/> </session-factory> </hibernate-configuration> ``` 中间注释掉的为c3p0的部分,现在这种情况下能正常运行,但是打开c3p0后会报错: ``` 十二月 26, 2017 3:02:49 下午 com.mchange.v2.resourcepool.BasicResourcePool 警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@58f663e4 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getDriver(DriverManager.java:278) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) ``` 看起来是找不到驱动,但是明明不开连接池的时候能正常跑的,说明驱动没问题呀,为什么会这样呢 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 补充:直接在IDE中运行读取数据库的操作可以正常运行,但是把程序放到tomcat中就会 报这个错误,MySQL的驱动在tomcat的bin和lib中都放了,求解!!!!!

c3p0 连接数据库超时问题

我在工程里面使用c3p0做数据库连接池。在测试功能时平方重启应用。发现在重启时出现连接数据库超时。如果重新再重启应用将能够正常连接数据库。 提示超时的速度非常快,正常连接不上数据库会60秒后再提示连接超时。 是否有人遇到同样的问题? c3p0配置如下: ``` <property name="checkoutTimeout">30000</property> <property name="idleConnectionTestPeriod">1200</property> <property name="maxIdleTime">800</property> <property name="maxIdleTimeExcessConnections">120</property> <property name="maxConnectionAge">200</property> <property name="unreturnedConnectionTimeout">1000</property> <property name="maxPoolSize">300</property> <property name="minPoolSize">50</property> <property name="initialPoolSize">50</property> <property name="acquireIncrement">1</property> <property name="numHelperThreads">8</property> ```

c3p0+mysql session资源不释放

程序正常启动后获得正常的连接数,在设定的时间内也正常释放了,但是一旦用户登录后数据库的连接sleep就超过设置的时间不再释放,程序中opensession的地方也已经手动关闭了,请问各位是属于什么问题? hibernate.cfg.xml配置文件如下: [code="java"] <session-factory> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.default_schema">demo_new</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password"></property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/demo_new</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property> <!-- 连接池 --> <property name="hibernate.connection.provider_class"> org.hibernate.connection.C3P0ConnectionProvider</property> <property name="hibernate.current_session_context_class">thread</property> <!-- 间隔多少秒检查空闲的连接,这里为了测试设置为30秒--> <property name="hibernate.c3p0.idle_test_period">30</property> <!-- hibernate.c3p0.timeout是设置c3p0.maxIdleTime,单位是秒 ,这里为了测试设置为30秒--> <property name="hibernate.c3p0.timeout">30</property> <!-- 最大连接数--> <property name="hibernate.c3p0.max_size">300</property> <!-- 保持最小的连接数--> <property name="hibernate.c3p0.min_size">15</property> <!-- 每次获取连接的数量 --> <property name="hibernate.c3p0.acquire_increment">5</property> <property name="hibernate.bytecode.use_reflection_optimizer"> false </property> <!-- JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements 属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。 如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0 --> <property name="hibernate.c3p0.max_statements">50</property> <!--Fetch Size 是设定JDBC的Statement读取数据的时候每次从数据库中取出的记录条数--> <property name="hibernate.jdbc.fetch_size">100</property> <!--Batch Size是设定对数据库进行批量删除,批量更新和批量插入的时候的批次大小,有点相当于设置Buffer缓冲区大小的意思--> <property name="hibernate.jdbc.batch_size">50</property> <!-- + | 在数据插入数据库之后,允许使用JDBC3 PreparedStatement.getGeneratedKeys() | 来获取数据库生成的key(键)。需要JDBC3+驱动和JRE1.4+, | 如果你的数据库驱动在使用Hibernate的标 识生成器时遇到问题,请将此值设为false. | 默认情况下将使用连接的元数据来判定驱动的能力. + --> <property name="hibernate.jdbc.use_get_generated_keys">true</property> <!-- 强制Hibernate按照被更新数据的主键,为SQL更新排序。这么做将减少在高并发系统中事务的死锁。 --> <property name="hibernate.order_updates">true</property> <property name="hibernate.connection.charSet">utf8</property> <property name="hibernate.connection.characterEncoding">utf8</property> <property name="hibernate.connection.useUnicode">true</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.format_sql">false</property> <property name="hibernate.use_sql_comments">false</property> <mapping package="com.pjgw.assetsys.entity" /> ........ [/code]

用struts1.2+tomcat5.5+mysql5.1+c3p0连接池开发 出现死机现象

用struts1.2+tomcat5.5+mysql5.1+c3p0连接池开发 出现死机现象 各位朋友,向大家请教一下,我们用struts1.2+tomcat5.5+mysql5.1+c3p0连接池开发一个web应用网站。 现在我们遇到的问题是:现有已经开发的几个模块,部署到linux服务器上,服务器使用的tomcat5.5,运行一段时间就会出现死机的现象,不能登陆及查询(即:数据库操作无响应),刚开始我们初步判断是连接池的原因(因为我们连接池用的单例模式,之前由于考虑不全,出现了两个连接池对象),但是后面我们已经修改了连接池,只有一个连接池对象,再发布测试还是出现这个现象。我们还是不能确定问题出现在哪里, 只是怀疑连接池的问题,我们又做了修改(将c3p0 连接池修改为struts1.2的数据源配置),再次发布到服务器上测试,还是出现相同的问题。 现在我们能推断的问题原因有以下几种情况: 1.连接池问题 (不能确定,应为我们修改了两次连接池,还是出现相同的问题) 2.tomcat 死掉 (不能确定,网上查找了资料,已经修改了tomcat启动参数 设置jvm 的虚拟内存: set JAVA_OPTS=-Xms512m -Xmx512m) 3.mysql 数据库死掉 (不能确定,如果是数据库服务器死掉,但是通过mysql的客户端可以正常操作查询等一些操作) [b]问题补充:[/b] 补充1:Connection,statement都是在应该关闭的地方关闭了的 补充2:没有使用hibernate 补充3:编译没有报错 [b]问题补充:[/b] 补充:程序能够运行一段时间,大概20分钟左右,然后才数据库操作无响应 [b]问题补充:[/b] 我们程序里有两个线程、每隔15分钟扫描一次数据库中表,同时还有用户不停的访问!!麻烦你能否给一个连接池的配置信息!谢谢!!

c3p0连接池使用,一直在打印无用日志,好像是一直在创建并销毁连接

使用C3p0连接池时,在空闲状态一直DEBUG打印如下日志,好像是一直在创建并销毁连接,要怎样配置才能够不一直创建销毁,创建后就保留起,如果连接不够再创建。 DEBUG c.m.v.resourcepool.BasicResourcePool - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@4ae0cd66 DEBUG c.m.v.c.i.C3P0PooledConnectionPool - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@4ae0cd66 DEBUG c.m.v.c.i.C3P0PooledConnectionPool - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@4ae0cd66 DEBUG c.m.v.resourcepool.BasicResourcePool - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@4ae0cd66 DEBUG c.m.v.resourcepool.BasicResourcePool - Checking for expired resources - Fri Sep 27 16:18:25 CST 2019 [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - BEGIN check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - FINISHED check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - Checking for expired resources - Fri Sep 27 16:18:26 CST 2019 [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - BEGIN check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - EXPIRED idle resource: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 ---> idle_time: 1966; max_idle_time: 1000 [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - Removing expired resource: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - FINISHED check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 DEBUG c.m.v.c.i.C3P0PooledConnectionPool - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 DEBUG c.m.v.c.i.C3P0PooledConnectionPool - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 DEBUG c.m.v.resourcepool.BasicResourcePool - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30

c3p0连接池的无法获得连接对象,按照视频里添加里驱动程序仍然显示java.sql.SQLException: No suitable driver

![图片说明](https://img-ask.csdn.net/upload/201911/18/1574046716_109697.png) 我的服务器版本是8.0.12的,驱动jar包官网只能下在8.0.18的但是听说好像是向下兼容的 c3po的配置文件 ``` <?xml version="1.0" encoding="utf-8"?> <c3p0-config> <default-config> <property name="driverClass">com.mysql.jdbc.Driver</property> <property name="jdbcUrl">jdbc:mysql://localhost:3306/test</property> <property name="user">root</property> <property name="password">123456</property> <property name="initialPoolSize">5</property> <property name="maxPoolSize">10</property> <property name="checkoutTimeout">3000</property> </default-config> <named-config name="otherc3p0"> <property name="user">root</property> <property name="password">123456</property> <property name="jdbcUrl">jdbc:mysql://localhost:3306/test</property> <property name="driverClass">com.mysql.jdbc.Driver</property> <!-- 如果池中数据连接不够时一次增长多少个 --> <property name="acquireIncrement">5</property> <!-- 初始化数据库连接池时连接的数量 --> <property name="initialPoolSize">20</property> <!-- 数据库连接池中的最大的数据库连接数 --> <property name="maxPoolSize">25</property> <!-- 数据库连接池中的最小的数据库连接数 --> <property name="minPoolSize">5</property> <property name="checkoutTimeout">3000</property> </named-config> </c3p0-config> ``` 主程序 ``` package cn.HSY; import com.mchange.v2.c3p0.ComboPooledDataSource; import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; public class DataSoure01 { public static void main(String[] args) throws SQLException { DataSource dataSource=new ComboPooledDataSource(); Connection connection=dataSource.getConnection(); System.out.println(connection); } } ```

C3P0链接池关闭错误导致的线程问题如何解决

ssh框架下使用c3p0连接池启动tomcat服务器报出如下错误:The web application [RupengElec] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. 请问这个错误是什么引起的,如何解决? ``` <!-- c3p0数据库连接池配置 --> <bean name="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/ElecProject?useUnicode=true&amp;characterEncoding=utf8"></property> <property name="driverClass" value="com.mysql.jdbc.Driver"></property> <property name="user" value="root"></property> <property name="password" value="root"></property> <property name="initialPoolSize" value="5"></property> <property name="maxPoolSize" value="30"></property> <property name="minPoolSize" value="3"></property> </bean> ```

c3p0 连接不释放 请路过的大神过来看看

配置文件如下 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <context:annotation-config /> <!-- 打开Spring的Annotation支持 --> <!-- 设定Spring 去哪些包中找Annotation --> <context:component-scan base-package="com.myd" /> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${driverClass}" /> <property name="jdbcUrl" value="${jdbcUrl}" /> <property name="user" value="${username}" /> <property name="password" value="${password}" /> <!-- 配置连接池的初始值 --> <property name="acquireIncrement" value="${acquireIncrement}" /> <property name="maxPoolSize" value="${maxPoolSize}" /> <property name="minPoolSize" value="${minPoolSize}" /> <property name="initialPoolSize" value="${initialPoolSize}" /> <property name="maxIdleTime" value="${maxIdleTime}" /> <property name="checkoutTimeout" value="${checkoutTimeout}" /> <property name="autoCommitOnClose" value="${autoCommitOnClose}"></property> <property name="acquireRetryDelay" value="${acquireRetryDelay}" /> <property name="idleConnectionTestPeriod" value="${idleConnectionTestPeriod}"></property> <property name="maxStatements" value="${maxStatements}"></property> <property name="numHelperThreads" value="${numHelperThreads}"></property> </bean> <!-- 导入src目录下的c3p0.properties文件 --> <context:property-placeholder location="classpath:c3p0.properties" /> <!--创建Spring的SessionFactory工厂 --> <!-- 如果使用的是Annotation的方式,不能使用LocalSessionFactoryBean,而应该使用 org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <!-- 注入数据源 --> <property name="dataSource" ref="dataSource" /> <!-- 设置Spring取那个包中查找相应的实体类 --> <property name="packagesToScan"> <value>com.myd.entity</value> </property> <property name="hibernateProperties"> <!-- <value> hibernate.dialect=org.hibernate.dialect.HSQLDialect </value> --> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.autoReconnect">true</prop> <prop key="jdbc.use_scrollable_resultset">false</prop> <prop key="hibernate.connection.release_mode">after_statement</prop> <prop key="hibernate.c3p0.validate">true</prop> <prop key="hibernate.c3p0.idle_test_period">30</prop> <prop key="hibernate.c3p0.timeout">30</prop> <prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop> </props> </property> </bean> <!-- 开启HibernateTemplate,并且为其注入SessionFactory 使用HibernateTemplate不太方便的就是要获取session得通过getSessionFactory()方法获取 --> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- 配置Spring的事务处理 --> <!-- 创建事务管理器 --> <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- 配置AOP,Spring是通过AOP来进行事务管理的 --> <aop:config> <!-- 设置pointCut表示哪些方法要加入事务处理 --> <!-- 以下的事务是声明在DAO中,但是通常都会在Service来处理多个业务对象逻辑的关系,注入删除,更新等,此时如果在执行了一个步骤之后抛出异常 就会导致数据不完整,所以事务不应该在DAO层处理,而应该在service,这也就是Spring所提供的一个非常方便的工具,声明式事务 --> <aop:pointcut id="allMethods" expression="execution(* com.myd.service.*.*(..))" /> <!-- 通过advisor来确定具体要加入事务控制的方法 --> <aop:advisor advice-ref="txAdvice" pointcut-ref="allMethods" /> </aop:config> <!-- 配置哪些方法要加入事务控制 --> <tx:advice id="txAdvice" transaction-manager="txManager"> <tx:attributes> <!-- 让所有的方法都加入事务管理,为了提高效率,可以把一些查询之类的方法设置为只读的事务 --> <tx:method name="*" propagation="REQUIRED" read-only="true" /> <!-- 以下方法都是可能设计修改的方法,就无法设置为只读 --> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> </tx:attributes> </tx:advice> <bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"> <property name="corePoolSize" value="5" /> <property name="maxPoolSize" value="50" /> <property name="queueCapacity" value="1000" /> <property name="keepAliveSeconds" value="60" /> </bean> </beans> 这是事务 package com.myd.dao.impl; import java.lang.reflect.ParameterizedType; import java.sql.SQLException; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.Resource; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.SQLQuery; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.transform.Transformers; import org.springframework.dao.DataAccessResourceFailureException; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import org.springframework.stereotype.Repository; import com.myd.dao.BaseDao; /** * 可以考虑把所有公共的方法都写在baseDAo中,让所有的DAO都继承BaseDao * 这样基本上就实现了大量的基础方法,如果DAO中有逻辑处理特殊的方法,再在具体的实现类中的DAO中创建 * * @author Administrator * * @param <T> */ @Repository("baseDaoImpl") public class BaseDaoImpl<T> extends HibernateDaoSupport implements BaseDao<T> { /** * 此处不能使用setSessionFactory注入,因为setSessionFactory在HibernateDaoSupport * 中已经定义了而且还是final的,不能被覆盖 * * @param sessionFactory */ @Resource(name = "sessionFactory") public void setSuperSessionFactory(SessionFactory sessionFactory) { super.setSessionFactory(sessionFactory); } /** * 创建Class的对象来获取泛型的class */ private Class<Object> clz; @SuppressWarnings("unchecked") public Class<Object> getClz() { if (clz == null) { // 获取泛型的Class对象 clz = (Class<Object>) ((ParameterizedType) getClass() .getGenericSuperclass()).getActualTypeArguments()[0]; } return clz; } public void add(T t) { getHibernateTemplate().getSessionFactory().openSession(); getHibernateTemplate().save(t); getHibernateTemplate().getSessionFactory().close(); } public void delete(int id) { getHibernateTemplate().getSessionFactory().openSession(); getHibernateTemplate().delete(load(id)); getHibernateTemplate().getSessionFactory().close(); } @SuppressWarnings("deprecation") public void update(T t) { try { getHibernateTemplate().getSessionFactory().openSession() .connection().prepareStatement("SET SQL_SAFE_UPDATES=0") .execute(); } catch (DataAccessResourceFailureException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (HibernateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } getHibernateTemplate().update(t); getHibernateTemplate().getSessionFactory().close(); } 现在的问题是 运行一段时间后,就卡起, 不是报连接数据库关闭 就是 返回空指针 查了以下是连接未释放导致的,我想请教下各位大神 我这样连接没关闭并回到连接池吗?

c3p0出现了一场,每次都这样

五月 11, 2017 4:36:34 下午 com.mchange.v2.log.MLog <clinit> INFO: MLog clients using java 1.4+ standard logging. 五月 11, 2017 4:36:34 下午 com.mchange.v2.c3p0.C3P0Registry banner INFO: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10] 五月 11, 2017 4:36:34 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 2rxmcq9n1wfqr40a71csj|c12241e, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 2rxmcq9n1wfqr40a71csj|c12241e, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql:///day19_1, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

c3p0连接数据库提示Access denied for user 'root'@'localhost' (using password: YES)

While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 1,c3p0.properties配置 ``` c3p0.driverClass=com.mysql.jdbc.Driver c3p0.url=jdbc:mysql://localhost:3306/store38?3useUnicode=true&characterEncoding=utf8 c3p0.user=root c3p0.password=12345 ``` datasourceUtils ``` package com.itheima.utils; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.sql.DataSource; import com.mchange.v2.c3p0.ComboPooledDataSource; public class DataSourceUtils { private static ComboPooledDataSource ds=new ComboPooledDataSource(); /** * 获取数据源 * @return 连接池 */ public static DataSource getDataSource(){ return ds ; } /** * 释放资源 * @param conn * @param st * @param rs */ public static void CloseResource(Connection conn,Statement st , ResultSet rs){ closeResultSet(rs); closeStaement(st); closeConn(conn); } /** * 获取连接 * @return 连接 * @throws SQLException */ public static Connection getConnection() throws SQLException{ return ds.getConnection(); } /** *释放连接 * @param conn * 连接 */ public static void closeConn(Connection conn){ if(conn!=null){ try { conn.close(); } catch (SQLException e) { e.printStackTrace(); }finally{ conn = null ; } } } /** * 释放语句执行者 * @param st * 语句执行者 */ public static void closeStaement(Statement st){ if(st!=null){ try { st.close(); } catch (SQLException e) { e.printStackTrace(); }finally{ st = null ; } } } /** * 释放结果集 * @param rs * 结果集 */ public static void closeResultSet(ResultSet rs){ if(rs!=null){ try { rs.close(); } catch (SQLException e) { e.printStackTrace(); }finally{ rs = null ; } } } }

c3p0怎么可以连接多个数据库?

我的项目用c3p0连接数据库直接用Session session = HibernateSessionFactory.currentSession(); public class HibernateSessionFactory{ private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml"; private static final ThreadLocal<Session> threadLocal = new ThreadLocal<Session>(); private static Configuration configuration = new Configuration(); private static org.hibernate.SessionFactory sessionFactory; private static String configFile = CONFIG_FILE_LOCATION; static { try { configuration.configure(configFile); sessionFactory = configuration.buildSessionFactory(); } catch (Exception e) { System.err .println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } } private HibernateSessionFactory() { } ![图片说明](https://img-ask.csdn.net/upload/201501/07/1420599832_284498.png) 请问怎么配置数据源,然后在dao里调用啊

怎样以c3p0方式连接Oracle数据库

怎样以c3p0方式连接Oracle数据库,搭载ssh框架,求applicationContext.xml配置

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

抖音上很火的时钟效果

反正,我的抖音没人看,别人都有几十万个赞什么的。 发到CSDN上来,大家交流下~ 主要用到原生态的 JS+CSS3。 具体不解释了,看注释: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Title&lt;/tit...

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

手机经常收到"回复TD退订",回还是不回?今天总算是弄清楚了

自从有了微信和QQ,手机短信几乎很少再用了,但是我们手机里面还是经常会收到"回复TD退订"的消息,那到底要不要回复呢?今天就来告诉大家! 信息内容可能包括 推销信息 品牌活动日的时候,会根据你的用户浏览信息,或者购买记录,后续发送一些降价消息。 但是笔者想说我是缺那10块钱的人嘛,我缺的是1000块。 垃圾信息 虽然我们已经不经常用短信功能,但是还是有不少...

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试官问我:如何加载100M的图片却不撑爆内存

还记得当年面试一个面试官问我怎么加载巨图才能不撑爆内存,我没回答上来,他说分片显示,我寻思特么分片能减少内存使用??现在可以打他脸了! 内容扩展 1.图片的三级缓存中,图片加载到内存中,如果内存快爆了,会发生什么?怎么处理? 2.内存中如果加载一张 500*500 的 png 高清图片.应该是占用多少的内存? 3.Bitmap 如何处理大图,如一张 30M 的大图,如何预防 OOM? A...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

又出事了?网站被攻击了?高中生?

北京时间2020年3月27日9点整,如往常一样来到公司,带开电脑,正准备打开Github网站看一会源代码,再开始手头的工作。哟吼,一直打不开,一直出现如下页面: 我想很多网友也尝到了甜头,各大技术群炸开了锅,据网友反馈有攻击者正在发起大规模的中间人挟持,京东和Github等网站等网站都受到了影响。 什么是中间中间人挟持呢? 简而言之,就是攻击者在数据网络传输的过程中,截获传输过程中的数据并篡改...

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

6年开发经验女程序员,面试京东Java岗要求薪资28K

写在开头: 上周面试了一位女程序员,上午10::30来我们部门面试,2B哥接待了她.来看看她的简历: 个人简历 个人技能: ● 熟悉spring mvc 、spring、mybatis 等框架 ● 熟悉 redis 、rocketmq、dubbo、zookeeper、netty 、nginx、tomcat、mysql。 ● 阅读过juc 中的线程池、锁的源...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

工作八年,月薪60K,裸辞两个月,投简历投到怀疑人生!

近日,有网友在某职场社交平台吐槽,自己裸辞两个月了,但是找工作却让自己的心态都要崩溃了,全部无果,不是已查看无回音,就是已查看不符合。 “工作八年,两年一跳,裸辞两个月了,之前月薪60K,最近找工作找的心态崩了!所有招聘工具都用了,全部无果,不是已查看无回音,就是已查看不符合。进头条,滴滴之类的大厂很难吗???!!!投简历投的开始怀疑人生了!希望 可以收到大厂offer” 先来看看网...

推荐9个能让你看一天的网站

分享的这9个保证另你意外的网站,每个都非常实用!非常干货!毫不客气的说,这些网站最少值10万块钱。 利用好这些网站,会让你各方面的技能都得到成长,不说让你走上人生巅峰,但对比现在的你,在眼界、学识、技能方面都有质的飞跃。 一、AIRPANO 传送门:https://www.airpano.com/360photo_list.php 这是一个可以躺在家里,就能环游世界的神奇网站。 世界那么大,绝大多...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

月薪22K程序员,打卡迟到10次,收到工资短信一脸懵逼

每家公司为了保证公司员工每天的工作时间,一般都会采用上下班打卡的工作制度,这其实是一个很常见的是,本身也没有什么问题的。正所谓无规矩不成方圆,公司肯定是有公司的规矩,虽然每个员工都很不喜欢这些规矩来束缚我们,但是公司也只是为了能更好的管理员工。但是一家公司如果一成不变的使用打卡制度,而不会去变通管理,也真不一定是好事。 打卡制度特别对于销售部门来说,不但会让公司发展不起来,还很容易丢失员工。但如...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

十个摸鱼,哦,不对,是炫酷(可以玩一整天)的网站!!!

文章目录前言正文**1、Kaspersky Cyberthreat real-time map****2、Finding Home****3、Silk – Interactive Generative Art****4、Liquid Particles 3D****5、WINDOWS93****6、Staggering Beauty****7、Ostagram图片生成器网址****8、全历史网址*...

我真的错了,我被跳槽后的高薪冲昏了头脑...

国内疫情已接近尾声,疫情对生活各个方面造成的影响,就是一场真实的“蝴蝶效应”。“全球最大安全套制造商因疫情停产,已造成一亿个安全套缺口”“口罩印钞机,月入千万的暴富神话”“百程旅行...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

​能让德国人放弃现金支付​,也没谁了

在新冠疫情中,德国人越来越多地选择在超市,加油站或其他商店付款时使用非接触式付款方式。德国信贷协会Deutschen Kreditwirtschaft (DK) 的一位发言人告诉德国新...

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问