查阅SqlSessionFactoryBuilder.java中重载函数build的定义中,存在支持传入Properties的定义
使用参考:
String resource = "mybatis-config2.xml";
InputStream inputStream = Resources.getResourceAsStream(resource);
String url = "jdbc:postgresql://172.16.x.x:5432/database_name";
//定义properties属性url
Properties properties = new Properties();
properties.setProperty("url", url);
sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream, properties);
标签:15,String,url,build,mybatis,SqlSessionFactoryBuilder,properties From: https://www.cnblogs.com/woniu123/p/16802673.html