welcomeutil.java
来自「spring+struts+hibernate做的银行系统」· Java 代码 · 共 79 行
JAVA
79 行
/*
* Created on 2006-2-24
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package cn.com.tym.welcome;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import cn.com.tym.pub.Constants;
import cn.com.tym.pub.DB;
/**
* @author jack_booth
*/
public class WelcomeUtil {
public WelcomeUtil(){
}
/**
* public static final int FAD_INT=1; //����ʱ��
* public static final int AFFECTION_INT=2; // ����
* public static final int LEFT_INT=3; // ����ͥ
* public static final int CATE_INT=4; // ��ʳ����
* public static final int LOOKER_INT=5; //���˷��
* public static final int SUBJECT_INT=6; // ר�ⱨ��
* public static final int COMMUNION_INT=7; //��������
*
*/
public ArrayList WelcomeLookup(int chice,DB db) throws SQLException{
String strSql="";
switch(chice)
{
case Constants.SUBJECTLIST_INT :
strSql="select top 4 second_id,second_mainCaption,second_assistantCaption," +
"second_time,second_content,second_source from mdh_secondCote where firstCote_id='1'";
break;
case Constants.LIFELIST_INT :
strSql="select top 6 second_id,second_mainCaption,second_assistantCaption," +
"second_time,second_content,second_source from mdh_secondCote where firstCote_id='2'";
break;
}
ArrayList arraylist=new ArrayList();
ResultSet rs=db.OpenSql(strSql);
while(rs.next()){
WelcomeBean webean=new WelcomeBean();
webean.setModes_id(rs.getString("second_id"));
webean.setMainCaption(rs.getString("second_mainCaption"));
webean.setContent(rs.getString("second_content"));
arraylist.add(webean);
}
return arraylist;
}
public WelcomeBean subjectOne(DB db) throws SQLException{
String strSql="select top 1 second_id,second_mainCaption,second_assistantCaption," +
"second_time,second_content,second_source from mdh_secondCote where firstCote_id='6' order by second_id desc";
WelcomeBean webean=new WelcomeBean();
ArrayList arraylist=new ArrayList();
ResultSet rs=db.OpenSql(strSql);
if(rs.next()){
webean=new WelcomeBean();
webean.setModes_id(rs.getString("second_id"));
webean.setMainCaption(rs.getString("second_mainCaption"));
webean.setAssistantCaption(rs.getString("second_assistantCaption"));
webean.setContent(rs.getString("second_content"));
// webean.setImages(rs.getString(""));
}
return webean;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?