package flex.userinfosys.db.user;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import flex.userinfosys.db.ConnectionHelper;
import flex.userinfosys.db.DAOException;
public class UserService {
public List getUsers() {
System.out.println("——————UserService——————1——————————");
ArrayList list = new ArrayList();
Connection c = null;
try {
System.out.println("——————UserService——————2——————————");
c = ConnectionHelper.getConnection();
Statement s = c.createStatement();
ResultSet rs = s
.executeQuery("SELECT * FROM USERPROFILE ORDER BY name");
while (rs.next()) {
list.add(new UserProfile(rs.getInt("user_id"),
rs.getString("name"),
rs.getString("title"),
rs.getString("image"),
rs.getString("imagebref"),
rs.getString("description")));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
c.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
System.out.println("——————UserService——————6——————————");
return list;
}
public UserProfile getUserProfile(int userId) throws DAOException {
return null;
}
public void update(UserProfile user) throws DAOException,ConcurrencyException {
Connection c = null;
System.out.println("updating ... ");
try {
c = ConnectionHelper.getConnection();
PreparedStatement ps = c.prepareStatement("UPDATE USERPROFILE SET "
+ "name=?, title=?, image=?, imagebref=?, "
+ "description=? WHERE user_id=?");
ps.setString(1, user.getName());
ps.setString(2, user.getTitle());
ps.setString(3, user.getImage());
ps.setString(4, user.getImagebref());
ps.setString(5, user.getDescription());
ps.setInt(6, user.getUserId());
if (ps.executeUpdate() == 0) {
throw new ConcurrencyException("Item not found");
}
} catch (Exception e) {
e.printStackTrace();
throw new DAOException(e);
} finally {
try {
c.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
flex中的UserInfoSys源码
共55个文件
class:7个
xml:7个
java:7个
需积分: 3 6 下载量 195 浏览量
2009-01-13
14:35:32
上传
评论
收藏 664KB RAR 举报
温馨提示
环境:struts1.2+spring2.0+hibernate3.0,需要下载这些包,还包括数据库和jstl标签
资源推荐
资源详情
资源评论
收起资源包目录
UserInfoSys.rar (55个子文件)
UserInfoSys
.project 2KB
flex_libs
.settings
org.eclipse.core.resources.prefs 88B
org.eclipse.wst.common.component 473B
org.eclipse.jdt.core.prefs 330B
org.eclipse.wst.common.project.facet.core.xml 269B
org.eclipse.jst.common.project.facet.core.prefs 288B
.mymetadata 306B
WebRoot
UserInfoSys.html 4KB
UserInfoSys.swf 537KB
AC_OETags.js 8KB
WEB-INF
flex
messaging-config.xml 513B
remoting-config.xml 383B
services-config.xml 4KB
proxy-config.xml 826B
db
user
web.xml 2KB
struts-config.xml 1KB
src
lib
classes
flex
userinfosys
action
ListUserAction.class 3KB
UpdateUserAction.class 2KB
db
user
UserService.class 4KB
UserProfile.class 2KB
ConcurrencyException.class 689B
DAOException.class 655B
ConnectionHelper.class 2KB
META-INF
MANIFEST.MF 253B
history
history.js 24KB
historyFrame.html 827B
history.css 371B
playerProductInstall.swf 657B
images
yzp.jpg 9KB
wybref.gif 9KB
wybref.jpg 9KB
yzp.gif 9KB
ymbref.jpg 9KB
ymbref.gif 9KB
.actionScriptProperties 990B
html-template
AC_OETags.js 8KB
index.template.html 4KB
history
history.js 24KB
historyFrame.html 827B
history.css 371B
playerProductInstall.swf 657B
.myeclipse
src
flex
userinfosys
action
ListUserAction.java 1KB
UpdateUserAction.java 1KB
db
DAOException.java 302B
user
UserService.java 2KB
UserProfile.java 1KB
ConcurrencyException.java 341B
ConnectionHelper.java 842B
.classpath 679B
flex_src
Bref.mxml 346B
images
wybref.gif 9KB
yzp.gif 9KB
ymbref.gif 9KB
UserInfoSys.mxml 2KB
.flexProperties 327B
共 55 条
- 1
资源评论
abrs561shgshg
- 粉丝: 6
- 资源: 67
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功