master
wangyuan 2019-06-20 20:46:42 +08:00
parent 6edbaa9bf9
commit e84516cd73
3 changed files with 6 additions and 10 deletions

View File

@ -27,7 +27,7 @@ public class RedisUtil {
config.setMaxWaitMillis(Integer.parseInt(properties.getProperty("redis_maxWaitMillis")));
config.setMaxIdle(Integer.parseInt(properties.getProperty("redis_maxIdle")));
config.setTestOnBorrow(Boolean.parseBoolean(properties.getProperty("redis_testOnBorrow")));
jedisPool = new JedisPool(config, properties.getProperty("redis_host"), Integer.parseInt(properties.getProperty("redis_port")));
jedisPool = new JedisPool(config, properties.getProperty("redis_host"), Integer.parseInt(properties.getProperty("redis_port")),0,properties.getProperty("jieling666"));
}
/***************************************普通键值对操作***************************************/

View File

@ -25,9 +25,8 @@ public class MyMongoDBPool {
buide.maxConnectionLifeTime(Integer.parseInt(properties.getProperty("mongodb_maxConnectionLifeTime")));
buide.socketTimeout(Integer.parseInt(properties.getProperty("mongodb_socketTimeout")));
buide.socketKeepAlive(Boolean.parseBoolean(properties.getProperty("mongodb_socketKeepAlive")));
MongoClientOptions myOptions = buide.build();
mongoClient = new MongoClient(new ServerAddress(properties.getProperty("mongodb_host"), Integer.parseInt(properties.getProperty("mongodb_port"))),
myOptions);
MongoClientURI mongodb_host = new MongoClientURI(properties.getProperty("mongodb_host"),buide);
mongoClient = new MongoClient(mongodb_host);
dbName = properties.getProperty("mongodb_name");
db = mongoClient.getDB(dbName);
}

View File

@ -1,9 +1,5 @@
#mogodb服务地址
mongodb_host = 60.1.1.14
#mogodb服务端口
mongodb_port = 27017
#数据库名
mongodb_name=jl_core
mongodb_url = mongodb://jieling:jieling666@127.0.0.1:27017/jieling_10048?&authSource=admin
#与目标数据库可以建立的最大链接数
mongodb_maximumNumberOfConnections = 100
@ -22,8 +18,9 @@ mongodb_socketTimeout = 0
#连接保持活跃
mongodb_socketKeepAlive = true
redis_host = 60.1.1.14
redis_host = 127.0.0.1
redis_port = 6379
redis_password=jieling666
redis_maxTotal = 10
redis_minIdle = 3
redis_maxWaitMillis = 20