﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-xiaohei</title><link>http://www.blogjava.net/xiaohei/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 26 Apr 2026 11:34:35 GMT</lastBuildDate><pubDate>Sun, 26 Apr 2026 11:34:35 GMT</pubDate><ttl>60</ttl><item><title>JS 动态加载脚本(转)</title><link>http://www.blogjava.net/xiaohei/archive/2013/06/01/400049.html</link><dc:creator>Tomas</dc:creator><author>Tomas</author><pubDate>Sat, 01 Jun 2013 01:19:00 GMT</pubDate><guid>http://www.blogjava.net/xiaohei/archive/2013/06/01/400049.html</guid><wfw:comment>http://www.blogjava.net/xiaohei/comments/400049.html</wfw:comment><comments>http://www.blogjava.net/xiaohei/archive/2013/06/01/400049.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaohei/comments/commentRss/400049.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaohei/services/trackbacks/400049.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 首先我们需要一个被加载的js文件，我在一个固定文件夹下创建了一个package.js，打开后在里面写一个方法functionOne，很简单，代码如下：function functionOne(){    alert("成功加载");}后面的html文件都创建在同一个目录下。方法一：直接document.write在同一个文件夹下面创建一个function1.html，代码如下：&lt;ht...&nbsp;&nbsp;<a href='http://www.blogjava.net/xiaohei/archive/2013/06/01/400049.html'>阅读全文</a><img src ="http://www.blogjava.net/xiaohei/aggbug/400049.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaohei/" target="_blank">Tomas</a> 2013-06-01 09:19 <a href="http://www.blogjava.net/xiaohei/archive/2013/06/01/400049.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>多文件上传</title><link>http://www.blogjava.net/xiaohei/archive/2013/05/17/399414.html</link><dc:creator>Tomas</dc:creator><author>Tomas</author><pubDate>Fri, 17 May 2013 07:56:00 GMT</pubDate><guid>http://www.blogjava.net/xiaohei/archive/2013/05/17/399414.html</guid><wfw:comment>http://www.blogjava.net/xiaohei/comments/399414.html</wfw:comment><comments>http://www.blogjava.net/xiaohei/archive/2013/05/17/399414.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaohei/comments/commentRss/399414.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaohei/services/trackbacks/399414.html</trackback:ping><description><![CDATA[<p><br />多文件上传 jquery的插件<br />使用的方法&nbsp; 导入&nbsp;jquery.js 及 jquery.MultiFile.js ，<br />方式一： 后台是文件数组&nbsp;&nbsp;<br />&nbsp;private File[] upload; // 与jsp表单中的名称对应<br />&nbsp;private String[] uploadFileName;<br />&nbsp;private String[] uploadContentType;<br />在 form 中加入 &lt;input type="file" name="upload[]" class="multi" /&gt; 即可。<br /><br />方式二：后台是List&lt;File&gt;<br />&nbsp;private List&lt;File&gt; upload; // 与jsp表单中的名称对应<br />&nbsp;private List&lt;String&gt; uploadFileName;<br />&nbsp;private List&lt;String&gt; uploadContentType;<br /><br />jquery.MultiFile.js&nbsp; 将选中的文件列在From中，名字为upload的&lt;input&gt;，所以要用 <span style="color: #800000"><strong>name="upload[]"（方法一）或者</strong><span style="color: #800000"><strong>name="upload" （方法二）&nbsp;来接收</strong></span></span>；<br />而 <strong><span style="color: #800000">class="multi"</span></strong> 是 jQuery 用来作的文件类型，HTML&nbsp;部份代码如下： 
<p>
<table border="1" cellspacing="1" cellpadding="1" width="100%">
<tbody>
<tr>
<td>
<p>&lt;head&gt;<br />&lt;meta http-equiv='Content-Type' content='text/html; charset=utf-8' /&gt;<br />&lt;title&gt;Untitled Document&lt;/title&gt;<br /><span style="color: #800000"><strong>&lt;script src="/multiple-file-upload/jquery.js" type="text/javascript" language="javascript"&gt;&lt;/script&gt;<br />&lt;script src="/multiple-file-upload/jquery.MultiFile.js" type="text/javascript" language="javascript"&gt;&lt;/script&gt;</strong></span></p>
<p>&lt;/head&gt;<br />&lt;body&gt;</p>
<p>&lt;form enctype="multipart/form-data" action="&lt;?php $_SERVER['PHP_SELF'] ?&gt;" method="POST"&gt;<br /><span style="color: #800000"><strong>&lt;input type="file" name="upload[]" class="multi" maxlength="2"/&gt;<br /><span style="color: #800000"><strong>//&lt;input type="file" name="<strong><font color="#800000">upload</font></strong>" class="multi" /&gt;</strong></span><br /></strong></span><br />&lt;input type="submit" value="Upload File" /&gt;<br />&lt;/form&gt;</p>
<p>&lt;/body&gt;</p></td></tr></tbody></table>参数说明：
<p>
<table class="datagrid" border="1" cellspacing="1" cellpadding="1" width="100%">
<tbody>
<tr>
<th>参数</th>
<th>说明</th>
<th>说明</th></tr>
<tr>
<td>class="multi" maxlength="2"</td>
<td>Limit: 2 files. <br />Allowed extensions: any.</td>
<td>限制数量2</td></tr>
<tr>
<td>class="multi" accept="gif|jpg"</td>
<td>Limit: no limit. <br />Allowed extensions: gif and jpg.</td>
<td>格式只能 gif&nbsp; jpg</td></tr>
<tr>
<td>class="multi" accept="gif|jpg" maxlength="3"</td>
<td>Limit: 3 files <br />Allowed extensions: gif, jpg.</td>
<td>限制数量3，格式只能 gif&nbsp; jpg</td></tr></tbody></table>
<p><br />主页:<a href="http://www.fyneworks.com/jquery/multiple-file-upload/" target="_blank">http://www.fyneworks.com/jquery/multiple-file-upload/</a> 
<p>下载:<a href="http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Download" target="_blank">http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Download</a> 
<p>示例:<a href="http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Examples" target="_blank">http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Examples</a> </p><img src ="http://www.blogjava.net/xiaohei/aggbug/399414.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaohei/" target="_blank">Tomas</a> 2013-05-17 15:56 <a href="http://www.blogjava.net/xiaohei/archive/2013/05/17/399414.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>数字转换为大写人民币计数</title><link>http://www.blogjava.net/xiaohei/archive/2011/12/26/367181.html</link><dc:creator>Tomas</dc:creator><author>Tomas</author><pubDate>Mon, 26 Dec 2011 05:26:00 GMT</pubDate><guid>http://www.blogjava.net/xiaohei/archive/2011/12/26/367181.html</guid><wfw:comment>http://www.blogjava.net/xiaohei/comments/367181.html</wfw:comment><comments>http://www.blogjava.net/xiaohei/archive/2011/12/26/367181.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaohei/comments/commentRss/367181.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaohei/services/trackbacks/367181.html</trackback:ping><description><![CDATA[<div>/**<br />&nbsp;* 数字转换为大写人民币计数<br />&nbsp;* @author 王代军<br />&nbsp;* @since Dec 16,2011<br />&nbsp;*/<p>public class Num2Rmb<br />{<br />&nbsp;&nbsp; &nbsp;private String[] hanArr = {"零" , "壹" , "贰" , "叁" , "肆" , <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"伍" , "陆" , "柒" , "捌" , "玖"};<br />&nbsp;&nbsp; &nbsp;private String[] unitArr = {"拾","百","千","万"};<br /><br />&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * 把一个四位的数字字符串变成汉字字符串<br />&nbsp;&nbsp; &nbsp; * @param numStr 需要被转换的四位的数字字符串<br />&nbsp;&nbsp; &nbsp; * @return 四位的数字字符串被转换成的汉字字符串。<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;private String toHanStr(String numStr)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;String result = "";<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;int numLen = numStr.length();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//依次遍历数字字符串的每一位数字<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for (int i = 0 ; i &lt; numLen ; i++ )<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//把char型数字转换成的int型数字，因为它们的ASCII码值恰好相差48<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//因此把char型数字减去48得到int型数字，例如'4'被转换成4。<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;int num = numStr.charAt(i) - 48;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//如果不是最后一位数字，而且数字不是零，则需要添加单位（千、百、十）<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if ( i != numLen - 1 &amp;&amp; num != 0)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;result += hanArr[num] + unitArr[numLen - 2 - i];<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//否则不要添加单位<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//上一个数是否为&#8220;零&#8221;，不为&#8220;零&#8221;时就添加<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(result.length()&gt;0 &amp;&amp; hanArr[num].equals("零") &amp;&amp; result.charAt(result.length()-1)=='零')<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;continue;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;result += hanArr[num];<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//只有个位数，直接返回<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(result.length()==1)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return result;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;int index=result.length()-1;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;while(result.charAt(index)=='零'){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;index--;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(index!=result.length()-1)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return result.substring(0,index+1);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return result;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * 把一个输入的数字字符串变成汉字字符串<br />&nbsp;&nbsp; &nbsp; * @param numStr 需要被转换得到数字字符串<br />&nbsp;&nbsp; &nbsp; * @return 数字字符串被转换成的汉字RMB字符串。<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;private String toRmbStr(String numStr){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//获取字符串长度<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;int numLen = numStr.length();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//判断长度小于4(一万以内~0-9999) 调用toHanStr(）;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(numLen&lt;=4){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; return toHanStr(numStr);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//4&lt;长度&lt;=8 (一亿以内 1000-99999999)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else if(numLen&gt;4&amp;&amp;numLen&lt;=8){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; String[] subArr={numStr.substring(0, numLen-4),numStr.substring(numLen-4, numLen)};<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; return toHanStr(subArr[0])+"万"+toHanStr(subArr[1]);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//8&lt;长度&lt;=10 (百亿以内 一亿-9999999999)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else if(numLen&gt;8&amp;&amp;numLen&lt;=10){<br />&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; String[]  subArr={numStr.substring(0,numLen-8),numStr.substring(numLen-8,numLen-4),numStr.substring(numLen-4,numLen)};<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; return toHanStr(subArr[0])+"亿"+toHanStr(subArr[1])+"万"+toHanStr(subArr[2]);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else return "输入有误！";&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp; public static void main(String[] args) <br />&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Num2Rmb nr = new Num2Rmb();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println("只支持整数（0~99亿）");<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//测试把一个四位的数字字符串变成汉字字符串<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("1"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("10"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("15"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("110"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("123"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("105"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("1000"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("1101"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("1110"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("1005"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("101105"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("1011109"));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(nr.toRmbStr("9999999999"));<br />&nbsp;&nbsp;&nbsp; }<br />}</p></div><img src ="http://www.blogjava.net/xiaohei/aggbug/367181.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaohei/" target="_blank">Tomas</a> 2011-12-26 13:26 <a href="http://www.blogjava.net/xiaohei/archive/2011/12/26/367181.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>hibernate 通用的增该查 工具类 供Dao层使用</title><link>http://www.blogjava.net/xiaohei/archive/2011/12/26/367180.html</link><dc:creator>Tomas</dc:creator><author>Tomas</author><pubDate>Mon, 26 Dec 2011 05:22:00 GMT</pubDate><guid>http://www.blogjava.net/xiaohei/archive/2011/12/26/367180.html</guid><wfw:comment>http://www.blogjava.net/xiaohei/comments/367180.html</wfw:comment><comments>http://www.blogjava.net/xiaohei/archive/2011/12/26/367180.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaohei/comments/commentRss/367180.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaohei/services/trackbacks/367180.html</trackback:ping><description><![CDATA[通用的增删该查工具类&nbsp; 可在dao层 new一个<div>CommonCrudUtil（本类）实例&nbsp; 实现对数据的增删改查</div><br /><br /><br /><br />package com.XXXXX.util;<br /><br />import java.io.Serializable;<br />import java.util.ArrayList;<br />import java.util.List;<br />import org.hibernate.*;<br />/**<br />&nbsp;* 通用增删改查工具类<br />&nbsp;* @author 王代军<br />&nbsp;* @since Dec 19,2011<br />&nbsp;* @version 1.0<br />&nbsp;*/<br />@SuppressWarnings("unchecked")<br />public class CommonCrudUtil&lt;T&gt; {<br />&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * 添加功能<br />&nbsp;&nbsp; &nbsp; * @param obj 要保存的对象<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;public boolean create(Object obj){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Session session=HibernateSessionFactory.getSession();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Transaction tx=null;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;boolean flag=false;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;try{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx=session.beginTransaction();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;session.persist(obj);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.commit();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;flag=true;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}catch(Exception e){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;e.printStackTrace();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(tx!=null){&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.rollback();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}finally{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;session.close();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return flag;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * 查询功能<br />&nbsp;&nbsp; &nbsp; * @param clazz 要查询对象的类型&nbsp; obj 要查询的对象的 可序列化的字段 (本设计指主键 id)<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;public Object retrieve(Class clazz,Object obj){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Session session=HibernateSessionFactory.getSession();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Transaction tx=null;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;try{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx=session.beginTransaction();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Object object=session.get(clazz,(Serializable) obj);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.commit();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return object;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}catch(Exception e){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;e.printStackTrace();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(tx!=null){&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.rollback();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return null;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}finally{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;session.close();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;}&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * 查询全部功能<br />&nbsp;&nbsp; &nbsp; * @param clazz 要查询的对象的类型<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;public List&lt;T&gt; retrieve(Class clazz){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Session session=HibernateSessionFactory.getSession();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;List&lt;T&gt; list=new ArrayList&lt;T&gt;();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Transaction tx=null;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;try{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx=session.beginTransaction();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Criteria cr=session.createCriteria(clazz);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;list=cr.list();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.commit();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return list;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}catch(Exception e){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;e.printStackTrace();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(tx!=null){&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.rollback();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return null;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}finally{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;session.close();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * 更新功能<br />&nbsp;&nbsp; &nbsp; * @param obj 要更新的对象<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;public boolean update(Object obj){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Session session=HibernateSessionFactory.getSession();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean flag=false;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Transaction tx=null;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;try{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx=session.beginTransaction();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;session.update(obj);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.commit();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;flag=true;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}catch(Exception e){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;e.printStackTrace();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(tx!=null){&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.rollback();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}finally{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;session.close();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return flag;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * 删除功能<br />&nbsp;&nbsp; &nbsp; * @param clazz 要删除的对象的类型 obj 要删除的对象的 唯一标识(可序列化)字段 (指主键 id)<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;public boolean delete(Class clazz,Object obj){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Session session=HibernateSessionFactory.getSession();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Transaction tx=null;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;boolean flag=false;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;try{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx=session.beginTransaction();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Object object=session.get(clazz,(Serializable) obj);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;session.delete(object);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.commit();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;flag=true;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}catch(Exception e){<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;e.printStackTrace();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(tx!=null){&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;tx.rollback();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}finally{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;session.close();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return flag;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;<br />}<br /><br /><br /><br />调用实现 &nbsp; dao层的实现类调用&nbsp; <div>&nbsp;&nbsp; CommonCrudUtil&nbsp; 的方法实现增删改查</div><br />import java.util.Date;<br />import java.util.List;<br /><br />import org.hibernate.Query;<br />import com.zhongyou.bean.IDCard;<br />import com.zhongyou.util.CommonCrudUtil;<br /><br />public class IDCardDaoImpl implements IDCardDaoIf {<br /><br />&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp; CommonCrudUtil crud=new CommonCrudUtil&lt;IDCard&gt;();<br />&nbsp;&nbsp;&nbsp; <div>&nbsp;&nbsp;&nbsp;&nbsp; public int addInformation(IDCard card) {</div><br />&nbsp;&nbsp; &nbsp; IDCard card=new IDCard();<br />&nbsp;&nbsp; &nbsp; card.setId(16);<br />&nbsp;&nbsp; &nbsp; card.setName("xiaoxiao");<br />&nbsp;&nbsp; &nbsp; card.setAddress("xiaoxiao");<br />&nbsp;&nbsp; &nbsp; card.setBirthday(new Date());<br />&nbsp;&nbsp; &nbsp; card.setNumber("29472398734");<br />&nbsp;&nbsp; &nbsp; card.setSex("男");<br /><br /><br />&nbsp;&nbsp; &nbsp; crud.create(card);//增加.......<br /><br />}<br />&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp; 。。。。。。查询。。。。。<br /><div>&nbsp;&nbsp;&nbsp;&nbsp; crud.retrieve(IDCard.class,3);<br /><div>&nbsp;&nbsp;&nbsp; 。。。。。。查询全部。。。。。<br /> <div>&nbsp;&nbsp;&nbsp;&nbsp; crud.retrieve(IDCard.class);</div></div><br />&nbsp;&nbsp;&nbsp; 。。。。。。修改。。。。<br /><div>&nbsp;&nbsp;&nbsp;&nbsp; crud.update(card);<br /><div>&nbsp;&nbsp;&nbsp; 。。。。。。删除。。。。<br /> <div>&nbsp;&nbsp;&nbsp;&nbsp; crud.delete(IDCard.class,3);<br />。。。。。。。。。</div></div><br /><br /><br /></div>写的简陋些&nbsp; 只是些想法可借鉴而已 同志们 可以自己完善。。。。</div><br /><br /><br /><br /><img src ="http://www.blogjava.net/xiaohei/aggbug/367180.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaohei/" target="_blank">Tomas</a> 2011-12-26 13:22 <a href="http://www.blogjava.net/xiaohei/archive/2011/12/26/367180.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle 服务详解</title><link>http://www.blogjava.net/xiaohei/archive/2011/11/09/363282.html</link><dc:creator>Tomas</dc:creator><author>Tomas</author><pubDate>Wed, 09 Nov 2011 03:50:00 GMT</pubDate><guid>http://www.blogjava.net/xiaohei/archive/2011/11/09/363282.html</guid><wfw:comment>http://www.blogjava.net/xiaohei/comments/363282.html</wfw:comment><comments>http://www.blogjava.net/xiaohei/archive/2011/11/09/363282.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaohei/comments/commentRss/363282.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaohei/services/trackbacks/363282.html</trackback:ping><description><![CDATA[<div id="content"><p>Oracle的默认服务一共有5个：</p> <p>1.OracleDBConsoleorcl oem控制台的服务进程</p> <p>2.OracleJobSchedulerORCL 定时器的服务进程</p> <p>3.OracleOraDb10g_home1iSQL*Plus isql*plus的服务进程</p> <p>4.OracleOraDb10g_home1TNSListener 监听器的服务进程</p><table align="center" border="0" height="1" width="1071"><tbody><tr><td colspan="2"><br /></td></tr></tbody></table> <p>5.OracleServiceORCL 数据库服务进程</p> <p>要查看系统中已启动的服务，我们可以在&#8220;开始&#8594;控制面板&#8594;管理工具&#8221;中双击&#8220;服务&#8221;，或者直接</p> <p>在&#8220;运行&#8221;中输入 &#8220;Services.msc&#8221;打开服务设置对话框，就可以看到每一个服务都有以下几个属</p> <p>性：名称、描述、状态、启动类型、登录身份、依存关系。</p> <p>OracleDBConsoleorcl --可以不启动,用于管理Oracle的企业管理器的服务.</p> <p>OracleJobSchedulerORCL --通常不启动,用于定期操作任务的服务</p> <p>OracleOraDb10g_home1iSQL*Plus --可以不启动,这是isqlplus服务,用于用网页执行sql执行,11g已</p> <p>经取消了这个功能</p> <p>OracleOraDb10g_home1TNSListener --必须启动,这是临听,用于远程客户端连接你的Oracle</p> <p>OracleServiceORCL --必须启动,这是Oracle数据库的服务</p> <p>可以用命令启动：</p> <p>#启动listener:</p> <p>lsnrctl start</p> <p>#启动数据库</p> <p>net start OracleServiceORCL</p> <p>只有这两项是必须启动的：</p> <p>OracleOraDb10g_home1TNSListener</p> <p>OracleServiceORCL</p> <p>为什么OracleJobSchedulerORCL会显示禁用？</p> <p>数据库工作日程调度，一般没有安排工作日程就不需要启动，为什么默认是禁用？因为启动后会占用很大的系统资源。</p> <p>（1）OracleServiceSID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p>数据库服务，这个服务会自动地启动和停止数据库。如果安装了一个数据库，它的缺省启动类型为自动。服务进程为Oracle.EXE，参数文件initSID.ora，日志文件SIDALRT.log，控制台SVRMGRL.EXE、SQLPLUS.EXE。</p> <p>（2）OracleHOME_NAMETNSListener</p> <p>监听器服务，服务只有在数据库需要远程访问时才需要（无论是通过另外一台主机还是在本地通过 SQL.Net  网络协议都属于远程访问），不用这个服务就可以访问本地数据库，它的缺省启动类型为自动。服务进程为TNSLSNR.EXE，参数文件 Listener.ora，日志文件listener.log，控制台LSNRCTL.EXE，默认端口1521、1526。</p> <p>（3）OracleHOME_NAMEAgent</p> <p>OEM代理服务，接收和响应来自OEM控制台的任务和事件请求，只有使用OEM管理数据库时才需要，它的缺省启动类型为自动。服务进程为DBSNMP.EXE，参数文件snmp_rw.ora，日志文件nmi.log，控制台LSNRCTL.EXE，默认端口1748。</p> <p>（4）OracleHOME_NAMEClientCache&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p>名字缓存服务，服务缓存用于连接远程数据库的Oracle Names 数据。它的缺省启动类型是手动。然而，除非有一台Oracle Names   服务器，否则没有必要运行这个服务。服务进程为ONRSD.EXE，参数文件NAMES.ORA，日志文件ONRSD.LOG，控制台 NAMESCTL.EXE。</p> <p>（5）OracleHOME_NAMECMAdmin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p>连接管理服务，是构建Connection Manager服务器所用，只有服务器作为Connection  Manager才需要，它的缺省启动类型是手动。服务进程为CMADMIN.EXE，参数文件CMAN.ORA，日志文件CMADM_PID.TRC，控 制台CMCTL.EXE，默认端口1830。</p> <p>（6）OracleHOME_NAMECMan&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p>连接网关服务，是构建Connection Manager服务器所用，只有服务器作为Connection  Manager才需要，它的缺省启动类型是手动。服务进程为CMGW.EXE，参数文件CMAN.ORA，日志文件CMAN_PID.TRC，控制台 CMCTL.EXE，默认端口1630。</p> <p>（7）OracleHOME_NAMEDataGatherer</p> <p>性能包数据采集服务，除非使用Oracle Capacity Planner 和 Oracle Performance  Manager，否则不需要启动，它的缺省启动类型是手动。服务进程为VPPDC.EXE，日志文件alert_dg.log，控制台 vppcntl.exe。</p> <p>（8）OracleHOME_NAMEHTTPServer</p> <p>Oracle提供的WEB服务器，一般情况下我们只用它来访问Oracle Apache 目录下的Web 页面，比如说JSP  或者modplsql  页面。除非你使用它作为你的HTTP服务，否则不需要启动（若启动它会接管IIS的服务），它的缺省启动类型是手动。服务进程为APACHE.EXE，参 数文件httpd.conf，默认端口80。</p> <p>（9）OracleHOME_NAMEPagingServer</p> <p>通过一个使用调制解调器的数字传呼机或者电子邮件发出警告（没试过），它的缺省启动类型是手动。服务进程PAGNTSRV.EXE，日志文件paging.log。</p> <p>（10）OracleHOME_NAMENames</p> <p>Oracle Names服务，只有服务器作为Names Server才需要，它的缺省启动类型是手动。服务进程NAMES.EXE，参数文件NAMES.ORA，日志文件NAMES.LOG，控制台NAMESCTL.EXE，默认端口1575。</p> <p>（11）OracleSNMPPeerMasterAgent</p> <p>SNMP服务代理，用于支持SNMP的网管软件对服务器的管理，除非你使用网管工具监控数据库的情况，否则不需要启动，它的缺省启动类型是手动。服务进程为AGNTSVC.EXE，参数文件MASTER.CFG，默认端口161。</p> <p>（12）OracleSNMPPeerEncapsulater</p> <p>SNMP协议封装服务，用于SNMP协议转换，除非你使用一个不兼容的SNMP代理服务，否则不需要启动，它的缺省启动类型是手动。服务进程为ENCSVC.EXE，参数文件ENCAPS.CFG，默认端口1161。</p> <p>（13）OracleHOME_NAMEManagementServer</p> <p>OEM管理服务，使用OEM时需要，它的缺省启动类型是手动。服务进程为OMSNTSVR.EXE，日志文件oms.nohup。</p> <p>OracleServiceMYDB</p> <p>OracleOraHome92TNSListener</p> <p>别的一般不用开，有需要再开</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p>附（批处理）</p><p><div>:doit<br /><br />　　@echo off<br /><br />　　set /p xz=按"kq"键启动服务------按"gb"关闭服务<br /><br />　　if %xz%==kq goto kq<br /><br />　　if %xz%==gb goto gb<br /><br />　　goto doit<br /><br />　　:kq<br /><br />　　@echo off<br /><br />　　echo 正在启动oracle服务，请稍等......<br /><br />　　net start OracleServiceORCL<br /><br />　　net start OracleDBConsoleorcl<br /><br />　　net start OracleOraDb10g_home1TNSListener<br /><br />　　net start OracleOraDb10g_home1iSQL*Plus<br /><br />　　echo 启动oracle服务完成<br /><br />　　echo. &amp; pause<br /><br />　　goto doit<br /><br />　　:gb<br /><br />　　@echo off<br /><br />　　echo 正在关闭oracle服务，请稍等.......<br /><br />　　net stop OracleServiceORCL<br /><br />　　net stop OracleDBConsoleorcl<br /><br />　　net stop OracleOraDb10g_home1TNSListener<br /><br />　　net stop OracleOraDb10g_home1iSQL*Plus<br /><br />　　echo 关闭oracle服务完成<br /><br />　　echo. &amp; pause<br /><br />　　goto doit<br /><br />把代码复制 保存&nbsp; 修改后缀名为.bat 执行即可；<br /><br /></div></p></div><img src ="http://www.blogjava.net/xiaohei/aggbug/363282.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaohei/" target="_blank">Tomas</a> 2011-11-09 11:50 <a href="http://www.blogjava.net/xiaohei/archive/2011/11/09/363282.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>解析--Session</title><link>http://www.blogjava.net/xiaohei/archive/2011/10/16/361375.html</link><dc:creator>Tomas</dc:creator><author>Tomas</author><pubDate>Sun, 16 Oct 2011 13:29:00 GMT</pubDate><guid>http://www.blogjava.net/xiaohei/archive/2011/10/16/361375.html</guid><wfw:comment>http://www.blogjava.net/xiaohei/comments/361375.html</wfw:comment><comments>http://www.blogjava.net/xiaohei/archive/2011/10/16/361375.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaohei/comments/commentRss/361375.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaohei/services/trackbacks/361375.html</trackback:ping><description><![CDATA[<p><br /><br /><br /><br />会话跟踪，其原理是什么。<br /><br />我们都知道，为了在WEB服务器中识别发出请求的用户，对于每一个访问者WEB服<br /><br /><br />务器都会给其创建一个session。在会话的创建于使用中，比较容易犯错误的地<br /><br /><br />方主要是当我们需要读取出保存在session的数据时，没有转化为相应的格式，<br /><br /><br />导致程序出错。比如：<br /><br />HttpSession session=request.getSession();<br /><br /><br />|\\\\\\\\\\<br /><br /><br />注意Session在为进行HttpSession session=request.getSession();之前<br /><br /><br /></p><p>out.println(request.getSession());</p><p><br />HttpSession hs=request.getSession();<br />out.println(hs);<br />两者执行的结果相同;<br /><br /><br />第一个是获得Tomcat内置的默认Session  (就是会话建立时自动生成的Session唯一标记本次会话)<br /><br /><br />第二次 是把 唯一的标识Session 通过request.getSession()获取内存地址 给hs 然后hs<br /><br /><br />会获取Session 然后对其操作&nbsp; 其实本质上是对本次会话的唯一Session进行操作.<br /><br /><br />\\\\\\\\\\\\\\<br /><br />String MyName="Hello Accp";<br /><br />session.setAttribute("name",MyName);<br /><br />String name=seeeion.getAttribute("name");//错误的<br /><br />String name=(String)seeeion.getAttribute("name");//正确的<br /><br />由于WEB服务器为用户创建的Session会占用系统内存，所以通常服务器都需要及<br /><br /><br />时的删除Session信息以释放资源，方法有：<br /><br />&#9312;关闭浏览器，关闭Session。<br /><br />&#9313;调用HttpSession的invalidate()方法，删除HttpSession对象和数据。<br /><br />&#9314;两次访问时间间隔大于Session定义的非活动时间。<br /><br />在Servlet中的HttpRequestServlet对象创建HttpSession对象有两种方法：<br /><br />&#9312;HttpSession session=request.getSession(boolean value);<br /><br />&#9313;HttpSession session=request.getSession();<br /><br />第一中方法中，布尔值为true时，如果存在于当前请求相关联的会话，就返回该<br /><br /><br />会话，否则就返回一个新会话。反之，布尔值为false时，如果存在当前请求相<br /><br /><br />关联的会话，就返回该会话，否则就返回null。<br /><br />第二种方法与第一种方法的第一种情况相同。通常我们都喜欢使用第二种方法。</p><img src ="http://www.blogjava.net/xiaohei/aggbug/361375.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaohei/" target="_blank">Tomas</a> 2011-10-16 21:29 <a href="http://www.blogjava.net/xiaohei/archive/2011/10/16/361375.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java Bean 的学习心得（转）</title><link>http://www.blogjava.net/xiaohei/archive/2011/10/10/360916.html</link><dc:creator>Tomas</dc:creator><author>Tomas</author><pubDate>Mon, 10 Oct 2011 15:18:00 GMT</pubDate><guid>http://www.blogjava.net/xiaohei/archive/2011/10/10/360916.html</guid><wfw:comment>http://www.blogjava.net/xiaohei/comments/360916.html</wfw:comment><comments>http://www.blogjava.net/xiaohei/archive/2011/10/10/360916.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaohei/comments/commentRss/360916.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaohei/services/trackbacks/360916.html</trackback:ping><description><![CDATA[<span style="color: #5b4631; font-family: simsun; font-size: 14px; line-height: 21px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>今天主要讲解了一下知识点：<br />&nbsp;<wbr>&nbsp;<wbr>JavaBean、javaBean规范、javaBean的动作、开发模式</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">先讲一下javaBean的作用，以及我们为什么要使用javabean？<br />&nbsp;<wbr>其实javabean的一个最主要的作用就是对数据进行一个封装，其次是增强代码的复用性、结构更清晰等。<br />在换句话说javabean他其实本身就是一个对象，之所以学习javabean的好处，就是让我们像操作对象一样进行操作数据。让代码变得更灵活、更简单。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">举个小小的例子：<br />&nbsp;<wbr>比如你做一个注册功能。首先呢我们是需要获取用户界面的信息。然后在获取进来的数据传给持久层，进行持久的时候大家有没有注意到，如果表单里面的数据少的话还可以，直接传入参数，而数据一旦超过10个数据，那么你可以想象一个你传入的参数，那该是多么的一大串，所以我们采取javabean的方式，把从页面上取来的信息把它存放到一个对象当中，那么我们在进行持久化传参的时候就只需要传入一个对象就OK。 这就是javabean的好处之一。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">JavaBean规范：<br />&nbsp;<wbr>一个javabean由四部分组成：<br />&nbsp;<wbr>&nbsp;<wbr>第一部分：javabean必须有一个无惨的构造方法。<br />&nbsp;<wbr>&nbsp;<wbr>第二部分：所有的属性必须都是private的。<br />&nbsp;<wbr>&nbsp;<wbr>第三部分：必须生成get/set方法。<br />&nbsp;<wbr>&nbsp;<wbr>第四部分:必须实现序列化(Serializable)这个接口。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">下面我呢针对上面这些javabean的规范做一个解释，以及为什么要定义这个规范?<br />&nbsp;<wbr>1:javabean为什么需要一个无惨的构造方法呢？<br />回答：这个无惨的构造方法的作用主要是针对反射。为什么会针对反射呢？大家知道使用反射实例化一个类，是实例化该类的一个无惨的构造方法。<br />&nbsp;<wbr>比如：<br />&nbsp;<wbr>&nbsp;<wbr>如果他是一个无惨的构造方法： Class.forName("com.lovo.User").newInstance.<br />&nbsp;<wbr>&nbsp;<wbr>如果他没有一个无惨的构造方法：Class c = Class.forName("com.lovo.User");<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;手动实例化他所有的公共的构造方法: Constructor[] con =&nbsp;<wbr>c.getConstructors()</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>2:javabean为什么所有的属性都是private的呢，为什么不可以是public的？<br />回答：private属性增强javabean安全性。他们的区别就是如果他的属性设置为public的话，我们可以任意的进行访问或修改(没有安全性)。而private属性为什么要通过get/set去访问这就是下面马上讲到的。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>3:javaBean的get/set方法。<br />回答：get/set方法也是增加代码的安全性。比如我们可以让外部只可以访问属性不能修改属性的话，那么我在这里只需要生成get方法就行了，无须生成set方法，而public就无法做到这一点。还有一个就是比如我们在设置他的age的时候我们还可以进行验证工作，比如如果你的age小于18，那么就直接跳出，不允许设置该属性。这个功能也是很强大的。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">举个小小列子：<br />&nbsp;<wbr>public void setAge(int age){<br />&nbsp;<wbr>//验证传入进来的age否大于18，如果小于就直接return,否则就添加到该对象的age属性中。<br />&nbsp;<wbr>&nbsp;<wbr>if(age&lt;18){<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>return;&nbsp;<wbr><br />&nbsp;<wbr>}<br />&nbsp;<wbr>this.age = age;<br />}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>4：实现serializable接口？<br />回答：为了实现远程调用。比如我们要把该JavaBean从一个操作系统中传输到另一台操作系统，我们就只有采取实现该接口。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">JavaBean的动作：<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&lt;!-- 创建user对象 --&gt;<br />&nbsp;<wbr>1： 创建动作:&nbsp;<wbr>&nbsp;&lt;jsp:useBean id="user" class="com.lovo.User" scope="request" /&gt;<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>id:一个变量名。可以任意取。<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>classs:指明变量的类型，也就是说具体描述的一个对象。包名加类名<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>scope:总用于范围。 也就是说在我们在查找一个属性值的时候，首先是从他的一个作用域中去进行查找，如果找到就直接把它输出，否则创建一个新的(null)。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&lt;!-- 设置user对象中的userName属性 单一属性。。--&gt;<br />&nbsp;<wbr>2:设置动作:&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;&lt;jsp:setProperty name="user" property="userName" value="222" param="123"/&gt;&nbsp;<wbr><br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>name:必须和创建动作的id一样。<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>property:具体的某一个属性值。<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>value:设置该属性的值。<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>param:是将请求到的值附加到userName属性中.<br />&nbsp;<wbr>&nbsp;<wbr><br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&lt;!-- 代表名字相同的自动填充。 如：<a href="http://localhost:8080/Huang_JavaBean/index.jsp?userName=444&amp;password=123" style="text-decoration: none; color: #6a5316; ">http://localhost:8080/Huang_JavaBean/index.jsp?userName=444&amp;password=123</a>--&gt;<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;&lt;jsp:setProperty name="user" property="*"&nbsp;<wbr>&nbsp;/&gt;&nbsp;<wbr><br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>name:必须和创建动作的id一样。<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>property:设置相同属性名的值他会自动填充。<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr><br />&nbsp;<wbr>3:输出动作：<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr><br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&lt;!-- 输出信息 。 相似于 out.println(user.getuserName()) --&gt;<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&lt;jsp:getProperty name="user" property="userName" /&gt;<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&lt;jsp:getProperty name="user" property = "password"/&gt;<br />开发模式：<br />&nbsp;<wbr>为什么进行分层的开发?<br />&nbsp;<wbr>&nbsp;<wbr>1：主要是为了并发性的开发项目。比如：你做持久层，我做业务层<br />&nbsp;<wbr>&nbsp;<wbr>2：可以独立的测试，每一个方法。<br />&nbsp;<wbr>&nbsp;<wbr>3:分层的开发的好处还有一个就是一处代码的改变不会影响到另一处代码的改变。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">在这里说一下servlet和jsp的一些缺陷.<br />&nbsp;<wbr>servlet的缺陷使web应用程序开发变得非常繁琐且不利于分工协作。<br />&nbsp;<wbr>jsp页面严重的缺乏代码的可读性而且没有将页面的表现和业务逻辑分开，使维护变得更加复杂。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">在这章讲到了两种开发模式：<br />&nbsp;<wbr>模式一：JSP+JavaBean<br />&nbsp;<wbr>模式二：JSP+Servlet+JavaBean</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">现在大多数情况下都不用模式一，所以我就解释了。<br />所谓的模式二就是现在比较流行的一个模式，也叫MVC模式。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">那么什么是MVC模式？</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;M(model)模型层，即完成业务功能部分,也要完成持久功能。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;V(view)视图层，用于客户端进行页面展现的部分,一般是jsp和html。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;C(controller)控制层，转么用于调用业务层，进行逻辑判断，看他跳入那个页面。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">MVC的一个最大的好处是实现了良好的松散耦合。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>&nbsp;PO(persistentobject)持久化对象，它通常是在分析系统需求时，外名词或名词短语中抽取出来(javaBan).</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>&nbsp;DAO(datebase access&nbsp;<wbr>&nbsp;object)数据库访问对象，用于对象关系映射时或对象持久化，他封装了所有的JDBC操作</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>&nbsp;BO(business&nbsp;<wbr>&nbsp;<wbr>&nbsp;Object)业务层对象，用于完成业务功能的类</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;<wbr>&nbsp;VO(value object)值对象，用于封装各层次间要传输的数据</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">&nbsp;</p></span><img src ="http://www.blogjava.net/xiaohei/aggbug/360916.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaohei/" target="_blank">Tomas</a> 2011-10-10 23:18 <a href="http://www.blogjava.net/xiaohei/archive/2011/10/10/360916.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>