基于javaweb+mysql的jsp+servlet家政服务系统(java+jsp+jquery+servlet+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的JSP+Servlet家政服务系统(java+jsp+jquery+servlet+mysql)
项目介绍
本项目分为前后台,有普通用户与管理员两种角色,普通用户登录前台,管理员登录后台;
用户角色包含以下功能: 查看首页,客户注册,查看服务项目,查看服务项目详情,查看服务人员,查看家政新闻,在线留言等功能。
管理员角色包含以下功能: 管理员登录,管理员管理,客户信息管理,修改密码,员工信息管理,服务类别管理,服务项目管理,预约信息查询,留言管理,家政新闻管理,系统管理,友情链接添加,友情链接查询,系统公告设置等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:否;
技术栈
JSP+CSS+JavaScript+jquery+Servlet+mysql
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中dao/CommDAO.java配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/jsp_jzfw_site 登录
jscode += " if(radios[0].type=='radio'){\n";
jscode += " for(var i=0;i<radios.length;i++)\n";
jscode += " {\n";
jscode += " if(radios[i].value==\"" + str2 + "\")\n";
jscode += " {\n";
jscode += " radios[i].checked=\"checked\";\n";
jscode += " }\n";
jscode += " }\n";
jscode += " }\n";
jscode += " if(radios[0].type=='checkbox'){\n";
jscode += " for(var i=0;i<radios.length;i++)\n";
jscode += " {\n";
jscode += " if(\"" + str2 + "\".indexOf(radios[i].value)>-1&&radios[i].id.indexOf('choosebox')==-1)\n";
jscode += " {\n";
jscode += " radios[i].checked=\"checked\";\n";
if (str2.indexOf(" - ") > -1) {
for (String strch : str2.split(" ~ ")) {
String strchname = strch.substring(0, strch.lastIndexOf(" - "));
jscode += " if(document.getElementsByName('" + strchname + "').length>0)\n";
jscode += " {\n";
jscode += " document.getElementsByName('" + strchname + "')[0].value='" + strch.substring(strch.lastIndexOf(":") + 1) + "';\n";
jscode += " }\n";
}
}
jscode += " }\n";
jscode += " }\n";
jscode += " }\n";
jscode += " if(radios.type=='select'){\n";
jscode += " " + formname + "." + str1 + ".value=\"" + str2 + "\";\n";
jscode += " }\n";
jscode += " }else{\n";
e.printStackTrace();
}
return i;
}
public void commOper(String sql) {
System.out.println(sql);
try {
Statement st = conn.createStatement();
st.execute(sql);
st.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void commOperSqls(ArrayList<String> sql) {
try {
conn.setAutoCommit(false);
for (int i = 0; i < sql.size(); i++) {
Statement st = conn.createStatement();
System.out.println(sql.get(i));
st.execute(sql.get(i));
st.close();
}
conn.commit();
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
} finally {
try {
conn.setAutoCommit(true);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public List<HashMap> select(String sql) {
System.out.println(sql);
List<HashMap> list = new ArrayList();
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
ResultSetMetaData rsmd = rs.getMetaData();
jscode += " {\n";
jscode += " var radios = document.getElementsByName(\"" + str1 + "\");\n";
jscode += " if(radios[0].type=='radio'){\n";
jscode += " for(var i=0;i<radios.length;i++)\n";
jscode += " {\n";
jscode += " if(radios[i].value==\"" + str2 + "\")\n";
jscode += " {\n";
jscode += " radios[i].checked=\"checked\";\n";
jscode += " }\n";
jscode += " }\n";
jscode += " }\n";
jscode += " if(radios[0].type=='checkbox'){\n";
jscode += " for(var i=0;i<radios.length;i++)\n";
jscode += " {\n";
jscode += " if(\"" + str2 + "\".indexOf(radios[i].value)>-1&&radios[i].id.indexOf('choosebox')==-1)\n";
jscode += " {\n";
jscode += " radios[i].checked=\"checked\";\n";
if (str2.indexOf(" - ") > -1) {
for (String strch : str2.split(" ~ ")) {
String strchname = strch.substring(0, strch.lastIndexOf(" - "));
jscode += " if(document.getElementsByName('" + strchname + "').length>0)\n";
jscode += " {\n";
jscode += " document.getElementsByName('" + strchname + "')[0].value='" + strch.substring(strch.lastIndexOf(":") + 1) + "';\n";
jscode += " }\n";
}
}
jscode += " }\n";
jscode += " }\n";
jscode += " }\n";
jscode += " if(radios.type=='select'){\n";
jscode += " " + formname + "." + str1 + ".value=\"" + str2 + "\";\n";
jscode += " }\n";
jscode += " }else{\n";
StringBuffer theTexts1 = new StringBuffer();
imgStr.append("<div id=picViwer1 style='background-color: #ffffff' align=center></div><SCRIPT src='js/dynamicImage.js' type=text/javascript></SCRIPT>\n<script language=JavaScript>\n");
thePics1.append("var thePics1=\n'");
theLinks1.append("var theLinks1='");
theTexts1.append("var theTexts1='");
List<HashMap> co = this.select("select * from xinwentongzhi where shouyetupian<>'' and shouyetupian<>'null' and shouyetupian like '%.jpg' order by id desc", 1, 6);
int i = co.size();
int j = 0;
for (HashMap b : co) {
j++;
int id = Integer.parseInt(b.get("id").toString());
String title = Info.subStr(b.get("biaoti").toString(), 21);
String url = "" + b.get("shouyetupian");
String purl = "gg_detail.jsp?id=" + b.get("id");
if (j != i) {
thePics1.append(url.replaceAll("\n", "") + "|");
theLinks1.append(purl + "|");
theTexts1.append(title + "|");
}
if (j == i) {
thePics1.append(url.replaceAll("\n", ""));
theLinks1.append("gg_detail.jsp?id=" + b.get("id"));
theTexts1.append(title);
}
}
thePics1.append("';");
theLinks1.append("';");
theTexts1.append("';");
imgStr.append(thePics1 + "\n");
imgStr.append(theLinks1 + "\n");
imgStr.append(theTexts1 + "\n");
imgStr.append("\n setPic(thePics1,theLinks1,theTexts1," + width + "," + height + ",'picViwer1');</script>");
return imgStr.toString();
}
public HashMap getmap(String id, String table) {
List<HashMap> list = new ArrayList();
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from " + table);
ResultSetMetaData rsmd = rs.getMetaData();
int i = rsmd.getColumnCount();
for (int j = 2; j <= i; j++) {
str += rsmd.getColumnName(j) + ",";
}
} catch (Exception e) {
e.printStackTrace();
}
str = str.substring(0, str.length() - 1);
return str;
}
public String update(HttpServletRequest request, HttpServletResponse response, String tablename, HashMap extmap, boolean alert, boolean reflush, String tzurl) {
if (request.getParameter("f") != null) {
Enumeration enumeration = request.getParameterNames();
String names = ",";
while (enumeration.hasMoreElements()) {
names += enumeration.nextElement().toString() + ",";
}
HashMap typemap = new HashMap();
ArrayList<String> collist = new ArrayList();
String sql = "update " + tablename + " set ";
Connection conn = this.getConn();
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from " + tablename);
ResultSetMetaData rsmd = rs.getMetaData();
int i = rsmd.getColumnCount();
System.out.println(i);
for (int j = 1; j <= i; j++) {
if (rsmd.getColumnName(j).equals("id")) continue;
if (rsmd.getColumnName(j).equals("ID")) continue;
if (rsmd.getColumnName(j).equals("Id")) continue;
if (rsmd.getColumnName(j).equals("iD")) continue;
typemap.put(rsmd.getColumnName(j) + "---", rsmd.getColumnTypeName(j));
List<HashMap> list = new ArrayList();
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next()) {
HashMap map = new HashMap();
int i = rsmd.getColumnCount();
for (int j = 1; j <= i; j++) {
if (!rsmd.getColumnName(j).equals("ID")) {
String str = rs.getString(j) == null ? "" : rs.getString(j);
if (str.equals("null")) str = "";
map.put(rsmd.getColumnName(j), str);
} else
map.put("id", rs.getString(j));
}
list.add(map);
}
rs.close();
st.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
if (sql.equals("show tables"))
list = select("select table_name from INFORMATION_SCHEMA.tables");
else
e.printStackTrace();
}
return list;
}
public List<List> selectforlist(String sql) {
List<List> list = new ArrayList();
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next()) {
List<String> list2 = new ArrayList();
int i = rsmd.getColumnCount();
for (int j = 1; j <= i; j++) {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
if (rs.next()) {
i = rs.getInt(1);
}
st.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return i;
}
public double getDouble(String sql) {
double i = 0;
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
if (rs.next()) {
i = rs.getDouble(1);
}
st.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return i;
}
public void commOper(String sql) {
System.out.println(sql);
try {
Statement st = conn.createStatement();
st.execute(sql);
st.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
go("/login.jsp", request, response);
}
}
}
//修改密码
if(ac.equals("uppass"))
{
String olduserpass = request.getParameter("ymm");
String userpass = request.getParameter("xmm1");
String copyuserpass = request.getParameter("xmm2");
HashMap m = dao.getmaps("yonghuming",(String)request.getSession().getAttribute("username"), "yonghuzhuce");
if(!(((String)m.get("mima")).equals(olduserpass)))
{
request.setAttribute("error", "");
go("mod2.jsp", request, response);
}else{
//String id = (String)user.get("id");
String sql = "update yonghuzhuce set mima='"+userpass+"' where yonghuming='"+(String)request.getSession().getAttribute("username")+"'";
dao.commOper(sql);
request.setAttribute("suc", "");
go("mod2.jsp", request, response);
}
}
//修改密码
if(ac.equals("adminuppass"))
{
String olduserpass = request.getParameter("ymm");
String userpass = request.getParameter("xmm1");
String copyuserpass = request.getParameter("xmm2");
//println(Info.getUser(request).get("id").toString());
HashMap m = dao.getmaps("username",(String)request.getSession().getAttribute("username"), "allusers");
if(!(((String)m.get("pwd")).equals(olduserpass)))
{
request.setAttribute("error", "");
go("mod.jsp", request, response);
}else{
//String id = (String)user.get("id");
String sql = "update allusers set pwd='"+userpass+"' where username='"+(String)request.getSession().getAttribute("username")+"'";
dao.commOper(sql);
request.setAttribute("suc", "");
go("mod.jsp", request, response);
jscode += "{\n";
jscode += "document.getElementById(\"txt4\").src=\"upfile/" + map.get("filename4") + "\";\n";
jscode += "}\n";
jscode += "if(document.getElementById(\"txt5\"))\n";
jscode += "{\n";
jscode += "document.getElementById(\"txt5\").src=\"upfile/" + map.get("filename5") + "\";\n";
jscode += "}\n";
}
}
jscode += "}\n";
jscode += " getPvalue();\n";
jscode += "</script>\n";
} catch (Exception e) {
e.printStackTrace();
}
return jscode;
}
public static String generalFileName(String srcFileName) {
try {
int index = srcFileName.lastIndexOf(".");
return StrUtil.generalSrid() + srcFileName.substring(index).toLowerCase();
} catch (Exception e) {
return StrUtil.generalSrid();
}
}
public synchronized static String getID() {
Random random = new Random();
StringBuffer ret = new StringBuffer(20);
java.util.Date date = new java.util.Date();
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("MMddHHmmss", java.util.Locale.CHINA);
ret.append(format.format(date));
String rand = String.valueOf(Math.abs(random.nextInt()));
//ret.append(getDateStr());
ret.append(rand.substring(0, 4));
return ret.toString();
}
public static String getImgUpInfo(int height) {
String jscode = "";
String optionstr = "";
for (String str : zdname.split(";")) {
String zdstr = str.split("~")[0];
String zdnamestr = str.split("~")[1].equals("无名") ? "" : (str.split("~")[1] + ":");
optionstr += zdnamestr + permap.get(zdstr) + " - ";
}
if (optionstr.length() > 0) optionstr = optionstr.substring(0, optionstr.length() - 3);
radio += "<label><input type='radio' name='" + name + "' " + check + " value=\"" + optionstr + "\">" + optionstr + "</label>\n";
dxii++;
}
return radio;
}
public static void writeExcel(String fileName, String prosstr, java.util.List<List> plist, HttpServletRequest request, HttpServletResponse response) {
WritableWorkbook wwb = null;
String cols = "";
for (String str : prosstr.split("@")) {
cols += str.split("-")[0] + ",";
}
cols = cols.substring(0, cols.length() - 1);
String where = request.getAttribute("where") == null ? "" : request.getAttribute("where").toString();
List<List> mlist = new CommDAO().selectforlist("select " + cols + " from " + fileName + " " + where + " order by id desc");
fileName = request.getRealPath("/") + "/upfile/" + Info.generalFileName("a.xls");
String[] pros = prosstr.split("@");
try {
//首先要使用Workbook类的工厂方法创建一个可写入的工作薄(Workbook)对象
wwb = Workbook.createWorkbook(new File(fileName));
} catch (IOException e) {
e.printStackTrace();
}
if (wwb != null) {
//创建一个可写入的工作表
//Workbook的createSheet方法有两个参数,第一个是工作表的名称,第二个是工作表在工作薄中的位置
WritableSheet ws = wwb.createSheet("sheet1", 0);
ws.setColumnView(0, 20);
ws.setColumnView(1, 20);
ws.setColumnView(2, 20);
ws.setColumnView(3, 20);
ws.setColumnView(4, 20);
ws.setColumnView(5, 20);
.append(parameter)
.append("' class='ls'>").append("首页")
.append("</a>");
// #1157B7
buf.append(" ");
if (this.currentPage > 1) {
buf.append("<a href='").append(this.path).append("¤tPage=")
.append(currentPage - 1).append(parameter).append(
"' class='ls'>").append("上页")
.append("</a>");
} else {
buf.append("上页");
}
buf.append(" ");
int currentSegment = this.currentPage % segment == 0 ? this.currentPage
/ segment : this.currentPage / segment + 1;
/*for (int i = 1; i <= this.pageNumber; i++) {
if (this.currentPage == i)
buf.append("<font color='red'>").append(i).append("</font>");
else
buf.append("<a href='").append(this.path).append(
"¤tPage=").append(i).append(parameter).append(
"' class='ls'>[").append(i).append(
"]</a>");
}*/
buf.append(" ");
if (this.currentPage < this.pageNumber) {
buf.append("<a href='").append(this.path).append("¤tPage=")
.append(currentPage + 1).append(parameter).append(
"' class='ls'>").append("下页")
.append("</a>");
} else {
buf.append("下页");
}
jscode += "}\n";
jscode += " getPvalue();\n";
jscode += "</script>\n";
} catch (Exception e) {
e.printStackTrace();
}
return jscode;
}
public static String generalFileName(String srcFileName) {
try {
int index = srcFileName.lastIndexOf(".");
return StrUtil.generalSrid() + srcFileName.substring(index).toLowerCase();
} catch (Exception e) {
return StrUtil.generalSrid();
}
}
public synchronized static String getID() {
Random random = new Random();
StringBuffer ret = new StringBuffer(20);
java.util.Date date = new java.util.Date();
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("MMddHHmmss", java.util.Locale.CHINA);
ret.append(format.format(date));
String rand = String.valueOf(Math.abs(random.nextInt()));
//ret.append(getDateStr());
ret.append(rand.substring(0, 4));
return ret.toString();
}
public static String getImgUpInfo(int height) {
String jscode = "";
jscode += "<img style=\"cursor: pointer;margin:3px\" οnclick=\"uploadimg()\" src=\"js/nopic.jpg\" id=txt height=\"" + height + "\"/>";
jscode += "<input type=hidden name=\"filename\" id=\"filename\" value=\"\" />";
return jscode;
}
public static String getImgUpInfo2(int height) {
String jscode = "";
jscode += "<img style=\"cursor: hand\" οnclick=\"uploadimg2()\" src=\"js/nopic.jpg\" id=txt2 height=\"" + height + "\"/>";
jscode += "<input type=hidden name=\"filename2\" id=\"filename2\" value=\"\" />";
int start = 0, end;
boolean done = true;
if (source == null) return null;
if (from == null || from.equals("") || to == null || to.equals(""))
return source;
while (done) {
start = sourceLowcase.indexOf(from, start);
if (start == -1) {
break;
}
subLowcase1 = sourceLowcase.substring(0, start);
sub1 = source.substring(0, start);
end = sourceLowcase.indexOf(to, start);
if (end == -1) {
end = sourceLowcase.indexOf("/>", start);
if (end == -1) {
done = false;
}
} else {
end = end + to.length();
subLowcase2 = sourceLowcase.substring(end, source.length());
sub2 = source.substring(end, source.length());
sourceLowcase = subLowcase1 + subLowcase2;
source = sub1 + sub2;
}
//System.out.println(start+" "+end);
}
return source;
}
public static void delPic(String path, String img) {
if (img != null) {
if (!img.equals("")) {
File file1 = new File(path + "/" + img);
if (file1.exists()) {
file1.deleteOnExit();
// file1.delete();
}
}
}
}
}
return currentPage;
}
public long getPageNumber() {
return pageNumber;
}
public int getPageSize() {
return pageSize;
}
public String getInfo() {
return info;
}
public static ArrayList<HashMap> getPages(String url,int pagesize,String sql,HttpServletRequest request )
{
PageManager pageManager = PageManager.getPage(url, pagesize, request);
pageManager.doList(sql);
PageManager bean = (PageManager) request.getAttribute("page");
ArrayList<HashMap> nlist = (ArrayList) bean.getCollection();
return nlist;
}
}
// TODO Auto-generated catch block
e1.printStackTrace();
}
String filename = request.getParameter("filename");
if (request.getHeader("User-Agent").toLowerCase().indexOf("firefox") > 0){
try {
filename = new String(filename.getBytes("UTF-8"), "ISO8859-1");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else
if (request.getHeader("User-Agent").toUpperCase().indexOf("MSIE") > 0){
try {
filename = URLEncoder.encode(filename, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
}
}
response.setContentType("text/plain");
response.setHeader("Location",filename);
response.reset();
response.setHeader("Cache-Control", "max-age=0" );
response.setHeader("Content-Disposition", "attachment; filename=" + filename);
try {
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
OutputStream fos = null;
// File f = new File(request.getRealPath("/upfile/")+"/"+filename);
//System.out.println(f);
bis = new BufferedInputStream((InputStream)new FileInputStream(request.getRealPath("/upfile/")+"/"+filename));
fos = response.getOutputStream();
bos = new BufferedOutputStream(fos);
int bytesRead = 0;
byte[] buffer = new byte[5 * 1024];
while ((bytesRead = bis.read(buffer)) != -1) {
bos.write(buffer, 0, bytesRead);
}
bos.close();
bis.close();
fos.close();
new Info().delPic(request.getRealPath("/upfile/")+"/", filename);
} catch (Exception e) {
}finally{
} catch (RowsExceededException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (WriteException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//下面开始添加单元格
int i = 1;
for (List t : mlist) {
try {
Iterator it = t.iterator();
int jj = 0;
while (it.hasNext()) {
Label label1 = new Label(jj, i, "");
String a = it.next().toString();
label1.setString(a);
ws.addCell(label1);
jj++;
}
i++;
} catch (RowsExceededException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (WriteException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
try {
//从内存中写入文件中
wwb.write();
//关闭资源,释放内存
wwb.close();
} catch (IOException e) {
e.printStackTrace();
map.put("id", rs.getString(j));
}
list.add(map);
}
rs.close();
st.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return list.get(0);
}
public String insert(HttpServletRequest request, HttpServletResponse response, String tablename, HashMap extmap, boolean alert, boolean reflush, String tzurl) {
extmap.put("addtime", Info.getDateStr());
if (request.getParameter("f") != null) {
HashMap typemap = new HashMap();
ArrayList<String> collist = new ArrayList();
String sql = "insert into " + tablename + "(";
Connection conn = this.getConn();
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from " + tablename);
ResultSetMetaData rsmd = rs.getMetaData();
int i = rsmd.getColumnCount();
for (int j = 1; j <= i; j++) {
if (rsmd.getColumnName(j).equals("id")) continue;
if (rsmd.getColumnName(j).equals("ID")) continue;
if (rsmd.getColumnName(j).equals("iD")) continue;
if (rsmd.getColumnName(j).equals("Id")) continue;
typemap.put(rsmd.getColumnName(j) + "---", rsmd.getColumnTypeName(j));
collist.add(rsmd.getColumnName(j));
sql += rsmd.getColumnName(j) + ",";
}
sql = sql.substring(0, sql.length() - 1);
sql += ") values(";
rs.close();
st.close();
} catch (SQLException e) {
e.printStackTrace();
}
Enumeration enumeration = request.getParameterNames();
String names = ",";
while (enumeration.hasMoreElements()) {
names += enumeration.nextElement().toString() + ",";
}
try {
Statement st = conn.createStatement();
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from " + table);
ResultSetMetaData rsmd = rs.getMetaData();
int i = rsmd.getColumnCount();
for (int j = 2; j <= i; j++) {
str += rsmd.getColumnName(j) + ",";
}
} catch (Exception e) {
e.printStackTrace();
}
str = str.substring(0, str.length() - 1);
return str;
}
public String update(HttpServletRequest request, HttpServletResponse response, String tablename, HashMap extmap, boolean alert, boolean reflush, String tzurl) {
if (request.getParameter("f") != null) {
Enumeration enumeration = request.getParameterNames();
String names = ",";
while (enumeration.hasMoreElements()) {
names += enumeration.nextElement().toString() + ",";
}
HashMap typemap = new HashMap();
ArrayList<String> collist = new ArrayList();
String sql = "update " + tablename + " set ";
Connection conn = this.getConn();
try {
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from " + tablename);
ResultSetMetaData rsmd = rs.getMetaData();
int i = rsmd.getColumnCount();
System.out.println(i);
for (int j = 1; j <= i; j++) {
if (rsmd.getColumnName(j).equals("id")) continue;
if (rsmd.getColumnName(j).equals("ID")) continue;
if (rsmd.getColumnName(j).equals("Id")) continue;
if (rsmd.getColumnName(j).equals("iD")) continue;
typemap.put(rsmd.getColumnName(j) + "---", rsmd.getColumnTypeName(j));
collist.add(rsmd.getColumnName(j));
if (names.indexOf("," + rsmd.getColumnName(j) + ",") > -1) {
String[] values = request.getParameterValues(rsmd.getColumnName(j));
String value = "";