mybatis jdbc.properties是默认的数据库配置文件吗
1个回答
2016-07-19
展开全部
mybatis jdbc.properties是默认的数据库配置文件
public void writeVaule()
{
Properties pro=new Properties();
InputStream in=pro.getClass().getResourceAsStream("/dbConfig/dbsqlsever.properties");
try {
pro.load(in);
pro.setProperty("driver", "mysql");
pro.setProperty("url", "jdbce");
pro.setProperty(username, "lijia");
pro.setProperty("password", "125487");OutputStream os = null;
os = new FileOutputStream(new File(pro.getClass().getResourceAsStream("/dbConfig/dbsqlsever.properties").toURI()));
pro.store(os, null);
os.flush();
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void writeVaule()
{
Properties pro=new Properties();
InputStream in=pro.getClass().getResourceAsStream("/dbConfig/dbsqlsever.properties");
try {
pro.load(in);
pro.setProperty("driver", "mysql");
pro.setProperty("url", "jdbce");
pro.setProperty(username, "lijia");
pro.setProperty("password", "125487");OutputStream os = null;
os = new FileOutputStream(new File(pro.getClass().getResourceAsStream("/dbConfig/dbsqlsever.properties").toURI()));
pro.store(os, null);
os.flush();
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询