package com.itheima.c_c3p0;
import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import com.mchange.v2.c3p0.ComboPooledDataSource;
public class C3P0Utils {
//提供连...
分类:
数据库 时间:
2014-06-11 07:09:51
阅读次数:
254
连接池核心类DataSource
基于这个这个核心类,创建连接池也有多种方式,下面是方式一,通过读取配置文件的方式,创建数据库的连接池。
DBCPUtils.java
package com.itheima.a_dbcp;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.SQLException...
分类:
数据库 时间:
2014-06-11 07:02:48
阅读次数:
336
DBCPUtils.java
package com.itheima.b_dbcp;
import java.sql.Connection;
import java.sql.SQLException;
import org.apache.commons.dbcp.BasicDataSource;
public class DBCPUtils {
private static Basic...
分类:
数据库 时间:
2014-06-11 07:02:08
阅读次数:
354
C3P0是常用的数据连接池技术(第三方提供)
也是基于核心类DataSource。
DBCPUtils.java
package com.itheima.b_dbcp;
import java.sql.Connection;
import java.sql.SQLException;
import org.apache.commons.dbcp.BasicDataSource;
publ...
分类:
数据库 时间:
2014-06-11 06:41:24
阅读次数:
275
手动模拟获取latch
随意dump一个latches结构文件:
SQL> oradebug dump latches 10
ORA-00074: no process has been specified
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump latches 10
Statement pro...
分类:
其他好文 时间:
2014-06-11 06:25:18
阅读次数:
328
场景应用:银行转账时,A给B转账,C给D转账。两者都是调用的connection.begainTransaction();connection.commit();
如何才能保证A,B同在一个线程中,C、D同在一个线程中,且A,BC,D在线程内共享,在线程外独立。...
分类:
编程语言 时间:
2014-06-11 00:29:20
阅读次数:
357
[root@VM_64_69_centos httpd]# curl
http://localhost:9001/pay301 Moved PermanentlyMoved PermanentlyThe document has
moved here.Apache/2.2.15 (CentOS) S...
分类:
其他好文 时间:
2014-06-10 13:26:18
阅读次数:
287
An IO call issynchronousif, when you call it, it
does not return until the operation is completed, or until enough time has
passed that your network s...
分类:
编程语言 时间:
2014-06-10 10:07:56
阅读次数:
273
Find the contiguous subarray within an array
(containing at least one number) which has the largest sum.For example, given
the array[?2,1,?3,4,?1,2,1,...
分类:
其他好文 时间:
2014-06-10 09:14:50
阅读次数:
211
我手动配置hibernate4.3.4,测试的时候出现:
Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
我是按照官方文档配置的,但是官方文档的代码好像有点问题
这是官方文档里面的那个工具类的部分代码:return new Confi...
分类:
系统相关 时间:
2014-06-10 07:26:34
阅读次数:
371