预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共13页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

2010-05-27 HYPERLINK"http://x125521853.javaeye.com/blog/676624"ajax联动菜单 文章分类:HYPERLINK"http://www.javaeye.com/blogs/category/web"Web前端 //model层:Area.java Java代码 packagecom.wdpc.ajax.model; publicclassArea{ privateintareaId;//市id privateStringareaName;//区域名 privateintareaPid;//区域id //构造函数 publicArea(intareaId,StringareaName,intareaPid){ super(); this.areaId=areaId; this.areaName=areaName; this.areaPid=areaPid; } //get,set方法 publicintgetAreaId(){ returnareaId; } publicvoidsetAreaId(intareaId){ this.areaId=areaId; } publicStringgetAreaName(){ returnareaName; } publicvoidsetAreaName(StringareaName){ this.areaName=areaName; } publicintgetAreaPid(){ returnareaPid; } publicvoidsetAreaPid(intareaPid){ this.areaPid=areaPid; } } packagecom.wdpc.ajax.model; publicclassArea{ privateintareaId;//市id privateStringareaName;//区域名 privateintareaPid;//区域id //构造函数 publicArea(intareaId,StringareaName,intareaPid){ super(); this.areaId=areaId; this.areaName=areaName; this.areaPid=areaPid; } //get,set方法 publicintgetAreaId(){ returnareaId; } publicvoidsetAreaId(intareaId){ this.areaId=areaId; } publicStringgetAreaName(){ returnareaName; } publicvoidsetAreaName(StringareaName){ this.areaName=areaName; } publicintgetAreaPid(){ returnareaPid; } publicvoidsetAreaPid(intareaPid){ this.areaPid=areaPid; } } //dao层: Java代码 packagecom.wdpc.ajax.comms; importjava.sql.Connection; importjava.sql.PreparedStatement; importjava.sql.ResultSet; importjava.sql.SQLException; importjavax.naming.Context; importjavax.naming.InitialContext; importjavax.sql.DataSource; publicclassDbManager{ publicstaticConnectiongetConnection(){ Connectionconn=null; try{ Contextcontext=newInitialContext(); DataSourceds=(DataSource)context.lookup("java:comp/env/jdbc/ajax"); conn=ds.getConnection(); }catch(Exceptione){ e.printStackTrace(); } returnconn; } publicstaticvoidcloseConnection(Connectionconn,PreparedStatementpst,ResultSetrs){ try{ if(rs!=null){ rs.close(); }