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小时问题。但是代码里几个重要属性已经配置了,是否哪里还漏了,错了。
求教!

3个回答

修改mysql的配置文件,[url]http://www.2cto.com/database/201301/185712.html[/url]

xblueskyleng
xblueskyleng 我想我知道我的问题出在哪了,我的线程中,getconn是在while(true)的外面,所以8小时后还是会断掉。如果放在while里面,每次都getconn然后close释放应该就正常了
6 年多之前 回复
xblueskyleng
xblueskyleng c3p0有定时测试空闲连接的配置,这里的空闲连接,包含我已经获取了但是没触发数据库操作的连接吗?
6 年多之前 回复
zyn010101
zyn010101 你首先要对数据库连接池的原理有充分的了解:初始化一定数目的连接,需要的时候直接从连接池中取,避免创建连接释放连接的性能消耗,如果连接不够了则增加连接。连接池是认为里面的连接一直存在的,而mysql数据库在一个连接超时后就回收了。
6 年多之前 回复
xblueskyleng
xblueskyleng 解决这个问题的办法是可以通过数据库,也可以在线程中定时触发一下数据库,但是我想知道这C3P0问题出在哪。解决的方法倒是次要的。
6 年多之前 回复
zyn010101
zyn010101 用sql命令修改,暂时不用重启,等下次重启后修改配置文件。修改该参数不会影响数据库的数据和性能,不会产生其他影响的。
6 年多之前 回复
xblueskyleng
xblueskyleng 就是不想动MYSQL的配置文件,因为数据库要重启,而且改了这个参数,不知道是否会对其他人的程序的业务有影响。
6 年多之前 回复

c3p0应该有闲置多少时间把连接返库的配置吧

1、修改数据库配置
interactive_timeout=?
wait_timeout=?

2、c3p0在断开连接时,不能自动重连,所以不能保证连接池有连接。

3、建议使用proxool连接池。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
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+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]

关于数据库连接(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死锁问题,DEADLOCK!!!

环境是tomcat7 mysql5.6.33 jdk1.7 首先项目部署到tomcat中可以直接启动,用的是本机的mysql数据库, 但是在eclipse中运行项目就报c2p0死锁。修改了连接数也不管用。而且我重装了mysql也不行。eclipse和tomcat用的都是同一个mysql数据库。eclipse重新安装也还是这样子,求高手指导。 十一月 29, 2017 4:03:25 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.70 十一月 29, 2017 4:03:25 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom 信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [105] milliseconds. 十一月 29, 2017 4:03:27 下午 org.apache.catalina.startup.TldConfig execute 信息: 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 TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 十一月 29, 2017 4:03:27 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] 十一月 29, 2017 4:03:27 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 十一月 29, 2017 4:03:27 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 1988 ms 16:03:27,866 INFO [JForumBaseServlet ] Starting JForum. Debug mode is true 16:03:27,873 INFO [ConfigLoader ] Using cache engine: net.jforum.cache.DefaultCacheEngine 16:03:27,876 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.BBCodeRepository 16:03:27,878 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.RankingRepository 16:03:27,880 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.SmiliesRepository 16:03:27,881 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.ForumRepository 16:03:27,884 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.TopicRepository 16:03:27,887 INFO [ConfigLoader ] Creating an instance of net.jforum.SessionFacade 16:03:27,888 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.PostRepository 16:03:27,889 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.Tpl 16:03:27,891 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.RolesRepository 16:03:27,891 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.SecurityRepository 16:03:27,893 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.BanlistRepository 16:03:27,951 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/languages/en_US.properties 16:03:27,953 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/languages/zh_CN.properties 16:03:27,969 INFO [ConfigLoader ] Loading JDBC driver net.jforum.dao.mysql.MysqlDataAccessDriver 16:03:28,026 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/database/generic/generic_queries.sql 16:03:28,026 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/database/mysql/mysql.sql 16:03:28,027 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/SystemGlobals.properties 16:03:28,102 INFO [MLog ] MLog clients using log4j logging. 16:03:28,127 INFO [C3P0Registry ] Initializing c3p0-0.9.1-pre9 [built 23-September-2006 01:47:24; debug? true; trace: 10] 16:03:28,184 INFO [AbstractPoolBackedDataSource] Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 120000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 650b287f, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 650b287f, idleConnectionTestPeriod -> 3600, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/jforum?user=root&password=root&autoReconnect=true&useNewIO=false&zeroDateTimeBehavior=convertToNull&useServerPrepStmts=false&dumpQueriesOnException=true&jdbcCompliantTruncation=false&useUnicode=true&characterEncoding=utf8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 1000, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 180, usesTraditionalReflectiveProxies -> false ] 16:03:48,172 WARN [ThreadPoolAsynchronousRunner] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@23eb54ea -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! 16:03:48,174 WARN [ThreadPoolAsynchronousRunner] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@23eb54ea -- APPARENT DEADLOCK!!! Complete Status: Managed Threads: 3 Active Threads: 3 Active Tasks: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7dec08b1 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@132edd0d (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@69b28a51 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2) Pending Tasks: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4897020d com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@3207c8b6 Pool thread stack traces: Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main] java.lang.Thread.sleep(Native Method) com.mysql.jdbc.Connection.createNewIO(Connection.java:2828) com.mysql.jdbc.Connection.<init>(Connection.java:1531) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:120) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:143) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:132) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:129) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:862) com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:33) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1527) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main] java.lang.Thread.sleep(Native Method) com.mysql.jdbc.Connection.createNewIO(Connection.java:2828) com.mysql.jdbc.Connection.<init>(Connection.java:1531) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:120) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:143) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:132) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:129)

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中都放了,求解!!!!!

