<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Li Guoliang</title>
	<atom:link href="http://liguoliang.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://liguoliang.com</link>
	<description>Java · J2EE · Spring · Hibernate · Flex · ActionScript · Perl · PHP · Linux · Oracle</description>
	<lastBuildDate>Thu, 09 May 2013 16:19:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>JIRA: Select Estimate and Actually Spent (Logged) Hours</title>
		<link>http://liguoliang.com/2013/jira-select-estimate-and-actually-spent-logged-hours/</link>
		<comments>http://liguoliang.com/2013/jira-select-estimate-and-actually-spent-logged-hours/#comments</comments>
		<pubDate>Thu, 09 May 2013 13:24:00 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JIRA]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3286</guid>
		<description><![CDATA[SELECT TOP 20&#160;&#160;&#160; CAST((ji.TIMESPENT &#8211; TIMEORIGINALESTIMATE)/3600&#160; AS DECIMAL (6, 2)) AS [Diff(H)] ,&#160;&#160;&#160; CAST (ji.TIMEORIGINALESTIMATE/3600 AS DECIMAL (6,2)) AS [TIMEORIGINALESTIMATE(H)], &#160;&#160;&#160; CAST(ji.TIMESPENT/3600&#160; AS DECIMAL (6, 2)) AS [TIMESPENT(H)],&#160;&#160;&#160; Project.pname AS [ProjectName],&#160;&#160;&#160; * FROM jiraschema.jiraissue ji&#160; &#160;&#160;&#160; LEFT JOIN jiraschema.project Project &#8230;]]></description>
				<content:encoded><![CDATA[<p>SELECT TOP 20<br />&nbsp;&nbsp;&nbsp; CAST((ji.TIMESPENT &#8211; TIMEORIGINALESTIMATE)/3600&nbsp; AS DECIMAL (6, 2)) AS [Diff(H)] ,<br />&nbsp;&nbsp;&nbsp; CAST (ji.TIMEORIGINALESTIMATE/3600 AS DECIMAL (6,2)) AS [TIMEORIGINALESTIMATE(H)], <br />&nbsp;&nbsp;&nbsp; CAST(ji.TIMESPENT/3600&nbsp; AS DECIMAL (6, 2)) AS [TIMESPENT(H)],<br />&nbsp;&nbsp;&nbsp; Project.pname AS [ProjectName],<br />&nbsp;&nbsp;&nbsp; * <br />FROM jiraschema.jiraissue ji&nbsp; <br />&nbsp;&nbsp;&nbsp; LEFT JOIN jiraschema.project Project on ji.PROJECT = PROJECT.ID<br />ORDER BY (ji.TIMESPENT &#8211; TIMEORIGINALESTIMATE) desc</p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/jira-select-estimate-and-actually-spent-logged-hours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google I/O 2009 &#8211; The Myth of the Genius Programmer 技术大拿的传说</title>
		<link>http://liguoliang.com/2013/the-myth-of-the-genius-programmer/</link>
		<comments>http://liguoliang.com/2013/the-myth-of-the-genius-programmer/#comments</comments>
		<pubDate>Fri, 03 May 2013 16:19:06 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[软件工程]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3282</guid>
		<description><![CDATA[Fitz(Brian W. Fitzpatrick) 与 Ben(Ben Collins-Sussman) 是Google的两位技术大拿, 这是他们在09年Google IO上的演讲:https://www.youtube.com/watch?v=0SARbwvhupQ &#160; 摘录/翻译 一点我觉得挺有意思的部分: &#160; How many people in this room write code entirely by themselves only.&#160; Never with other people? or how many like writing code by yourself. 这是一个问题. 很少有人完全独立编程, 但有很多人希望能够独立编程; &#8230;]]></description>
				<content:encoded><![CDATA[<p>Fitz(<a href="http://research.google.com/pubs/author35663.html" target="_blank">Brian W. Fitzpatrick</a>) 与 Ben(<a href="http://research.google.com/pubs/author35664.html" target="_blank">Ben Collins-Sussman</a>) 是Google的两位技术大拿, 这是他们在09年Google IO上的演讲:<a href="https://www.youtube.com/watch?v=0SARbwvhupQ">https://www.youtube.com/watch?v=0SARbwvhupQ</a></p>
<p>&nbsp;</p>
<p>摘录/翻译 一点我觉得挺有意思的部分:</p>
<p>&nbsp;</p>
<ol>
<li>How many people in this room write code entirely by themselves only.&nbsp; Never with other people? or how many like writing code by yourself. <br />这是一个问题. 很少有人完全独立编程, 但有很多人希望能够独立编程;</li>
<li>How many people in this room do code reviews as part of development process?<br />多数人举手.&nbsp; 所以, 如果所在的团队没有code review, 是不是该考虑开始code review 或是离开?</li>
<li>Who is afraid of look stupid in front of people?<br />多数人都不希望在别人面前犯二.</li>
<li>Bus factor is the number of people on your software project that have to get hit by a bus that are gonna leave you in a world of hee.</li>
<li>Lose the ego 放低自己</li>
<li>Criticism is not Evil 批评不是恶魔</li>
<li>At Google, actually, we’re not allowed to submit code into our version control system until there’s code review<br />在Google, 在提交代码之前必须进行代码审查</li>
<li>When failure does happen, be ready for it, don’t freak out, document what happened, what did you learn from it? what are you going to do different next time? write it up and learn from it</li>
<li>Iterate Quickly: The faster you can fail and the faster you can iterate, the faster you can learn and get&nbsp; better. </li>
<li>Practice is Key</li>
<li>To be a small fish: If you were the senior developer on a team or in a company or something, and everyone looks to you and you’re sort of the teacher, or the king, queen whatever, if you’re only working with people junior to you, you are going to learn things from them, but it’s gonna be harder to improve your skills.<br />When you are a big fish in a pond, it’s very comfortable, but you’re not really learning very much. you feel safe, but you don’t get much better. and when you are a small fish in a huge pond, it’s very scary.</li>
<li>Be Influenced: the more that you’re open to the influence of other people, who might have a really good idea, </li>
<li>Be Vulnerable: If you can show yourself to be open to change and willing to admit mistake</li>
<li><strong>Case Study: Subversion<br /></strong>It started out with three guys in an office writing a design doc together, just the three of them. Took up maybe two weeks or three weeks, to actually get it right.&nbsp; two or three is best.&nbsp; If you travel with more than six people, you can’t go anywhere…<br />After we got design doc, we brought it to a larger forum, invited comments, put it up on a web site,&nbsp; and began to get feedback. and then we just started coding,&nbsp; amazingly, about a month or two later, we had some working, very basic working code, and suddenly, as soon as we had working code, suddenly all these people started showing up. we didn’t even advertise, but somehow, it was like we crossed the magic threshold. ( 9 years ago, it was only CVS)</li>
<li><a href="http://liguoliang.com/wp-content/uploads/2013/05/image3.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://liguoliang.com/wp-content/uploads/2013/05/image_thumb3.png" width="372" height="174"></a><br />If you do all these things, people will <strong>Think</strong> You’re a Genius.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/the-myth-of-the-genius-programmer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JIRA: How to get all issues related to a user 列出用户参与的所有条目</title>
		<link>http://liguoliang.com/2013/jira-how-to-get-all-issues-related-to-a-user/</link>
		<comments>http://liguoliang.com/2013/jira-how-to-get-all-issues-related-to-a-user/#comments</comments>
		<pubDate>Fri, 03 May 2013 04:02:05 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Group Ware]]></category>
		<category><![CDATA[JIRA]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3280</guid>
		<description><![CDATA[Requirement: Get all issues that the user has been involved in for example, A created new issue, assigned to B, B resolved the issue and assign back to A, A closed the issue.we need get this issue using &#8216;B&#8217; as &#8230;]]></description>
				<content:encoded><![CDATA[<h2>Requirement: Get all issues that the user has been involved in</h2>
<p>for example, A created new issue, assigned to B, B resolved the issue and assign back to A, A closed the issue.<br />we need get this issue using &#8216;B&#8217; as the filter.</p>
<h2>Solution: Use &#8220;Assignee was&#8221; filter</h2>
<p>Go to “Issue Navigator”, “Switch to advanced searching”,&nbsp; use this query:</p>
<p><code>
<p>assignee was "userID" </p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/jira-how-to-get-all-issues-related-to-a-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Code Quality Control Eclipse Plugins 代码质量控制Eclipse插件</title>
		<link>http://liguoliang.com/2013/java-code-quality-control-eclipse-plugins/</link>
		<comments>http://liguoliang.com/2013/java-code-quality-control-eclipse-plugins/#comments</comments>
		<pubDate>Thu, 02 May 2013 14:04:00 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[软件工程]]></category>
		<category><![CDATA[Clean Code]]></category>
		<category><![CDATA[Quality Control]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3277</guid>
		<description><![CDATA[Several Eclipse plugins which can help to improve code quality.  all plugs can find from Eclipse Market. 1.  FindBugs Find potential bugs for you.  “a program which uses static analysis to look for bugs in Java code” 2. eCobertura &#8220;eCobertura &#8230;]]></description>
				<content:encoded><![CDATA[<p>Several Eclipse plugins which can help to improve code quality.  all plugs can find from Eclipse Market.</p>
<h2>1.  FindBugs</h2>
<p>Find potential bugs for you.  “a program which uses static analysis to look for bugs in Java code<strong>”</strong></p>
<p><a href="http://liguoliang.com/wp-content/uploads/2013/05/image.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" alt="image" src="http://liguoliang.com/wp-content/uploads/2013/05/image_thumb.png" width="766" height="513" border="0" /></a></p>
<h2>2. eCobertura</h2>
<p>&#8220;eCobertura is a free Eclipse plugin for Cobertura &#8211; a Java code coverage reporting tool.&#8221;</p>
<p>With “eCobertura”, we can get an overview of code coverage within Eclipse.</p>
<p><a href="http://liguoliang.com/wp-content/uploads/2013/05/image1.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" alt="image" src="http://liguoliang.com/wp-content/uploads/2013/05/image_thumb1.png" width="768" height="478" border="0" /></a></p>
<p>BTW, This plugin hasn’t been updated for more than 2 years.</p>
<h4>How to clear the code coverage highlighting?<br />
Currently, no this feature (<a href="https://github.com/jmhofer/eCobertura/issues/8">https://github.com/jmhofer/eCobertura/issues/8</a>), but can reset by edit the java class.</h4>
<h2>3. CheckStyle</h2>
<p>Help developer to check the coding style, for example, coding conversation, make sure the code is clean and neat.</p>
<blockquote><p>Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard.</p></blockquote>
<p><a href="http://liguoliang.com/wp-content/uploads/2013/05/image2.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" alt="image" src="http://liguoliang.com/wp-content/uploads/2013/05/image_thumb2.png" width="836" height="479" border="0" /></a></p>
<p>&nbsp;</p>
<p>[to be continued]</p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/java-code-quality-control-eclipse-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server: Query Result Order by &#8216;IN&#8217; Conditions/Filter 按照IN条件排序</title>
		<link>http://liguoliang.com/2013/sql-server-query-result-order-by-in-conditionsfilter/</link>
		<comments>http://liguoliang.com/2013/sql-server-query-result-order-by-in-conditionsfilter/#comments</comments>
		<pubDate>Thu, 02 May 2013 04:12:55 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3269</guid>
		<description><![CDATA[Requirement: Select some data using &#8216;IN&#8217; clause, the result should keep the same order as the in conditions. Solution: Use CharIndex in Order by SELECT SECCODE, SECSNAME FROM SECURITY WHERE SECCODE IN&#160;&#160;&#160; ('1U68',&#160;&#160;&#160; '1F77')ORDER BY CharIndex(LTRIM(RTRIM([SECCODE])), '1U68, 1F77') In MySQL, &#8230;]]></description>
				<content:encoded><![CDATA[<h2>Requirement:</h2>
<p>Select some data using &#8216;IN&#8217; clause, the result should keep the same order as the in conditions.</p>
<h2>Solution: Use CharIndex in Order by</h2>
<p> <code>
<p>SELECT SECCODE, SECSNAME FROM SECURITY <br />WHERE SECCODE IN<br />&nbsp;&nbsp;&nbsp; ('1U68',<br />&nbsp;&nbsp;&nbsp; '1F77')<br />ORDER BY <br />CharIndex(LTRIM(RTRIM([SECCODE])), '1U68, 1F77')</p>
<p> </code>
<p>In MySQL, you can use &#8220;Order By Field()<br />http://www.electrictoolbox.com/mysql-order-specific-field-values/</p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/sql-server-query-result-order-by-in-conditionsfilter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Oracle Auto-Increment/Sequence in Hibernate/MyBatis</title>
		<link>http://liguoliang.com/2013/using-oracle-auto-incrementsequence-in-hibernatemybatis/</link>
		<comments>http://liguoliang.com/2013/using-oracle-auto-incrementsequence-in-hibernatemybatis/#comments</comments>
		<pubDate>Wed, 01 May 2013 15:41:04 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[MyBatis]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3267</guid>
		<description><![CDATA[(Hibernate) Error 1 : java.sql.SQLSyntaxErrorException: ORA-02289: sequence does not exist Solution: Specify the sequence: package com.liguoliang.jee.vo; /** * Represents Client. * @author Guoliang * */ @Entity @Table (name="Client") public class Client { @Id @Column(name="id") @SequenceGenerator(name="my_seq", sequenceName="CLIENT_ID_SEQUENCE") @GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="my_seq") &#8230;]]></description>
				<content:encoded><![CDATA[<h2>(Hibernate) Error 1 : java.sql.SQLSyntaxErrorException: ORA-02289: sequence does not exist</h2>
<h4>Solution:</h4>
<p>Specify the sequence:</p>
<pre class="java" name="code">package com.liguoliang.jee.vo;

/**
 * Represents Client.
 * @author Guoliang
 *
 */
@Entity
@Table (name="Client")
public class Client {
	
	@Id
	@Column(name="id")
	@SequenceGenerator(name="my_seq", sequenceName="CLIENT_ID_SEQUENCE")
	@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="my_seq")
	private int id;
	
	@Column(name="name")
	String name;
	
	public Client() {
		// TODO Auto-generated constructor stub
	}
//....

}

</pre>
<h2>(MyBatis) Error 2: java.sql.SQLException: Invalid column type: getInt not implemented for class oracle.jdbc.driver.T4CRowidAccessor</h2>
<p>Code before change:</p>
<pre class="java" name="code">	/**
	 * insert new client.
	 * @param client
	 */
	
	@Insert("INSERT INTO CLIENT(name) VALUES (#{name})")
	@Options(useGeneratedKeys=true, keyProperty="id")
	void insert(Client client);
</pre>
<h4>Solutions: </h4>
<p>1. Directly Remove @Options(useGeneratedKeys=true, keyProperty=&#8221;id&#8221;) </p>
<p>2. Replace @Options with @SelectKey: </p>
<pre class="java" name="code">	/**
	 * insert new client.
	 * @param client
	 */
	
	@Insert("INSERT INTO CLIENT(name) VALUES (#{name})")
	@SelectKey(
			keyProperty = "id",
			before = true,
			resultType = Integer.class,
			statement={" select CLIENT_ID_SEQUENCE.nextval AS id from dual"}
			)
	void insert(Client client);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/using-oracle-auto-incrementsequence-in-hibernatemybatis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven: modify the default JDK 修改Maven默认JDK</title>
		<link>http://liguoliang.com/2013/maven-modify-the-default-jdk-%e4%bf%ae%e6%94%b9maven%e9%bb%98%e8%ae%a4jdk/</link>
		<comments>http://liguoliang.com/2013/maven-modify-the-default-jdk-%e4%bf%ae%e6%94%b9maven%e9%bb%98%e8%ae%a4jdk/#comments</comments>
		<pubDate>Wed, 01 May 2013 03:18:14 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3266</guid>
		<description><![CDATA[I created a maven java project, and I want to use some new feature in Java7, but every time, after update the project, the JRE will be changed to 1.5 automatically. After googling, got the solution: configure maven-compiler-plugin: &#160; &#60;build&#62;&#160;&#160;&#160; &#8230;]]></description>
				<content:encoded><![CDATA[<p>I created a maven java project, and I want to use some new feature in Java7, but every time, after update the project, the JRE will be changed to 1.5 automatically. </p>
<p>After googling, got the solution: configure maven-compiler-plugin:</p>
<p><code>
<p>&nbsp; &lt;build&gt;<br />&nbsp;&nbsp;&nbsp; &lt;finalName&gt;J2EE&lt;/finalName&gt;<br />&nbsp;&nbsp;&nbsp; &lt;plugins&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;plugin&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;version&gt;2.1&lt;/version&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;configuration&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;source&gt;1.7&lt;/source&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;target&gt;1.7&lt;/target&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/configuration&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/plugin&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/plugins&gt;<br />&nbsp; &lt;/build&gt;</p>
<p></code>
<p>&nbsp;</p>
<p><a href="http://stackoverflow.com/questions/3539139/what-causes-a-new-maven-project-in-eclipse-to-use-java-1-5-instead-of-java-1-6-b">http://stackoverflow.com/questions/3539139/what-causes-a-new-maven-project-in-eclipse-to-use-java-1-5-instead-of-java-1-6-b</a></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/maven-modify-the-default-jdk-%e4%bf%ae%e6%94%b9maven%e9%bb%98%e8%ae%a4jdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 11 XE &amp; JDBC</title>
		<link>http://liguoliang.com/2013/oracle-11-xe-jdbc/</link>
		<comments>http://liguoliang.com/2013/oracle-11-xe-jdbc/#comments</comments>
		<pubDate>Tue, 30 Apr 2013 16:51:18 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3264</guid>
		<description><![CDATA[How to get Oracle 11 XE for Windows 64? Download the Oracle 11 XE 32 bit and install it. No problem for me ( Win7 64) Forgot the sys password, how to reset? Conn / as sysdba passw system input &#8230;]]></description>
				<content:encoded><![CDATA[<h2>How to get Oracle 11 XE for Windows 64?</h2>
<p>Download the Oracle 11 XE 32 bit and install it. </p>
<p>No problem for me ( Win7 64)</p>
<h2>Forgot the sys password, how to reset?</h2>
<p>Conn / as sysdba</p>
<p>passw system</p>
<p>input new password.</p>
<p>[<a href="http://rolfje.wordpress.com/2007/01/16/lost-oracle-sys-and-system-password/">http://rolfje.wordpress.com/2007/01/16/lost-oracle-sys-and-system-password/</a>]</p>
<h2>How to get the version of Oracle?</h2>
<p>select * from v$version</p>
<h2>How to Add Oracle JDBC Driver in Loacl Maven Repo?</h2>
<p><code>mvn install:install-file -Dfile=C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar</code> <br />then add modify your pom:</p>
<pre>&lt;dependency&gt;
	&lt;groupId&gt;com.oracle&lt;/groupId&gt;
	&lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
	&lt;version&gt;11.2.0&lt;/version&gt;
&lt;/dependency&gt;</pre>
<pre>[<a href="http://www.mkyong.com/maven/how-to-add-oracle-jdbc-driver-in-your-maven-local-repository/">http://www.mkyong.com/maven/how-to-add-oracle-jdbc-driver-in-your-maven-local-repository/</a>]</pre>
<h2>Quick test using JDBC</h2>
<pre class="java" name="code">	public static void main(String[] args) throws Throwable {
		
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection connection = null;
		connection = DriverManager.getConnection(
			"jdbc:oracle:thin:@localhost:1521:xe","root","root");
		System.out.println(connection.getMetaData().getDatabaseMajorVersion());
		connection.close();
	}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/oracle-11-xe-jdbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update Log4j Appender at runtime</title>
		<link>http://liguoliang.com/2013/update-log4j-appender-at-runtime/</link>
		<comments>http://liguoliang.com/2013/update-log4j-appender-at-runtime/#comments</comments>
		<pubDate>Wed, 17 Apr 2013 10:20:55 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Log4j]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3262</guid>
		<description><![CDATA[import java.io.IOException; import org.apache.log4j.FileAppender; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; /** * Test for adding appender to log4j at runtime. * @author SGSCLGLD * */ public class LogingTest { static Logger log = Logger.getLogger(LogingTest.class); public static void main(String[] args) throws IOException { &#8230;]]></description>
				<content:encoded><![CDATA[<pre class="java" name="code">
import java.io.IOException;

import org.apache.log4j.FileAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;

/**
 * Test for adding appender to log4j at runtime.
 * @author SGSCLGLD
 *
 */
public class LogingTest {
	
	static Logger log = Logger.getLogger(LogingTest.class);
	
	public static void main(String[] args) throws IOException {
		// setting up a FileAppender at runtime.
		PatternLayout patternLayout = new PatternLayout();
		patternLayout.setConversionPattern("[%d{d/M/yyyy HH:mm:ss}] %p [%t] %c{1}.%M(%L) | %m%n");
		FileAppender appender = new FileAppender(patternLayout,"D:\\ME\\WS_Share\\test1\\log.txt",false);    
		log.addAppender(appender);
		
		log.info("Hello world...");
	}
}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/update-log4j-appender-at-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java RSA Key Generation/Encryption/Decryption RSA秘钥生成/加密/解密</title>
		<link>http://liguoliang.com/2013/java-rsa-key-generationencryptiondecryption-rsa/</link>
		<comments>http://liguoliang.com/2013/java-rsa-key-generationencryptiondecryption-rsa/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 16:17:58 +0000</pubDate>
		<dc:creator>Li Guoliang</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Java Security]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=3256</guid>
		<description><![CDATA[Requirement: Generate RSA key pair using Java,&#160; and test encryption/decryption. Source code: package com.rsa; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PrivateKey; import java.security.PublicKey; import javax.crypto.Cipher; public class RSATest { /** * Generate key pair and encrypt/decrypt message. * @param args * &#8230;]]></description>
				<content:encoded><![CDATA[<h4>Requirement: </h4>
<p>Generate RSA key pair using Java,&nbsp; and test encryption/decryption.</p>
<h4>Source code:</h4>
<pre class="java" name="code">package com.rsa;

import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;

import javax.crypto.Cipher;

public class RSATest {

	/**
	 * Generate key pair and encrypt/decrypt message.
	 * @param args
	 * @throws Throwable
	 */
	public static void main(String[] args) throws Throwable {

		String str = "liguoliang.com";
		
		// init private/public key
		KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
		keyGen.initialize(512);
		KeyPair keyPair = keyGen.generateKeyPair();
		PrivateKey privateKey = keyPair.getPrivate();
		PublicKey publicKey = keyPair.getPublic();

		System.out.println("privateKey: " + privateKey);
		System.out.println("PublicKey: " + publicKey);

		System.out.println("Original message: [" + str + "]");
		
		// init cipher
		Cipher cipher;
		cipher = Cipher.getInstance("RSA");
		
		// Encrypt
		cipher.init(Cipher.ENCRYPT_MODE, publicKey);
		byte[] encryptedMsg = cipher.doFinal(str.getBytes());
		System.out.println("Encrypted message: [" + new String(encryptedMsg) + "]");

		// Decrypt
		cipher.init(Cipher.DECRYPT_MODE, privateKey);
		byte[] decryptedMsg = cipher.doFinal(encryptedMsg);
		System.out.println("Decrypted message: [" + new String(decryptedMsg) + "]");
	}
}

</pre>
<h4>Output:</h4>
<p><code></p>
<p>privateKey: Sun RSA private CRT key, 512 bits<br />&nbsp; modulus:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6722431852833652083740039<br />&nbsp; public exponent:&nbsp; 65537<br />&nbsp; private exponent: 171186757391917267536..695551529001<br />&nbsp; prime p:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9879891158983359366387147661330…7700131643<br />&nbsp; prime q:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 680415577930859..89085598145526159671701009583973<br />&nbsp; prime exponent p: 320741816528876..9797652301875289<br />&nbsp; prime exponent q: 1025757344699..140192255455019921532401<br />&nbsp; crt coefficient:&nbsp; 60972956628933..8290909983925983303<br />PublicKey: Sun RSA public key, 512 bits<br />&nbsp; modulus: 672243185283365208374001..<br />&nbsp; public exponent: 65537<br />Original message: [liguoliang.com]<br />Encrypted message: ['ËŸò¬Œ÷Já°`ð«6L´aZ0Ž¶¹mçZaÐvCóG%P&nbsp;&nbsp;&nbsp; ƒtÂÌÖ9ØùýY,vÎ`¦Y»ù&nbsp;&nbsp;&nbsp; h]<br />Decrypted message: [liguoliang.com]</p>
<p></code></p>
<h4>Reference</h4>
<p>RSA Encryption in Java &#8211; <a href="http://tspycher.com/2012/10/rsa-encryption-in-java/">http://tspycher.com/2012/10/rsa-encryption-in-java/</a></p>
<p>用实例给新手讲解RSA加密算法 &#8211; <a href="http://bank.hexun.com/2009-06-24/118958531.html">http://bank.hexun.com/2009-06-24/118958531.html</a></p>
<p><a href="http://introcs.cs.princeton.edu/java/78crypto/RSA.java.html">http://introcs.cs.princeton.edu/java/78crypto/RSA.java.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2013/java-rsa-key-generationencryptiondecryption-rsa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.218 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-20 18:57:38 -->
