📄 channelbean2.java
字号:
package com.sxit.wap.channel;
import java.sql.*;
import java.util.*;
import com.sxit.wap.common.*;
import com.sxit.wap.exception.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class ChannelBean2
extends ChannelDao {
public static ChannelModel findBycode(String ywcode) throws Exception{
String sql = sql = "SELECT * FROM WAP_CHANNEL WHERE CHANNEL_CODE = " + ywcode;
Connection dbConnection = null;
Statement stmt = null;
ResultSet rs = null;
try {
dbConnection = Database.getConnection();
stmt = dbConnection.createStatement();
rs = stmt.executeQuery(sql);
if (!rs.next()) {
throw new FinderException("No record for ywcode" + ywcode);
}
ChannelModel model = new ChannelModel();
model.setId(rs.getInt("ID"));
model.setCpId(rs.getInt("CP_ID"));
model.setChannelName(Function.readDBEncode(rs.getString(
"CHANNEL_NAME")));
model.setChannelDescribe(Function.readDBEncode(rs.getString(
"CHANNEL_DESCRIBE")));
model.setChannelUrl(Function.readDBEncode(rs.getString(
"CHANNEL_URL")));
model.setChannelAccess(rs.getInt("CHANNEL_ACCESS"));
model.setChannelSubscribe(rs.getInt("CHANNEL_SUBSCRIBE"));
model.setChannelStatus(rs.getInt("CHANNEL_STATUS"));
model.setChannelRegdate(rs.getTimestamp("CHANNEL_REGDATE"));
model.setChannelType(rs.getInt("CHANNEL_TYPE"));
model.setChannelAppear(rs.getInt("CHANNEL_APPEAR"));
model.setChannelTrade(rs.getInt("CHANNEL_TRADE"));
model.setChannelFree(rs.getInt("CHANNEL_FREE"));
model.setChannelTest(rs.getInt("CHANNEL_TEST"));
model.setChannelCode(Function.readDBEncode(rs.getString(
"CHANNEL_CODE")));
model.setSendMobile(rs.getInt("SEND_MOBILE"));
model.setChannelRemark(Function.readDBEncode(rs.getString(
"CHANNEL_REMARK")));
return model;
}
catch (SQLException e) {
Debug.println(sql + "\n" +
"SQLException while execute findBycode mothod :\n" + e);
throw new SysException(
"SQLException while execute findByPK mothod :\n" + e);
}
finally {
rs.close();
stmt.close();
dbConnection.close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -