2013年10月25日
摘要:
package com.wzh.test.http;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
public class RangeDemo {
阅读全文
posted @ 2013-10-25 23:46
上校
阅读(921)
推荐(0)
2013年10月23日
摘要:
javac Server.java 编译java文件成class
java Server 运行程序
阅读全文
posted @ 2013-10-23 00:35
上校
阅读(431)
推荐(0)
2013年10月22日
摘要:
Java就业培训教材
张孝祥
39.00元
Java网页开发
张孝祥
29.00元
阅读全文
posted @ 2013-10-22 21:46
上校
阅读(1109)
推荐(0)
2013年10月21日
摘要:
bloom-filter 算法
场景:我说的大数据量处理是指同时需要对数据进行检索查询,同时有高并发的增删改操作;
记得以前在XX做电力时,几百万条数据,那时一个检索查询可以让你等你分钟;
阅读全文
posted @ 2013-10-21 15:09
上校
阅读(6167)
推荐(0)
2013年10月20日
摘要:
需要通过使用Microsoft Visual Studio 2010、XMLSpy或者eclipse软件来检查校验
book.dtd
阅读全文
posted @ 2013-10-20 16:51
上校
阅读(761)
推荐(0)
摘要:
package com.wzh.test.generic;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.junit.Test;
public class Demo1 {
@Test
public void test1(){
//List是接口,ArrayList是具体实现
List list=new ArrayList();
list.add("12");
list.add("f");
System.out.println(list);
//传统迭代
Iterator it=list.iterator();
w
阅读全文
posted @ 2013-10-20 12:33
上校
阅读(261)
推荐(0)
2013年10月19日
摘要:
package com.wzh.test.beanutils;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
阅读全文
posted @ 2013-10-19 23:11
上校
阅读(6881)
推荐(1)
摘要:
package com.wzh.test.introspector;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import org.junit.Test;
//使用内省API操作Bean的属性
public class Demo1 {
@Test
public void test() throws Exception{
// BeanInfo info=Introspector.getBeanInfo(Person.class);
// BeanInfo info=Introspector.getBeanInfo(Class.forName("com.wzh.test.introspector.Person"));
BeanInfo
阅读全文
posted @ 2013-10-19 17:00
上校
阅读(424)
推荐(1)
摘要:
package com.wzh.test.enum1;
import org.junit.Test;
public class demo1 {
@Test
public void test2(){
System.out.println(Ab.c.name());
System.out.println(Ab.a.ordinal());
String str="b";
Ab a=Ab.valueOf(str);
System.out.println(a);
Ab arr[]= Ab.values();
for(Ab ab : arr){
System.out.println(ab);
}
}
@Test
public void testAb() {
System.out.println(Ab.b.localValue());
System.out.println(Ab.values());
}
// 带抽象方法的枚举
enum Ab {
a
阅读全文
posted @ 2013-10-19 16:57
上校
阅读(339)
推荐(0)
2013年10月15日
摘要:
1.SAX事件解析
package com.wzh.sax;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
阅读全文
posted @ 2013-10-15 23:31
上校
阅读(23051)
推荐(1)
2013年10月11日
摘要:
WorkIF.java
package com.wzh.test;
public interface WorkIf {
void doWork(String name);
}
阅读全文
posted @ 2013-10-11 20:44
上校
阅读(439)
推荐(0)
2013年9月29日
摘要:
myAnnotation
package com.wzh.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
阅读全文
posted @ 2013-09-29 23:07
上校
阅读(178)
推荐(0)
2013年9月28日
摘要:
ClassLoader cl = ClassLoader.getSystemClassLoader();
Class c = cl.loadClass("com.wzh.test.Student");
System.out.println(c);
System.out.println(c.getName());
阅读全文
posted @ 2013-09-28 22:21
上校
阅读(227)
推荐(0)
2013年9月27日
摘要:
package com.wzh.jdbc;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
阅读全文
posted @ 2013-09-27 20:48
上校
阅读(572)
推荐(0)
2013年9月26日
摘要:
protected interface Callback {
E doInCallback(Connection conn, PreparedStatement pstm, ResultSet rs)
throws Throwable;
}
阅读全文
posted @ 2013-09-26 22:34
上校
阅读(307)
推荐(0)
2013年9月19日
摘要:
try {
//加载驱动
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://127.0.0.1:3306/test";
//通过DriverManager获取连接
Connection conn=DriverManager.getConnection(url,"root","hello");
System.out.println("conn:"+conn);
//准备操作数据库
//Statement:用于执行静态SQL语句并返回它所生产结果的对象
Statement stm=conn.createStatement();
String sql="insert into test.new_table(t1,t2) values('t11','t22');";
Boolean ret =stm.execute(sql);
conn.close();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrac
阅读全文
posted @ 2013-09-19 11:32
上校
阅读(5004)
推荐(1)
2013年9月17日
摘要:
1.插入多条记录
insert into test.new_table(t1)
values('1'),
('2');
2.复制表结构及数据
create table test.tb2
SELECT * FROM test.new_table;
3.连接字符串函数
select concat(t1,t2) from test.new_table
create table test.tb2
SELECT * FROM test.new_table;
阅读全文
posted @ 2013-09-17 22:45
上校
阅读(453)
推荐(0)
2013年9月7日
摘要:
dom4j-full.jar 解析 XML
public Document getDocument() throws DocumentException
{
SAXReader read=new SAXReader();
return read.read(this.getClass().getResourceAsStream("/course.xml"));
}
阅读全文
posted @ 2013-09-07 00:39
上校
阅读(1651)
推荐(0)
2013年8月24日
摘要:
Eclipse的编辑功能非常强大,掌握了Eclipse快捷键功能,能够大大提高开发效率。Eclipse中有如下一些和编辑相关的快捷键。
1. 【ALT+/】
此快捷键为用户编辑的好帮手,能为用户提供内容的辅助,不要为记不全方法和属性名称犯愁,当记不全类、方法和属性的名字时,多体验一下【ALT+/】快捷键带来的好处吧。
阅读全文
posted @ 2013-08-24 20:31
上校
阅读(219)
推荐(0)
摘要:
一。jdk安装与配置
jdk7于3月份刚刚发布,目前eclipse的最新版本中还没有提供对jdk7的编译支持,所以我们只下载jdk6。
下载地址:http://download.java.net/jdk6/
阅读全文
posted @ 2013-08-24 20:28
上校
阅读(400)
推荐(0)
摘要:
本文将告诉你学习Java需要达到的25个目标,希望能够对你的学习及找工作有所帮助。对比一下自己,你已经掌握了这25条中的多少 条了呢?
1.你需要精通面向对象分析与设计(OOA/OOD)、涉及模式(GOF,J2EEDP)以及综合模式。你应该了解UML,尤其是 class,object,interaction以及statediagrams。
阅读全文
posted @ 2013-08-24 11:23
上校
阅读(329)
推荐(0)
2013年7月18日
摘要:
///
/// 是否为手机号码
///
///
///
public static bool IsMobileNo(string value)
{
return Regex.IsMatch(value, @"^1\d{10}$");
}
阅读全文
posted @ 2013-07-18 17:33
上校
阅读(334)
推荐(0)
2013年6月29日
摘要:
//此方法把启动项加载到注册表中
//获得应用程序路径
string strAssName = Application.StartupPath + @"\" + Application.ProductName + @".exe";
//获得应用程序名
string ShortFileName = Application.ProductName;
阅读全文
posted @ 2013-06-29 23:34
上校
阅读(321)
推荐(0)
2013年6月15日
摘要:
WebView(网络视图)能加载显示网页,可以将其视为一个浏览器。它使用了WebKit渲染引擎加载显示网页,实现WebView有以下两种不同的方法:
第一种方法的步骤:
1.在要Activity中实例化WebView组件:WebView webView = new WebView(this);
阅读全文
posted @ 2013-06-15 14:53
上校
阅读(293)
推荐(0)
2013年5月31日
摘要:
串行接口(Serial port)又称“串口”,主要用于串行式逐位数据传输。常见的有一般电脑应用的RS-232(使用 25 针或 9 针连接器)和工业电脑应用的半双工RS-485与全双工RS-422。
串行接口按电气标准及协议来分,包括RS-232-C、RS-422、RS485、USB等。 RS-232-C、RS-422与RS-485标准只对接口的电气特性做出规定,不涉及接插件、电缆或协议。USB是近几年发展起来的新型接口标准,主要应用于高速数据传输领域。
阅读全文
posted @ 2013-05-31 22:25
上校
阅读(2907)
推荐(0)
2013年5月28日
摘要:
/*******************************************************************************
* InvokeHelper.cs
* A thread-safe control invoker helper class.
* -----------------------------------------------------------------------------
* Project:Conmajia.Controls
阅读全文
posted @ 2013-05-28 22:13
上校
阅读(402)
推荐(0)
2013年5月27日
摘要:
对于稍微有点经验的.NET开发人员来说,倘若被问及如何保持线程同步,我想很多人都能说好好几种。在众多的线程同步的可选方式中,加锁无疑是最为常用的。如果仅仅是基于方法级别的线程同步,使用System.Runtime.CompilerServices.MethodImplAttribute无疑是最为简洁的一种方式。MethodImplAttribute可以用于instance method,也可以用于static method。当在某个方法上标注了MethodImplAttribute,并指定MethodImplOptions.Synchronized参数,可以确保在不同线程中运行的该方式以同步的方式运行。我们几天来讨论MethodImplAttribute(MethodImplOptions.Synchronized)和lock的关系。
阅读全文
posted @ 2013-05-27 23:49
上校
阅读(4231)
推荐(0)
2013年5月26日
摘要:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication8
阅读全文
posted @ 2013-05-26 20:12
上校
阅读(6835)
推荐(0)
2013年5月25日
摘要:
SendMessage(lvPrintData.Handle, WM_VSCROLL, 1, 0);
[DllImport("user32.dll", EntryPoint = "SendMessage")]
static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
const int WM_VSCROLL = 0x0115;
阅读全文
posted @ 2013-05-25 13:37
上校
阅读(321)
推荐(0)
2013年5月24日
摘要:
一、问题
在Management Studio中新建维护计划时,提示以下错误信息:
“代理XP”组件已作为此服务器安全配置的一部分被关闭。系统管理员可以使用sp_configure来启用“代理XP”。有关启用“代理XP”的详细信息,请参阅SQL Server联机丛书中的“外围应用配置器”。(ObjectExplorer)
阅读全文
posted @ 2013-05-24 14:11
上校
阅读(2425)
推荐(0)