求助: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)

在spring的配置文件中配置c3p0和在hibernate的配置文件中配置c3p0有什么区别?

在spring的配置文件中配置c3p0和在hibernate的配置文件中配置c3p0有什么区别? 我最近在学习如何配置struts2+spring+hibernate,其中数据库连接池使用c3p0,一开始在hibernate.cfg.xml中添加c3p0连接的信息如下: ``` <property name="hibernate.connection.provider_class"> org.hibernate.c3p0.internal.C3P0ConnectionProvider </property> <property name="hibernate.c3p0.max_size">20</property> <property name="hibernate.c3p0.min_size">5</property> <property name="hibernate.c3p0.timeout">50000</property> <property name="hibernate.c3p0.max_statements">100</property> <property name="hibernate.c3p0.idle_test_period">3000</property> <!-- 当连接池耗尽并接到获得连接的请求,则新增加连接的数量 --> <property name="hibernate.c3p0.acquire_increment">2</property> ``` 然后找网上的帖子,发现很多c3p0都是配置在spring的配置文件中的,如: ``` <!-- 采用c3p0数据源 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/hibernate2" /> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="user" value="root" /> <property name="password" value="root" /> <!-- 配置数据库连接池,最大连接数 --> <property name="maxPoolSize" value="20" /> <!-- 配置数据库连接池,最小连接数 --> <property name="minPoolSize" value="1" /> <!-- 指定数据库连接池的初始化连接数 --> <property name="initialPoolSize" value="1" /> <!-- 指定数据库连接池的连接的最大空闲时间 --> <property name="maxIdleTime" value="10" /> </bean> ``` 这两个有什么关系呢?是一个意思?配置了一个地方另一个地方就不用配置了吧?

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链接池关闭错误导致的线程问题如何解决

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连接ORACLE数据库查询不到数据,SQLPLUS执行相同SQL可以查到

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

关于连接池和c3p0的问题

问题一:看了一些帖子说连接池是存放连接的,意思就是: 我创建了多个和数据源(mysql数据库)相连的链接,然后存放在连接池中,谁要是访问我的数据源(登录,注册等等动作)谁就拿一个链接,用完之后再放回连接池。 我理解的正确吗? 问题二:尝试了一下c3p0,感觉和以前做链接很不一样,以前做一个JDBCConnutil类,每个dao层中的类使用JDBCConn中的方法连接一次,c3p0和这个一样吗?为什么我连接不上。。

