找传奇、传世资源到传世资源站!

[Android源码] 基于Android的校园二手交易平台App源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

基于Android的二手交易平台, 含服务器端源码以及相关数据库脚本
[Android源码] 基于Android的校园二手交易平台App源码 Android平台开发-第1张
from clipboardpublic class LookDaoImpl extends BaseDaoImpl<Look> implements LookDao {
@Override
protected String getPKName() {
return "lookid";
}

@Override
public PageModel<Look> findByPager(String condition, String string,
int pageSize, int pageNo) {
PageModel<Look> pm = new PageModel<Look>(pageSize, pageNo);
String sql2 = "";
if (condition.equals("username")) {
sql2 = "SELECT * FROM " getTableName()
" where  username = ?  ORDER BY " getPKName()
" DESC ";/*limit ?,?*/
} else {
sql2 = "SELECT * FROM " getTableName() 
" where  category = ?  ORDER BY " getPKName()
" DESC ";/* limit ?,?*/
}
Object[] paramValues = { string/*, (pageNo - 1) * pageSize, pageSize*/ };
Connection conn = null;
try {
conn = DbHelper.getConn();
long count = total();
if (count > 0) {
pm.setRecordCount(count);
pm.setData(qr.query(conn, sql2, beanListHandler, paramValues));
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
DbHelper.close(conn);
}
return pm;
}

@Override
public void delete(String username, int shopid) {
Connection conn = null;
if(!username.equals("") && username != null){
String sql = "DELETE FROM " getTableName() " WHERE username=?";
try {
conn = DbHelper.getConn();
qr.update(conn, sql, username);
} catch (SQLException e) {
e.printStackTrace();
} finally{
DbHelper.close(conn);
}
}else {
String sql = "DELETE FROM " getTableName() " WHERE lookid=?";
try {
conn = DbHelper.getConn();
qr.update(conn, sql,shopid);
} catch (SQLException e) {
e.printStackTrace();
} finally{
DbHelper.close(conn);
}
}

}

}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复