*/
ps = this.m_connection.prepareStatement("INSERT INTO jos_core_acl_groups_aro_map (group_id,section_value,aro_id) VALUES(?,?,?)");
ps.setInt(1, group_id);
ps.setString(2, section_value);
ps.setInt(3, id2);
ps.execute();
ps.close();
s.message = "name:" + name + " username:"+username+"userid:" + id1 + ";acl id:" +
id2;
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
s.message = e.toString();
return s;
}
return s;
}
else
{
//System.out.println(username+" 这个用户已经存在");
s.stateid=-1;
s.message=username+" 这个用户已经存在";
return s;
}
}
public static void main(String[]args)
{
DB d=new DB();
String filepath="c:\\input.txt";
try{
BufferedReader Input1 = new BufferedReader(new FileReader(
filepath));
String temp;
temp = Input1.readLine();
while (temp != null) {
String strs[]=temp.split(",");
Status s=d.Addusers(strs[0].trim(),strs[1].trim(), strs[2].trim(), strs[3].trim(),strs[4].trim(), "admin_language=zh-CN\nlanguage=zh-CN\neditor=tinymce\nhelpsite=\ntimezone=8\n\n");
System.out.println(s.message);
temp=Input1.readLine();
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
//System.out.println(d.isExist("zhangtonghu"));
}
}
input 文件的格式是:
name,username,密码,邮箱,用户类型
XXX,tuyaoxu,111111,XXX@ccb.cn,Author