摘要: -- top 方式的查询方法-- pageSize:页面的容量-- pageNum:当前页面的编号 2select top 5 * from 表名 where id not in(select top 5 id from 表名) -- row_number 查询方法-- row_number() over()select row_number() over(order by id) as rum ,* from 表名select * from (select row_number() over(order by id) as rum ,* from 表名) as ttwhere rum> 阅读全文
posted @ 2013-06-26 13:48 zhgs_cq 阅读(499) 评论(0) 推荐(0) 编辑
摘要: packagecom.zhanggaosong.ssh.commdao; importjava.io.Serializable; importjava.sql.SQLException; importjava.util.List; importjava.util.Map; importjava.util.Set; importorg.apache.log4j.Logger; importorg.hibernate.Criteria; importorg.hibernate.HibernateException; importorg.hibernate.Query; importorg.hibe 阅读全文
posted @ 2013-06-25 22:38 zhgs_cq 阅读(2148) 评论(0) 推荐(0) 编辑
摘要: -- 判断数据库 city 是否存在,存在则删除drop database if exists city;-- 创建数据库 citycreate database city;-- 切换当前数据库为 cityuse city;create table tb_country( countryid int primary key AUTO_INCREMENT, countryname varchar(30) null);create table tb_city( cityid int primary key AUTO_INCREMENT, cityname varchar(30) null ... 阅读全文
posted @ 2013-06-20 17:59 zhgs_cq 阅读(1699) 评论(0) 推荐(0) 编辑
摘要: 最短路径算法#include<stdio.h>#define N 11#define M 1000000struct node{ int num; //本来序号 int lin; //临时性标记};void main(){ int i,j,t,k,m,test; node l[N+1]; int w[N+1][N+1]={0}; int cnt=0;//统计节点数 int c[N+1]={0}; //存放节点w[1][2]=676;w[1][3]=1813;w[2][4]=842;w[2][5]=511;w[3][5]=695;w[3][6]=811;w[4][7]=110;w[4 阅读全文
posted @ 2013-06-20 12:00 zhgs_cq 阅读(1471) 评论(0) 推荐(0) 编辑
摘要: 1、首先准备好常用的SSH配置文件的约束文件,包括了dtd文件和schema文件,如图所示:2、然后在Eclipse中新建一个插件的项目(Plug-in Project),如图所示:3、在出现的“New Plug-in Project”对话框中,输入项目的名称,并选择插件所对应的Eclipse的版本,这里选择现在比较流行的Eclipse3.7,单击next按钮继续,如图所示: 阅读全文
posted @ 2013-06-01 12:35 zhgs_cq 阅读(200) 评论(0) 推荐(0) 编辑
摘要: package com.zhanggaosong.utils;import java.beans.IntrospectionException;import java.beans.Introspector;import java.beans.PropertyDescriptor;import java.math.BigDecimal;import java.math.BigInteger;import java.util.List;import java.util.Map;import java.util.Set;import org.apache.commons.logging.Log;im 阅读全文
posted @ 2013-05-27 00:20 zhgs_cq 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 1. 在当前时间上加上时、分、秒@Testpublic void testAddDate(){ Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println("当前时间 :"+sdf.format(date)); Calendar c = new GregorianCalendar(); c.setTime(date); c.add(Calendar.HOUR, 1); c.add(Calen.. 阅读全文
posted @ 2013-04-20 13:51 zhgs_cq 阅读(103) 评论(0) 推荐(0) 编辑
摘要: java调用webservicepackage com;import java.io.BufferedReader;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream;import java.io.OutputStreamWriter;import java.net.URL;import java.net.URLConnection;public class InvokeWS { public static void main(String[] args) { ... 阅读全文
posted @ 2013-04-11 13:01 zhgs_cq 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1.调用 Action 类中的exproExcel 方法public String exproExcel() throws Exception { // 第一步,创建一个webbook,对应一个Excel文件 HSSFWorkbook wb = new HSSFWorkbook(); // 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet HSSFSheet sheet = wb.createSheet("学生信息表"); // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short HSSFR... 阅读全文
posted @ 2013-03-27 16:38 zhgs_cq 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1.新建文本文件 复制下面代码 保存为 .batreg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v 29 /d "%systemroot%\system32\imageres.dll,196" /t reg_sz /ftaskkill /f /im explorer.exeattrib -s -r -h "%userprofile%\AppData\Local\iconcache.db"del &q 阅读全文
posted @ 2013-03-27 16:31 zhgs_cq 阅读(270) 评论(0) 推荐(0) 编辑