![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
伤神v
这个作者很懒,什么都没留下…
展开
-
Hiberante 中 sort 的实现方式
http://hi.baidu.com/accpandsvse/blog/item/a12c22f23d0d1bc20a46e091.html http://hi.baidu.com/accpandsvse/blog/item/a12c22f23d0d1bc20a46e091.html從資料庫的觀點來看,Set、Map、Bag是無序的,而List是有序的,這邊所謂的無序或有序,是指將容器...原创 2012-04-01 14:12:25 · 174 阅读 · 0 评论 -
Java Thread: CountDownLatch 例子
public class CountDownLatchTest { @Test public void ThreadControllTest() throws InterruptedException{ // Suppose we have total 10 thread waiting to execute final int TOTAL_THREAD_NUM = 10...原创 2010-06-24 21:10:12 · 258 阅读 · 0 评论 -
Apache + SVN 配置
如何在Win32系統中配置安裝. Download Apache_Httpd 2.2.15 download the SVN 1.6.6 at the site here download TortoiseSVN 1.6.11 Configuration 1, 配置 Apache 的 Module, 使其加载 SVN...2010-06-06 16:25:46 · 153 阅读 · 0 评论 -
Java - JVM: 读书笔记 Chapter 05 The Java Virtual Machine ( Part III The Heap )
5.7 The Heap * There is only one heap inside a Java Virtual Machine instance, all threads share it. And a Java application has its own exclusive Java Virtual Machine instance, so there is a...2010-05-29 04:09:17 · 144 阅读 · 0 评论 -
Java - JVM: 读书笔记 Chapter 05 The Java Virtual Machine ( Part II Method Area )
Tutorial Materials: Inside Java Machine5.6. The Method Area How Information loaded / What information is kept in Method area? 1). Information about loaded types is stored in a logical ...2010-05-20 17:01:43 · 137 阅读 · 0 评论 -
Java - JVM: 读书笔记 Chapter 05 The Java Virtual Machine ( Part I Basic )
Tutorial Materials: Inside Java Machine Chapter 5 - The Java Virtual Machine 5.1 The Lifetime of a Java Virtual Machine A runtime instance of the Java Virtual Machine has a clear mission in...2010-05-20 17:01:27 · 139 阅读 · 0 评论 -
Hibernate 2nd-level cache: JBoss Caching 配置与注意事项
依赖包:jboss-cache-1.4.1.jarjboss-client-4.0.2.jarjboss-common-client.jarjboss-jmx.jajboss-system-4.0.2.jarjgroups-2.4.1.jarconcurrence check those under the attached file ensential-jar...原创 2010-08-06 15:14:22 · 223 阅读 · 0 评论 -
Hibernate 2nd-level cache: 基础概念
IntroductionThe goal for this document is to mainly describe the Hibernate 2nd-level caching strategy, learning how to use it and how can we got the performance benefit from the caching strategy....原创 2010-08-06 14:04:59 · 489 阅读 · 0 评论 -
Spring ExceptionHandlerResolver Example
转载: http://forum.springsource.org/archive/index.php/t-9726.html 目前,如果用Spring 2.5.5 和 Tomcat 5.5+. Spring 2.5.5 有一个Bug,会导致你导向的错误页面 被Tomcat HTTP STATUS 500 internal error() 页面所替代. https://jira.spri...原创 2010-07-29 21:58:38 · 124 阅读 · 0 评论 -
Sysdeo Eclipse Tomcat Launcher plugin 使用总结
TomcatLauncher plugin 很轻量级,很喜欢. 以下是如何通过 TomcatLauncher 搭建Tomcat 开发环境 step-by-step 1. 工程目录: 注 1. conf/server.xml 直接拷贝自 Tomcat 安装目录下的conf 文件,唯一要修改的地方是 注 2. WEB-INF 下面还应创建一个 classes ...原创 2010-06-25 16:55:37 · 175 阅读 · 0 评论 -
JSP - JSTL 如何自定义标签库
链接: http://wing123.iteye.com/blog/356585原创 2010-06-30 03:03:33 · 104 阅读 · 0 评论 -
JAXB Marchel and UnMarchel Quick Start
reference link: http://www.oracle.com/technetwork/articles/javase/index-140168.html (1.x)http://www.java-tips.org/java-ee-tips/java-architecture-for-xml-binding/what-is-new-in-jaxb-2.0.html Plu...原创 2010-09-27 21:19:56 · 144 阅读 · 0 评论 -
hibernate的各种保存方式的区别(save,persist,update,saveOrUpdte,merge,flush,lock) hibernate
引自:http://wj131.iteye.com/blog/320729 hibernate的各种保存方式的区别(save,persist,update,saveOrUpdte,merge,flush,lock) hibernate的保存一、准备知识对于hibernate,它的对象有三种状态,transient、pe...原创 2012-03-29 15:32:12 · 110 阅读 · 0 评论 -
Cruise Control 持续集成 - 如何自动编译,打包,并自动发布至Tomcat
一, 前言 目标是,利用CruiseControl 自动抓取SVN下的源代码,并且将项目源码自动编译,打包成war,并自动部署到 Tomcat 中。 二, CruiseControl 如何自动获取SVN源码1. 首先, 将 SVN 工程 checkout 到 CruiseControl Project 目录下。 cd ${CC_PROJECT_PATH}/your...原创 2012-10-18 16:43:19 · 243 阅读 · 0 评论 -
eclipse indigo 目前运行时遇到的问题汇总
用了几天 Eclipse Indigo, 运行时经常无故退出。 1. 启动报错,can not initialize JVM 解决办法: 修改 eclipse.ini,将 XXMaxPermSize 改为 128M 2. 用 SVN Checkout 项目,经常报错,无故退出 这个问题让我百思不得其解,但是解决办法是,将我本地安装的 SVN Server 端 给...原创 2012-10-18 09:45:26 · 246 阅读 · 0 评论 -
What is J2EE ( in just one simple sentence )
What is J2EE? J2EE is essentially about standardizing a range of enterprise services, such as naming and directory services (JNDI), transaction management offering a standard API potentially spa...原创 2011-11-29 20:38:06 · 136 阅读 · 0 评论 -
JUDE UML 操作技巧
1. How to create Assembly Connector - 1Step 1:Step 2:Step 3: Completed2. How to create Assembly Connector - 2Step 1. There are two same interfaces on diagram. One is connected by...原创 2011-04-02 13:26:30 · 320 阅读 · 0 评论 -
操作 Cookie
Cookie包含的属性 名称, 内容, 主机, 路径 .... Cookie的唯一性 一个唯一的Cookie 由 名称,主机,路径 确定. 这里路径是最容易被忽略的,如下图,这两个Cookie虽然名称,主机名都相同,但是确实两个不同的Cookie. 1) 有两个同名的 (PRODUCTS_IN_COOKIE) 2) 两个同名的Cookie 唯一...原创 2011-03-31 21:17:18 · 118 阅读 · 0 评论 -
Java 如何获得本机IP 或者 公网IP
你应该是拔号上网如果可以的话,请搜索一下网络,得到java怎么调用dos的方法,然后你可以解析ipconfig /all这个命令的结果,得到你想要的公网IP大部分情况下,用户都是通过路由来上网的,也就是说,电脑根本不知道自己的公网IP是多少,他只知道路由分配给它的内网IP,这个时候,我们只能通过别的网站来判断。下面是以前我以前写的一个小程序,通过www.ip138.com得到自...原创 2011-10-11 19:17:15 · 245 阅读 · 0 评论 -
JSTL - <form:select> 的用法
转载自: http://www.web-tag.net/3c98ca7b0cac8312.htm下拉框组件标签 下拉框标签的典型形式为: <form: select path="city" items="${cityList}"/>,它包括两方面的数据: 1)对应表单对象属性值(city); 2)用于构造整个下拉框选项的数据(cityList)...原创 2011-02-15 20:30:40 · 350 阅读 · 0 评论 -
Java - JVM: 垃圾收集器
1. Finalize如果某个对象实现了finalize() 方法,那么在垃圾回收器回收这个对象的时候,必须调用该对象被覆盖的finalize()方法.public class testAny { @Test public void testGCFinalize() throws InterruptedException{ call(); System.gc(); ...2010-05-04 19:00:03 · 103 阅读 · 0 评论 -
Java Thread - 控制你的线程
本人博客已经迁移至 www.shangyang.me 欢迎大家访问 1. Introduction 为了不让系统overloaded, 通常你不但需要创建线程,同时你也需要控制你的线程数量. 2. 方案 总体的规划是, 线程执行的过程中不超过一定临界值_latch。 如果超过了这个数量,那么会严重影响我的系统系能,甚至crash. 2.1 ...2010-07-07 22:53:47 · 176 阅读 · 0 评论 -
Java Design Pattern - Adapter
Profile & Notion, To make the interface of one Object look like something else they're not. In Real World, For the AC Power example.How 2 plugs AC Power adaptes with 3 plugs... Let' adaptive...2009-06-15 23:47:42 · 172 阅读 · 0 评论 -
Java 打包成可执行程序 .exe
将java应用程序打包成独立运行的.exe方法2009年02月06日 星期五 22:10将java应用程序打包成独立运行的.exe方法对于windows用户来说,将java应用程序打包成.exe最好不过了,现在我介绍两个方法。1、用专业的应用程序打包工具InstallAnywhere,这个软件几乎能在所有平台上运行,当然你要下载到你需要的那个平台的啦!而且它也...原创 2009-06-12 17:32:18 · 171 阅读 · 0 评论 -
Java 5.0 基础 - Variable Arguments ( Varargs ) 可变参数
语法使用 假设,我们有构造函数public Guitar(String builder, String model, String... features); String... features 标志着这个构造函数可以接受可变数目的features变量,下面的两个构造函数使用都是OK的。构造方法一Guitar guitar = new Guitar("Mart...2009-06-12 15:56:09 · 147 阅读 · 0 评论 -
Userfull Links
Study Site1. Java Basics 5.0 Java programming Language: http://java.sun.com/j2se/1.5.0/docs/guide/language/index.htmlLibraries Download Site1. Spring Offical site: http://www.sprin...2009-06-09 22:23:04 · 115 阅读 · 0 评论 -
Java 5.0 基础 - Generic
Unbounded Wildcard Types If you to use a generic type but you don’t know or care what the actual type parameter is, you can use a question mark instead. For example, the unbounded wildcard type...2009-12-09 16:41:06 · 143 阅读 · 0 评论 -
Hibernate: 复合主键 (Composite Key) 如何兼容 NULL值
本人博客已经迁移至 www.shangyang.me 欢迎大家访问 Gavin King addressed that Any Key used for Hibernate mapping should not be NULL, if any one is NULL, the whole entity should be NULL. reference at: http://o...2009-11-25 16:13:19 · 230 阅读 · 0 评论 -
JTA/XA: Atomikos + Spring + Hibernate 配置 注意事项
本人博客已迁移至 www.shangyang.me 欢迎大家访问 1. xaDataSource 配置如下. (DB2)<bean id="xaDataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close"> ...2009-11-24 20:03:06 · 285 阅读 · 0 评论 -
RunTime - Funtional Abilities
Garbage Recycle Runtime.getRuntime().gc()Monitor the free memory of JVMlong freeMemory = Runtime.getRuntime().freeMemory();2009-11-07 10:41:29 · 91 阅读 · 0 评论 -
Eclipse configuration tips
Run Configuration tips 1. How to added the VM variables or Program variables Suppose that we have the configurationjava -Djavax.net.debug=SSL,handshake,data,trustmanager yourPrograme needs to ...2009-06-28 16:08:52 · 122 阅读 · 0 评论 -
Java 5.0 基础 - isAssignableFrom 与 instanceof 的区别
1. Condtions/Results1) a instanceof B, B 满足如下条件,返回True 1. B 是 a 的 类 2. B 是 a 的 超类 3. B 是 a 的 接口 4. B 是 a 的 超类 接口2) a.isAssignableFrom( B...2009-06-29 17:24:46 · 88 阅读 · 0 评论 -
Java-Transaction: 理解 XADataSource
本人博客已经迁移至 www.shangyang.me 欢迎大家访问 Reference Site:atomikos site: http://www.atomikos.com/Documentation/ConfiguringJdbc http://www.atomikos.com/Documentation/WebHomeJTA ...2009-12-21 21:36:43 · 310 阅读 · 0 评论 -
JAVA通过IP查询详细地址 Step-By-Step ( 纯真IP地址库)
本人博客已经迁移至 www.shangyang.me 欢迎大家访问 1. 首先,我们需要一个免费的IP地址库. 纯真IP地址库 是个不错的选择 (见附件) 2. IPParser.java 读取 该纯真地址库. (见附件) 该 IPParser 工具 不需要cache任何数据(避免大量内存占用), 直接文件RandomAccess读取. 性能测试:...2010-07-07 12:47:37 · 156 阅读 · 0 评论 -
Java 5.0 基础 - Enum
public class EnumeratorTest { enum Class{ ClassA("Class 1", 40, "Bruce"), // Init the constructors by its parameters. ClassB("Class 2", 38, "Lee"), ClassC("Class 3", 42, "Daniel"),2010-01-28 17:14:20 · 107 阅读 · 0 评论 -
Java 基础 - 正则表达式 Regex
Text Symbol 1. The special text symbol - Meta Characters a. [ ] \ ^ $ . | ? * + ( ) those characters are remaining for Regex engine of some special usage. b. If you want to use those spe...2009-08-03 22:44:44 · 431 阅读 · 0 评论 -
Log4J
Usefull links1.2 JavaDoc: http://logging.apache.org/log4j/1.2/apidocs/index.html1.2 Maual Short Introduction: http://logging.apache.org/log4j/1.2/manual.htmlQuick StartExample - Uses the root ...2009-07-13 22:42:56 · 115 阅读 · 0 评论 -
Java 基础 - Call Back Function
本人博客已经迁移至 www.shangyang.me 欢迎大家访问 概念 回调函数 是由开发者自己编写,但不是给开发者自己调用。通常是用户通过把该方法的地址或者引用传递给系统调用者,系统在必要的时候(比如某事件发生)调用该开发者定义的方法。 例如, C++中模块 A有一个函数 foo,它向模块 B传递 foo的地址,然后在 B里面发生某种事件( event)时,通过从 A里面传...2009-07-08 23:44:36 · 119 阅读 · 0 评论 -
Apache - JEXL
Learning Sitehttp://commons.apache.org/jexl/Usage:1. Expression Calculation i) Elements a. JexlContext hold on the variable numbers b. ExpressionFactory create an Express...2009-07-04 01:53:41 · 272 阅读 · 0 评论 -
Java 5.0 基础 - Annotation
Reference Doc, Official Site: http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.htmlCSDN Site: http://blog.csdn.net/numberpig/archive/2006/08/18/1095144.aspx Quick Start Example...2009-07-02 21:06:36 · 120 阅读 · 0 评论