j2ee实现开放基金交易平台(不断更新)
来源:互联网 发布:必备厨具知乎 编辑:程序博客网 时间:2024/04/30 17:20
有道笔记地址:http://note.youdao.com/share/?id=888bd1117e3c127d9acd04ad81f26f57&type=note
throws ServletException,IOException{
String sql = "select * from admin";
Collection retValue = new ArrayList();
SqlBean app = new SqlBean();
try{
ResultSet rs = app.executeQuery(sql);
while(rs.next())
{
//user bean of teacher
TeacherBean tb = new TeacherBean();
tb.setName(rs.getString("userName"));
tb.setSex(rs.getString("userPwd"));
retValue.add(tb);
}
rs.close();
app.dbClose();
}
catch(SQLException e){}
request.setAttribute("teacher",retValue);
String toPath = "/SLT/teacher.jsp";
RequestDispatcher rd = request.getRequestDispatcher(toPath);
rd.forward(request,response);
}
-----
在jsp页面接受
ArrayList al = (ArrayList)request.getAttribute("teacher") ;
for(int i = 0 ; i < al.size() ; i ++)
{
mb = (mvc.TeacherBean)al.get(i);
out.println(mb.getName());
out.println("<br>");
}
%>
JAVA格式化时间日期
import java.util.Date;
import java.text.DateFormat;
/**
* 格式化时间类
* DateFormat.FULL = 0
* DateFormat.DEFAULT = 2
* DateFormat.LONG = 1
* DateFormat.MEDIUM = 2
* DateFormat.SHORT = 3
* @author Michael
* @version 1.0, 2007/03/09
*/
public class Test{
public static void main(String []args){
Date d = new Date();
String s;
/** Date类的格式: Sat Apr 16 13:17:29 CST 2006 */
System.out.println(d);
System.out.println("******************************************");
/** getDateInstance() */
/** 输出格式: 2006-4-16 */
s = DateFormat.getDateInstance().format(d);
System.out.println(s);
/** 输出格式: 2006-4-16 */
s = DateFormat.getDateInstance(DateFormat.DEFAULT).format(d);
System.out.println(s);
/** 输出格式: 2006年4月16日 星期六 */
s = DateFormat.getDateInstance(DateFormat.FULL).format(d);
System.out.println(s);
/** 输出格式: 2006-4-16 */
s = DateFormat.getDateInstance(DateFormat.MEDIUM).format(d);
System.out.println(s);
/** 输出格式: 06-4-16 */
s = DateFormat.getDateInstance(DateFormat.SHORT).format(d);
System.out.println(s);
/** 输出格式: 2006-01-01 00:00:00 */
java.text.DateFormat format1 = new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
s = format1.format(new Date());
System.out.println(s);
/** 输出格式: 2006-01-01 00:00:00 */
System.out.println((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).format(new Date()));
/** 输出格式: 20060101000000***/
java.text.DateFormat format2 = new java.text.SimpleDateFormat("yyyyMMddhhmmss");
s = format2.format(new Date());
System.out.println(s);
}
}
- j2ee实现开放基金交易平台(不断更新)
- Struts 基金交易平台项目总结(一)
- Struts 基金交易平台项目总结(二)
- Struts 基金交易平台项目总结(三完结)
- 基金交易日、开放日
- 广东设大学生创业基金及股权交易平台
- 全部开放基金接口调用代码
- 全部开放基金接口调用代码
- 程序员表白程序,开放源码,不断更新
- 程序员表白程序,开放源码,不断更新
- 程序员表白程序,开放源码,不断更新
- J2EE 常用英语缩写收集,不断更新中
- 基金销售系统技术实现
- j2ee 实现
- 程序员表白程序,开放源码,不断更新(第二篇)
- 程序员表白程序,开放源码,不断更新(第二篇)
- 基金
- 基金
- 二手显卡选购小技巧
- shell 文件语法
- 身份证帮助类
- 使用 EXPLAIN PLAN 获取SQL语句执行计划
- IOS单例模式(Singleton)
- j2ee实现开放基金交易平台(不断更新)
- Shell编程基础
- Hibernate.cfg.xml数据源配置(转载)
- servlet/filter/listener/interceptor区别与联系
- JSON入门级学习小结--JSON数据结构
- CreateFont()
- QT各版本下载地址
- shell 基础知识
- CBitmap类