- 博客(17)
- 收藏
- 关注
原创 java面试题——冒泡排序
public class Show{public static void main(String arges[]){int arr={1,5,3,0,8,4};int temp=0;for(int i=0;i<arr.length-1;i++){ //外部比较for(int j=0;j<arr.length-1-i;j++){ //内部比较if(arr[j]>arr[
2012-03-16 22:04:30 2703
原创 Comparable接口实现对象排序
package com.ajax3;import java.util.ArrayList;import java.util.Arrays;import java.util.Collections;import java.util.Iterator;public class Test { public static void main(String[] args) {
2012-03-27 00:07:16 371
原创 致新手——数据库实现行列转换
create table Test(id int identity(1,1),姓名 varchar(30),课程 varchar(30),成绩 varchar(30))insert into Test values('张三','语文','85')insert into Test values('张三','数学','80')insert into Test value
2012-03-21 16:00:07 580
原创 java停止线程的方法
首先我们先查看API文档,找到Thread这个类,从这个类中我们找到了stop()这个方法。但是,stop@Deprecatedpublic final void stop()已过时。 该方法具有固有的不安全性。用 Thread.stop 来终止线程将释放它已经锁定的所有监视器(作为沿堆栈向上传播的未检查ThreadDeath 异常的一个自然后果)。如果以前受这些监视器保护的任
2012-03-16 22:19:20 1670
原创 Struts2网站计数器
public String log(){ //登录的时候设置 HttpServletRequest q=ServletActionContext.getRequest(); HttpSession s=q.getSession(); if(this.shop.login(uname, password)){ s.setAttribute("username", uname);
2012-03-14 21:21:21 790
原创 java BigInteger类
我们先从JDK1.6的帮助文档上来看。public class BigIntegerextends Numberimplements ComparableBigInteger>不可变的任意精度的整数。所有操作中,都以二进制补码形式表示 BigInteger(如 Java 的基本整数类型)。BigInteger 提供所有 Java 的基本整数操作符的对应物,并提供 java.la
2012-03-14 16:30:41 1524
原创 Jquery dialog
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml"> $(function (){$("#bt").click(function(){$("#dialog-confirm").dialog("open");});/
2012-03-11 17:29:47 554
原创 Struts2上传图片到数据库
Action类——package com.upload;import java.io.*;import java.sql.*;import java.util.ArrayList;import java.util.List;import javax.servlet.http.HttpServletRequest;import com.upload3.*;import
2012-03-09 21:59:22 991 1
原创 Jquery——Ajax实例
String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> $(function (){ $("#tb").c
2012-03-08 22:09:34 365
原创 java Iterator类应用实例
import java.util.*;public class Stu{public static void main(String arges[]){HashMap sh=new HashMap();sh.put("1","h");sh.put("2","e");sh.put("3","l");sh.put("4","l");sh.put("5","o");
2012-03-08 14:03:32 816
原创 JQuery实现电子邮件验证
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml">$(document).ready(function() { $('.error').hide(); $('.submit').click(function(event){ var emai
2012-03-07 19:43:01 4869
原创 Servlet 验证码
package com.check;import java.awt.Color;import java.awt.Font;import java.awt.Graphics;import java.awt.image.BufferedImage;import java.io.IOException;import java.io.OutputStream;import ja
2012-03-06 17:02:00 614
原创 Struts2验证码
public class ShopAction extends ActionSupport{public ByteArrayInputStream getInputStream() { return inputStream;}private ByteArrayInputStream inputStream; }public Color getRandColor(int fc
2012-03-06 16:38:38 438
原创 Struts2+Hibernate+Spring带条件的分页查询
Action类public class ShopAction extends ActionSupport{//省略get,set方法@Resource ShopDao shop; //接口注入private List list; //集合private int PageNow=1; //当前页数,又称开始页private int PageSize=6
2012-03-06 16:13:25 5828 2
原创 java对数据库的封装
import java.sql.*;public class Conn { //连接的封装 private Conn(){}public static Connection getInstance(){ Connection ct=null; try{ Class.forName("com.microsoft.jdbc.sqlserver.SQLSer
2012-03-06 15:43:36 528
原创 Struts2+Hibernate+Spring配置
Web.xml xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/
2012-03-06 15:39:00 905 1
原创 java常用工具下载
http://downloads.myeclipseide.com/downloads/products/eworkbench/galileo/myeclipse-8.6.0-win32.exe Myeclipse8.5下载(英文版)http://java.sun.com/javase/downloads/index.jsp jdk1.6下载http://tomcat.apache.org
2012-03-05 16:25:44 319
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人