spring 配置c3p0出问题

使用spring配置c3p0出问题,mysql和c3p0的jar包都导入了,没有语法错误,但是出问题了,配置文件为: <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <!-- 使用属性文件 --> <property name="user" value="${user}"></property> <property name="password" value="${password}"></property> <property name="driverClass" value="${driverClass}"></property> <property name="jdbcUrl" value="${jdbcUrl}"></property> </bean> 异常:警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [bean-dataSource.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mchange.v2.c3p0.ComboPooledDataSource]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector

tomcat启动 c3p0死锁 ,测试,预发布没问题,生产环境启动c3p0死锁

2020-02-11 18:55:50.449  WARN c     : com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@6a749e11 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! 2020-02-11 18:55:50.452  WARN [C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-AdminTaskTimer] c.m.v.a.ThreadPoolAsynchronousRunner     : com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@6a749e11 -- APPARENT DEADLOCK!!! Complete Status:      Managed Threads: 3     Active Threads: 3     Active Tasks:          com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@258e6714             on thread: C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#0         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6bc4e1a2             on thread: C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#1         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@146123e0             on thread: C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#2     Pending Tasks:          com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@13c1fbf0         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@45a1985b         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@924a8bc         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1447f45b         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@8c59358         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@41efa15b         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6da29092 Pool thread stack traces:     Thread[C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#1,5,main]         java.net.SocketInputStream.socketRead0(Native Method)         java.net.SocketInputStream.socketRead(SocketInputStream.java:116)         java.net.SocketInputStream.read(SocketInputStream.java:170)         java.net.SocketInputStream.read(SocketInputStream.java:141)         com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:100)         com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:143)         com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:173)         com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2954)         com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:560)         com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1014)         com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2255)         com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2106)         com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2090)         com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795)         com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)         sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)         sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)         sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)         java.lang.reflect.Constructor.newInstance(Constructor.java:423)         com.mysql.jdbc.Util.handleNewInstance(Util.java:404)         com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)         com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327)         com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)         com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)         com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)         com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)         com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)         com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)         com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1908)         com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)     Thread[C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#0,5,main] <?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:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" 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.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"> <context:property-override location="classpath:config/properties/connection.properties" /> <!-- ================================= 数据源配置 ============================================= --> <bean id="dataSource1" class="com.mchange.v2.c3p0.ComboPooledDataSource"/> <bean id="dataSource101" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <!--preparedStatement 不会在数据库被 cached导致 连接数的被占用,checkoutOut的时候超时--> <property name="maxStatements" value="0"/> </bean> <bean id="dataSource2" class="com.mchange.v2.c3p0.ComboPooledDataSource"/> <bean id="dataSource3" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <!--preparedStatement 不会在数据库被 cached导致 连接数的被占用,checkoutOut的时候超时--> <property name="maxStatements" value="0"/> </bean> <!-- define the SqlSessionFactory --> <bean id="sessionFactory1" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource1"/> <property name="configLocation" value="classpath:config/mybatis/mybatis-Configuration.xml"/> <property name="mapperLocations"> <array> <value>classpath*:mapper/*Mapper.xml</value> </array> </property> </bean> <bean id="sessionFactory101" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource101"/> <property name="configLocation" value="classpath:config/mybatis/mybatis-Configuration.xml"/> <property name="mapperLocations"> <array> <value>classpath*:mapper/*Mapper.xml</value> </array> </property> </bean> <bean id="sessionFactory2" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource2"/> <property name="configLocation" value="classpath:config/mybatis/mybatis-Configuration.xml"/> <property name="mapperLocations"> <array> <value>classpath*:mapper/*Mapper.xml</value> </array> </property> </bean> <bean name="transactionManager1" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource1"/> </bean> <bean name="transactionManager101" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource101"/> </bean> <bean name="transactionManager2" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource2"/> </bean> <tx:annotation-driven transaction-manager="transactionManager1" /> <tx:annotation-driven transaction-manager="transactionManager101" /> <tx:annotation-driven transaction-manager="transactionManager2" /> <!-- 开启AOP 如果pointcut指向 controller则需要在springmvc的配置文件中配置 --> <aop:aspectj-autoproxy/> <tx:advice id="txAdvice" transaction-manager="transactionManager1"> <tx:attributes> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> </tx:attributes> </tx:advice> <aop:config expose-proxy="true"> <!-- 第一个*代表所有的返回值类型 第一个.代表子包 第二个*代表所有的类 第三个*代表类所有方法 第一个..代表所有的参数 --> <aop:pointcut id="txPointcut" expression="execution(* app.service..*.*(..))" /> <!-- Advisor定义,切入点和通知分别为txPointcut、txAdvice --> <aop:advisor pointcut-ref="txPointcut" advice-ref="txAdvice"/> </aop:config> </beans> ##DB config dataSource1.driverClass=com.mysql.jdbc.Driver dataSource1.jdbcUrl=url dataSource1.user= dataSource1.password= dataSource1.testConnectionOnCheckout=true dataSource1.maxPoolSize=200 dataSource1.minPoolSize=10 dataSource1.initialPoolSize=10 dataSource1.checkoutTimeout=30000 dataSource1.maxIdleTime=30 dataSource1.maxStatements=0 dataSource1.maxStatementsPerConnection=0 dataSource101.driverClass=com.mysql.jdbc.Driver dataSource101.jdbcUrl=url dataSource101.user= dataSource101.password= dataSource101.testConnectionOnCheckout=true dataSource101.maxPoolSize=200 dataSource101.minPoolSize=10 dataSource101.initialPoolSize=10 dataSource101.checkoutTimeout=30000 dataSource101.maxIdleTime=30 dataSource101.maxStatements=0 dataSource101.maxStatementsPerConnection=0 dataSource2.driverClass=com.mysql.jdbc.Driver dataSource2.jdbcUrl=jdbc:mysql://localhost:3306/aaa?useSSL=true&useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false dataSource2.user= dataSource2.password= dataSource2.testConnectionOnCheckout=true dataSource2.maxPoolSize=200 dataSource2.minPoolSize=10 dataSource2.initialPoolSize=10 dataSource2.checkoutTimeout=30000 dataSource2.maxIdleTime=30 dataSource2.maxStatements=0 dataSource2.maxStatementsPerConnection=0 dataSource3.driverClass=com.mysql.jdbc.Driver dataSource3.jdbcUrl=jdbc:mysql://localhost:3306/admin?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false dataSource3.user= dataSource3.password= dataSource3.testConnectionOnCheckout=true dataSource3.maxPoolSize=10 dataSource3.minPoolSize=5 dataSource3.initialPoolSize=5 dataSource3.checkoutTimeout=30000 dataSource3.maxIdleTime=30 dataSource3.maxStatements=0 dataSource3.maxStatementsPerConnection=0

