JAVA中使用mybatis配置数据库

web.xml配置文件加载(可单独放出来,然在后web.xml使用引用):

	
		
	
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	



localdataSource.properties文件:

driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://192.168.1.159:3306/wanxue?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=root
filters=stat
maxActive=20
initialSize=5
maxWait=60000
minIdle=10
timeBetweenEvictionRunsMillis=60000
minEvictableIdleTimeMillis=300000
validationQuery=SELECT 'x'
testWhileIdle=true
testOnBorrow=false
testOnReturn=false
poolPreparedStatements=true
maxOpenPreparedStatements=10
removeAbandoned=true
removeAbandonedTimeout=108000
logAbandoned=true
maxPoolPreparedStatementPerConnectionSize=20


你可能感兴趣的:(java,mysql,mybatis)