1. 程式人生 > >Apache dbcp 連線池

Apache dbcp 連線池

java操作(dbcp.jar)

BasicDataSource basicDataSource=new BasicDataSource();
			basicDataSource.setDriverClassName("org.gjt.mm.mysql.Driver");
			basicDataSource.setUsername("root");
			basicDataSource.setPassword("2014");
			basicDataSource.setUrl("jdbc:mysql://localhost:3306/db?useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull");
			return (DataSource)basicDataSource;