java c3p0时不时的报异常,谁碰到过

** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Socket input is already shutdown STACKTRACE: java.net.SocketException: Socket input is already shutdown at java.net.Socket.shutdownInput(Socket.java:1361) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1683) at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4388) at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1368) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2654) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1474) at com.mysql.jdbc.DatabaseMetaData$9.forEach(DatabaseMetaData.java:4967) at com.mysql.jdbc.IterateBlock.doForAll(IterateBlock.java:51) at com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:4945) at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectio nNoQuery(DefaultConnectionTester.java:185) at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectio n(DefaultConnectionTester.java:62) at com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(Ab stractConnectionTester.java:67) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionRe sourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:368) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionRe sourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310) at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTa sk.run(BasicResourcePool.java:1999) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre adPoolAsynchronousRunner.java:547) ** END NESTED EXCEPTION ** 以下是连接池配置 jdbc.initialPoolSize = 10 jdbc.minPoolSize = 5 jdbc.maxPoolSize = 30 jdbc.acquireIncrement = 5 jdbc.maxIdleTime = 30 jdbc.maxStatements = 0 jdbc.idleConnectionTestPeriod = 30 jdbc.acquireRetryAttempts = 30 jdbc.breakAfterAcquireFailure = true jdbc.testConnectionOnCheckout = false jdbc.checkoutTimeout = 30000

