📄 tchannel.java
字号:
package com.sxit.pim.channel;
import java.util.*;
import java.sql.*;
/**
* <p>类名: Tchannel</p>
* <p>功能: channel</p>
* <p>公司: 深讯信科</p>
* <p>版本: 1.0</p>
* @程序 sxit
* @日期 2005-12-14
* @修改纪录
*/
public class Tchannel
extends TchannelImpl {
public Tchannel() {
super();
}
/*
* 根据channel查找CP
*/
public static int count_channel(Connection con, String channel) throws
SQLException {
PreparedStatement stmt = null;
ResultSet rs = null;
int cnt = 0;
String sql = "";
try {
sql = "select count(*) as cnt from tchannel where channelid='" +
channel + "'";
stmt = con.prepareStatement(sql);
rs = stmt.executeQuery();
if (rs.next()) {
cnt = rs.getInt("cnt");
}
stmt.close();
}
finally {
if (stmt != null)
stmt.close();
}
return cnt;
}
/**
* 创建数据,根据channelid
*/
public int create9(Connection con, String channelid) throws SQLException {
PreparedStatement stmt = null;
ResultSet rs = null;
String sql = "";
int cp_id=0;
try {
sql = "select cp_id from tchannel where channelid='"+channelid+"'";
stmt = con.prepareStatement(sql);
rs = stmt.executeQuery();
if (rs.next()) {
cp_id = rs.getInt("cp_id");
}
stmt.close();
}
finally {
if (stmt != null)
stmt.close();
}
return cp_id;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -