[在此处输入图像说明] [1] [在此处输入图像说明] [2] 链接 - https://www.screencast.com/t/AqbrhIMUbz
[截图] [3]
[在此处输入图像说明] [4]
public class UpdateJsonDao {
/** The log. */
static Logger log = Logger.getLogger(UpdateJsonDao.class);
/** The log 4 j conf path. */
String log4jConfPath = "resources/logg4j.properties";
/ ** *更新。 * * @param csv csv * @param json the json * @throws Exception异常 * / public void update(HashMap csv,HashMap json)抛出异常 { //BasicConfigurator.configure();
PropertyConfigurator.configure(log4jConfPath);
String eid=null;
String user_email=null;
String manager_name=null;
for (int index1 : csv.keySet()) //Fetching each value of Csv
{
int count=0;
String useremail_csv=csv.get(index1).getEmp_email();
String manager_email=csv.get(index1).getManager_email();
for(int index2:json.keySet()) //Fetching each value of Json
{
for(Bean x:json.get(index2))
{
String useremail_json=x.getProfile().getF015();
String oldmanager_email=x.getProfile().getF034();
if(useremail_json.equals(useremail_csv)) //If user email from Json and Csv are same
{
if(manager_email.equals(oldmanager_email)) //If manaager email id is from Csv and Json are same no need to update(old and new manager email are same)
{
log.info("Manager email already exists"+useremail_csv);
count++;
break;
}
user_email=useremail_json; //If manager id is different Update the user
eid=x.getID();
manager_name=csv.get(index1).getManager_name();
Update(eid,manager_name,manager_email,oldmanager_email,user_email);
count++;
}
}
}
if(count==0){ //If user email is not present in Company database
log.warn("Failed Updating Record-->"+useremail_csv);
}`
在这里输入代码
`我想创建一个我的项目的jar文件。所以我将logg.properties文件保存在资源文件夹中。当我创建一个jar时,它无法找到资源文件夹。当我运行jar时它正在运行它在工作区内运行file.I甚至将资源文件夹添加为SourceFolder但仍未运行。