java web c3p0连接不上数据库

在学java web时候用c3p0连接数据库,数据库连接没问题,但是用xml方法的时候老是报错Connections could not be acquired from the underlying database! 是不是读取不到xml?还有题主的配置可能有问题,复制到lib文件夹的图片上传数据库的时候读取不到,必须加上绝对路径才能读取到,是不是和这个有关系?![图片说明](https://img-ask.csdn.net/upload/201607/11/1468198473_544205.png)

c3p0配置数据源一直报错,虽然不影响开发,但是总是报错很让人难受,求大神们帮忙看看,10C币奉上

以下是错误信息: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@1e8491f3 java.lang.NullPointerException at com.mysql.jdbc.StatementImpl.realClose(StatementImpl.java:2307) at com.mysql.jdbc.PreparedStatement.realClose(PreparedStatement.java:2688) at com.mysql.jdbc.ConnectionImpl.closeAllOpenStatements(ConnectionImpl.java:1489) at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4289) at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1461) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:326) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:115) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.destroyResource(C3P0PooledConnectionPool.java:185) at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:576) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354) 下面是我配置数据源的配置信息: ![图片说明](https://img-ask.csdn.net/upload/201609/12/1473640182_320710.png)

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链接mysql总是出现Unknown system variable 'query_cache_size'

<font size="4" >在进行DBCP没有错误而在尝试c3p0链接mysql的时候总是出现这几个问题,之前一直以为是版本的问题就把 mysql的版本和驱动版本都更新到最新,可是还是一样的错误,然后又调大的xml的配置可还是同样的问题<font/> ``` 警告: 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> ```

c3p0同时配置Oracle和MySQL,JBDCUtil应如何写

![图片说明](https://img-ask.csdn.net/upload/201603/20/1458461760_552299.png) 我想通过配置c3p0.xml文件在我需要时可以连接oracle或者MySQL数据库,但我不知道jdbcutil该怎么写

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Intellij IDEA 实用插件安利

1. 前言从2020 年 JVM 生态报告解读 可以看出Intellij IDEA 目前已经稳坐 Java IDE 头把交椅。而且统计得出付费用户已经超过了八成(国外统计)。IDEA 的...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

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

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

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

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

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

魂迁光刻,梦绕芯片,中芯国际终获ASML大型光刻机

据羊城晚报报道,近日中芯国际从荷兰进口的一台大型光刻机,顺利通过深圳出口加工区场站两道闸口进入厂区,中芯国际发表公告称该光刻机并非此前盛传的EUV光刻机,主要用于企业复工复产后的生产线扩容。 我们知道EUV主要用于7nm及以下制程的芯片制造,光刻机作为集成电路制造中最关键的设备,对芯片制作工艺有着决定性的影响,被誉为“超精密制造技术皇冠上的明珠”,根据之前中芯国际的公报,目...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

百度工程师,获利10万,判刑3年!

所有一夜暴富的方法都写在刑法中,但总有人心存侥幸。这些年互联网犯罪高发,一些工程师高技术犯罪更是引发关注。这两天,一个百度运维工程师的案例传遍朋友圈。1...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

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

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

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

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

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

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

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

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

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

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

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

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

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

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

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

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

实时更新:计算机编程语言排行榜—TIOBE世界编程语言排行榜(2020年6月份最新版)

内容导航: 1、TIOBE排行榜 2、总榜(2020年6月份) 3、本月前三名 3.1、C 3.2、Java 3.3、Python 4、学习路线图 5、参考地址 1、TIOBE排行榜 TIOBE排行榜是根据全世界互联网上有经验的程序员、课程和第三方厂商的数量,并使用搜索引擎(如Google、Bing、Yahoo!)以及Wikipedia、Amazon、YouTube统计出排名数据。

立即提问
相关内容推荐