官网学习1

https://mybatis.org/mybatis-3/zh/getting-started.html

设置密码

https://blog.csdn.net/qq_24241631/article/details/80294144

Stirng resource = "mybatis-config.xml";
InputStream inputStream;
InputStream in = Resources.getResourceAsStream("jdbc.properties");
Properties props = new Properties();
props.load(in);
String username = props.getProperty("username ");
String password= props.getProperty("password");
props.put("username ",CodeUtils.decode(username));
props.put("password",CodeUtils.decode(password));
inputStream = Reasources.getResourceAsStream(resource );
SqlSessionFactory ssf = new SqlSessionFactory Builder().build(inputStream ,props );

你可能感兴趣的:(Mybatis,学习,mybatis,java)