<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>AnySQL.net</title>
	
	<link>http://www.anysql.net</link>
	<description>Oracle DBA,MySQL DBA, 数据恢复, 数据迁移, 报表软件, 性能优化, 系统监控</description>
	<lastBuildDate>Mon, 08 Feb 2010 07:23:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AnySQL" /><feedburner:info uri="anysql" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><image><link>http://www.anysql.net</link><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url><title>AnySQL.net</title></image><feedburner:emailServiceId>AnySQL</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
		<title>SQLULDR2也可改善用户体验</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/bk_DvFHk9fw/sqluldr2-form-display.html</link>
		<comments>http://www.anysql.net/tools/sqluldr2-form-display.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 07:13:32 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[SQLLDR]]></category>
		<category><![CDATA[Text]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=739</guid>
		<description><![CDATA[&#160; &#160; 做DBA要经常为其他人员查询一些数据, 有些记录的字段数很多, 用SQLPLUS直接出结果时, 很难对得整齐, 因此没有什么用户体验, 会被内部人员投诉, 外部用户的体验关系着企业的业绩, 内部员工的体验关系到工作的满意度. 

&#160; &#160; Spool的结果的确很乱, 在Yong Huang提议在AnySQL中加入MySQL按列显示功能后, 就在文本导出工具中也加入了这个功能, 第一版本的ociuldr使用如下参数. 


ociuldr form=yes ...


&#160; &#160; 第二版的文本导出工具也有这个功能, 只是SQLULDR2中需要设置三个选项才行. 


$sqluldr2 scott/tiger query=emp colsep=0x20:0x20 field=0x0a record=0x0a0x0a file=-

EMPNO&#160; &#160; : 7369
ENAME&#160; &#160; : SMITH
JOB&#160; &#160; &#160; : CLERK
MGR&#160; &#160; &#160; : 7902
HIREDATE : 1980-12-17 00:00:00
SAL&#160; &#160; &#160; : 800
COMM&#160; &#160;  :
DEPTNO&#160;  [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 做DBA要经常为其他人员查询一些数据, 有些记录的字段数很多, 用SQLPLUS直接出结果时, 很难对得整齐, 因此没有什么用户体验, 会被内部人员投诉, 外部用户的体验关系着企业的业绩, 内部员工的体验关系到工作的满意度. </p>

<p>&nbsp; &nbsp; Spool的结果的确很乱, 在Yong Huang提议在AnySQL中加入MySQL<a href="http://www.anysql.net/anysql/anysql_form_display.html">按列显示</a>功能后, 就在文本导出工具中也加入了这个功能, 第一版本的ociuldr使用如下参数. </p>

<blockquote class="prefont">
ociuldr form=yes ...
</blockquote>

<p>&nbsp; &nbsp; 第二版的文本导出工具也有这个功能, 只是SQLULDR2中需要设置三个选项才行. </p>

<blockquote class="prefont">
$sqluldr2 scott/tiger query=emp colsep=0x20:0x20 field=0x0a record=0x0a0x0a file=-<br />
<br />
EMPNO&nbsp; &nbsp; : 7369<br />
ENAME&nbsp; &nbsp; : SMITH<br />
JOB&nbsp; &nbsp; &nbsp; : CLERK<br />
MGR&nbsp; &nbsp; &nbsp; : 7902<br />
HIREDATE : 1980-12-17 00:00:00<br />
SAL&nbsp; &nbsp; &nbsp; : 800<br />
COMM&nbsp; &nbsp;  :<br />
DEPTNO&nbsp;  : 20<br />
<br />
EMPNO&nbsp; &nbsp; : 7499<br />
ENAME&nbsp; &nbsp; : ALLEN<br />
JOB&nbsp; &nbsp; &nbsp; : SALESMAN<br />
MGR&nbsp; &nbsp; &nbsp; : 7698<br />
HIREDATE : 1981-02-20 00:00:00<br />
SAL&nbsp; &nbsp; &nbsp; : 1600<br />
COMM&nbsp; &nbsp;  : 300<br />
DEPTNO&nbsp;  : 30<br />
......
</blockquote>

<p>&nbsp; &nbsp; 能用SQLULDR2来改善用户体验, 真是当初意想不到的事情. </p>

<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/15 -- <a href="http://www.anysql.net/tools/sqluldr2-create-table-syntax.html" title="两个用户的SQLULDR2需求">两个用户的SQLULDR2需求</a> (1)</li><li>2009/12/25 -- <a href="http://www.anysql.net/tools/sqluldr2-column-separator-option.html" title="SQLULDR2的按列文本输出">SQLULDR2的按列文本输出</a> (0)</li><li>2009/12/25 -- <a href="http://www.anysql.net/tools/sqluldr2-customized-escape-chars.html" title="SQLULDR2的自定义转义符处理">SQLULDR2的自定义转义符处理</a> (2)</li><li>2009/10/27 -- <a href="http://www.anysql.net/tools/sqluldr2-more-escape-chars.html" title="将SQLULDR2转义符进行到底">将SQLULDR2转义符进行到底</a> (3)</li><li>2009/10/26 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-escape-char.html" title="SQLULDR2处理MySQL转义符">SQLULDR2处理MySQL转义符</a> (1)</li><li>2009/08/31 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-null-value.html" title="SQLULDR2处理MySQL的空值">SQLULDR2处理MySQL的空值</a> (2)</li><li>2009/04/02 -- <a href="http://www.anysql.net/tools/sqluldr2_license.html" title="给SQLULDR2加上Key保护">给SQLULDR2加上Key保护</a> (6)</li><li>2008/01/25 -- <a href="http://www.anysql.net/tools/ociuldr_update_20080125.html" title="ociuldr更新(2008/01/25)">ociuldr更新(2008/01/25)</a> (13)</li><li>2007/08/22 -- <a href="http://www.anysql.net/tools/ociuldr_option_array.html" title="ociuldr的更新, 为了更好的long类型支持">ociuldr的更新, 为了更好的long类型支持</a> (1)</li><li>2007/01/02 -- <a href="http://www.anysql.net/tools/ociuldr_bind_variable.html" title="在ociuldr的SQL中使用绑定变量">在ociuldr的SQL中使用绑定变量</a> (4)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=bk_DvFHk9fw:Vhxfa9WS6p8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=bk_DvFHk9fw:Vhxfa9WS6p8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=bk_DvFHk9fw:Vhxfa9WS6p8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=bk_DvFHk9fw:Vhxfa9WS6p8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=bk_DvFHk9fw:Vhxfa9WS6p8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=bk_DvFHk9fw:Vhxfa9WS6p8:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/bk_DvFHk9fw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/sqluldr2-form-display.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/sqluldr2-form-display.html</feedburner:origLink></item>
		<item>
		<title>DataReport的Form格式显示</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/Vh-tmG_-KOs/webchart-form-data-display.html</link>
		<comments>http://www.anysql.net/tools/webchart-form-data-display.html#comments</comments>
		<pubDate>Thu, 04 Feb 2010 06:11:45 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[WebCh]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=738</guid>
		<description><![CDATA[&#160; &#160; 一直以来, DataReport都是用表格方式显示多行数据, 当我们查询少量字段数很多的记录时, 就不希望以表格方式显示记录, 而希望以Form格式显示, 如下面显示的员工表的信息. 







EMPNO7782


ENAMECLARK


JOBMANAGER


MGR7839


HIREDATE1981-06-09 00:00:00.0


SAL2450


COMM&#160;


DEPTNO10







EMPNO7839


ENAMEKING


JOBPRESIDENT


MGR&#160;


HIREDATE1981-11-17 00:00:00.0


SAL5000


COMM&#160;


DEPTNO10




&#160; &#160; 实现这个功能, 并没有修改任何一行代码, 只是改了一下控制显示格式的XSL文件, 然后在报表定义文件中加入一行. 


WEBCHART.XMLATTR=form="yes"
WEBCHART.QUERY_1=SELECT * FROM EMP WHERE DEPTNO=10


&#160; &#160; 想要更丰富的格式, 只需要再改进一下XSL文件即可, 不需要修改Java代码, 不过这需要你对XML和XSLT比较熟悉. 


Relative Posts:2010/01/20 -- 逻辑连接层与物理连接层 (3)2010/01/08 -- DataReport中的超级表达式 (0)2010/01/08 -- DataReport的重复值合并 (0)2010/01/05 -- DataReport中的FORALL循环 (0)2009/12/29 -- DataReport中的Cache为王 (4)2009/12/28 -- 统一DataReport的Servlet (2)2009/12/02 -- 添加URL/HTML字符转义功能 (1)2009/09/21 -- 多支持了四种业务图 (0)2009/07/28 -- DataReport增加JfreeChart支持 [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 一直以来, DataReport都是用表格方式显示多行数据, 当我们查询少量字段数很多的记录时, 就不希望以表格方式显示记录, 而希望以Form格式显示, 如下面显示的员工表的信息. </p>

<blockquote>
<table border="1" width="510" cellspacing="0" cellpadding="2">
<caption align="center">
<font size="5"></font>
</caption>
<tr>
<td width="20%" align="center">EMPNO</td><td>7782</td>
</tr>
<tr>
<td width="20%" align="center">ENAME</td><td>CLARK</td>
</tr>
<tr>
<td width="20%" align="center">JOB</td><td>MANAGER</td>
</tr>
<tr>
<td width="20%" align="center">MGR</td><td>7839</td>
</tr>
<tr>
<td width="20%" align="center">HIREDATE</td><td>1981-06-09 00:00:00.0</td>
</tr>
<tr>
<td width="20%" align="center">SAL</td><td>2450</td>
</tr>
<tr>
<td width="20%" align="center">COMM</td><td>&nbsp;</td>
</tr>
<tr>
<td width="20%" align="center">DEPTNO</td><td>10</td>
</tr>
<tr>
<td colspan="2" align="center">
<br>
</td>
</tr>
<tr>
<td width="20%" align="center">EMPNO</td><td>7839</td>
</tr>
<tr>
<td width="20%" align="center">ENAME</td><td>KING</td>
</tr>
<tr>
<td width="20%" align="center">JOB</td><td>PRESIDENT</td>
</tr>
<tr>
<td width="20%" align="center">MGR</td><td>&nbsp;</td>
</tr>
<tr>
<td width="20%" align="center">HIREDATE</td><td>1981-11-17 00:00:00.0</td>
</tr>
<tr>
<td width="20%" align="center">SAL</td><td>5000</td>
</tr>
<tr>
<td width="20%" align="center">COMM</td><td>&nbsp;</td>
</tr>
<tr>
<td width="20%" align="center">DEPTNO</td><td>10</td>
</tr>
</table>
</blockquote>

<p>&nbsp; &nbsp; 实现这个功能, 并没有修改任何一行代码, 只是改了一下控制显示格式的<a href="http://www.anysql.net/doc/default.xsl">XSL文件</a>, 然后在报表定义文件中加入一行. </p>

<blockquote class="prefont">
WEBCHART.XMLATTR=form="yes"<br />
WEBCHART.QUERY_1=SELECT * FROM EMP WHERE DEPTNO=10
</blockquote>

<p>&nbsp; &nbsp; 想要更丰富的格式, 只需要再改进一下XSL文件即可, 不需要修改Java代码, 不过这需要你对XML和XSLT比较熟悉. </p>


<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" title="逻辑连接层与物理连接层">逻辑连接层与物理连接层</a> (3)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-super-expression.html" title="DataReport中的超级表达式">DataReport中的超级表达式</a> (0)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" title="DataReport的重复值合并">DataReport的重复值合并</a> (0)</li><li>2010/01/05 -- <a href="http://www.anysql.net/tools/webchart-forall-loop.html" title="DataReport中的FORALL循环">DataReport中的FORALL循环</a> (0)</li><li>2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" title="DataReport中的Cache为王">DataReport中的Cache为王</a> (4)</li><li>2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" title="统一DataReport的Servlet">统一DataReport的Servlet</a> (2)</li><li>2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" title="添加URL/HTML字符转义功能">添加URL/HTML字符转义功能</a> (1)</li><li>2009/09/21 -- <a href="http://www.anysql.net/tools/four-extra-businees-charts.html" title="多支持了四种业务图">多支持了四种业务图</a> (0)</li><li>2009/07/28 -- <a href="http://www.anysql.net/tools/webchart-jfreechart-support.html" title="DataReport增加JfreeChart支持">DataReport增加JfreeChart支持</a> (7)</li><li>2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" title="DataReport的图片服务功能">DataReport的图片服务功能</a> (0)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vh-tmG_-KOs:dln8JGwSymI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vh-tmG_-KOs:dln8JGwSymI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vh-tmG_-KOs:dln8JGwSymI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=Vh-tmG_-KOs:dln8JGwSymI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vh-tmG_-KOs:dln8JGwSymI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vh-tmG_-KOs:dln8JGwSymI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/Vh-tmG_-KOs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-form-data-display.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-form-data-display.html</feedburner:origLink></item>
		<item>
		<title>谈谈历史遗留问题</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/QQh2NtJ3rhk/history-problems.html</link>
		<comments>http://www.anysql.net/life/history-problems.html#comments</comments>
		<pubDate>Thu, 28 Jan 2010 12:16:37 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=737</guid>
		<description><![CDATA[&#160; &#160; 首先要承认有历史遗留问题是好事, 因为这一般是在事物新生期被忽略的细节上的问题, 而且往往是因为事物起始时高度关注与追求高速发展, 与解决细节问题之间的时间和资源上的冲突, 就IT系统来讲, 历史遗留问题越多, 表明当初发展的速度越快, 因为一开始资源上也显不足. 先要在心里承认历史遗留问题的正常性, 不出问题时大家都容易理解, 但要是出了问题, 心中不一定能容忍历史遗留问题的客观性. 

&#160; &#160; 除了时间和资源外, 在当时的条件下, 解决新生期的细节上的问题是入不付出的, 并且事物不会因为这个细节上的问题, 而导致当时的失败, 甚至可能什么都表现不出来, 相当长的一段时间内都会隐藏得很好, 除了当时事物的制造者可能知道外, 不是所有的细节上的问题在形成之初就是已知的, 都认为这是一个十分完美的事物. 

&#160; &#160; 虽然不是所有的细节上的问题在形成之初就是已知的, 但有很多应当是已知的, 只是这个细节上的问题, 在传承上出了问题, 事物可能前后经由多个人进行修改与完善, 前面已经感觉到的问题, 如果没有有效地交托给下一个, 就隐藏了, 没被隐藏的一般都是比较大的问题, 不会成为历史遗留问题. 

&#160; &#160; 历史遗留问题的发现一般都是由于事故, 量变引起质变, 在量没有到达之前, 不会形成事故, 不会有让人感觉到难过的严重危害. 拿IT系统来说, 用户数的增长, 业务的增长, 数据量的极速增长, 到一定的量后, 才会发现当初被忽略的细节现在都成了头痛的问题, 成了历史遗留问题, 不满意的用户绝对数量在增加. 在用户的心目中, 事物应当变得越来越完善, [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 首先要承认有历史遗留问题是好事, 因为这一般是在事物新生期被忽略的细节上的问题, 而且往往是因为事物起始时高度关注与追求高速发展, 与解决细节问题之间的时间和资源上的冲突, 就IT系统来讲, 历史遗留问题越多, 表明当初发展的速度越快, 因为一开始资源上也显不足. 先要在心里承认历史遗留问题的正常性, 不出问题时大家都容易理解, 但要是出了问题, 心中不一定能容忍历史遗留问题的客观性. </p>

<p>&nbsp; &nbsp; 除了时间和资源外, 在当时的条件下, 解决新生期的细节上的问题是入不付出的, 并且事物不会因为这个细节上的问题, 而导致当时的失败, 甚至可能什么都表现不出来, 相当长的一段时间内都会隐藏得很好, 除了当时事物的制造者可能知道外, 不是所有的细节上的问题在形成之初就是已知的, 都认为这是一个十分完美的事物. </p>

<p>&nbsp; &nbsp; 虽然不是所有的细节上的问题在形成之初就是已知的, 但有很多应当是已知的, 只是这个细节上的问题, 在传承上出了问题, 事物可能前后经由多个人进行修改与完善, 前面已经感觉到的问题, 如果没有有效地交托给下一个, 就隐藏了, 没被隐藏的一般都是比较大的问题, 不会成为历史遗留问题. </p>

<p>&nbsp; &nbsp; 历史遗留问题的发现一般都是由于事故, 量变引起质变, 在量没有到达之前, 不会形成事故, 不会有让人感觉到难过的严重危害. 拿IT系统来说, 用户数的增长, 业务的增长, 数据量的极速增长, 到一定的量后, 才会发现当初被忽略的细节现在都成了头痛的问题, 成了历史遗留问题, 不满意的用户绝对数量在增加. 在用户的心目中, 事物应当变得越来越完善, 但当发现没有变化时, 变得越来越失望, 为什么当初没造成用户体验问题, 现在却造成了用户体验问题, 当时用得好好的, 什么也没有变, 就变成了问题很多的事物了. 看来对既有事物的完善速度必须要超过社会发展的速度, 才不会引起用户体验问题. </p>

<p>&nbsp; &nbsp; 一个历史遗留问题的爆发, 往往会引出更多的历史遗留问题, 站在今天的时间点回首看去, 会发现一个一个的黑洞, 从而引生出放弃旧事物, 开发新事物的想法, 并且很容易取得一致的共识, 大量的历史遗留问题是很难解决的, 重新做一个要比改造来得更快更好. 另外此时彼时物虽是人已非, 每个人都不想去修复历史遗留问题, 因为长期的积累, 这些问题已经变得很难处理, 处理好了只是个小功劳, 处理不好就是大问题. <p>

<p>&nbsp; &nbsp; 有部份的历史遗留问题一定是通过创建新事物来解决的, 也有一些必须通过修复来解决的, 当你偏向于某一方时, 就会在一定的时间段内引起一定的问题, 问题在于你能否支撑过这段青黄不接的时期. </p>

<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/04 -- <a href="http://www.anysql.net/life/my-first-book-content.html" title="最近在整理的几篇文档">最近在整理的几篇文档</a> (2)</li><li>2009/09/11 -- <a href="http://www.anysql.net/dba/where-is-dba-future.html" title="DBA有什么个人前途?">DBA有什么个人前途?</a> (17)</li><li>2009/09/08 -- <a href="http://www.anysql.net/life/why-we-buy-apartment.html" title="因丈母娘的需求而买房?">因丈母娘的需求而买房?</a> (5)</li><li>2009/09/03 -- <a href="http://www.anysql.net/life/build-online-trade-credit.html" title="收费有助于网购信用">收费有助于网购信用</a> (1)</li><li>2009/08/25 -- <a href="http://www.anysql.net/dba/dba-experience-growth.html" title="关于技术积累的几点想法">关于技术积累的几点想法</a> (5)</li><li>2009/08/17 -- <a href="http://www.anysql.net/life/create-dba-extra-values.html" title="努力创造DBA额外价值">努力创造DBA额外价值</a> (27)</li><li>2009/08/12 -- <a href="http://www.anysql.net/life/with-value-based-life.html" title="个人价值决定个人回报">个人价值决定个人回报</a> (13)</li><li>2009/08/04 -- <a href="http://www.anysql.net/dba/dba-most-important-things.html" title="DBA最缺的不是技术">DBA最缺的不是技术</a> (8)</li><li>2009/08/02 -- <a href="http://www.anysql.net/life/harder-work-than-dba.html" title="当群众演员比干DBA还累">当群众演员比干DBA还累</a> (9)</li><li>2009/07/29 -- <a href="http://www.anysql.net/dba/how-dns-work-for-us.html" title="域名解释与行人问路">域名解释与行人问路</a> (2)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=QQh2NtJ3rhk:qVA3yNyoCpk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=QQh2NtJ3rhk:qVA3yNyoCpk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=QQh2NtJ3rhk:qVA3yNyoCpk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=QQh2NtJ3rhk:qVA3yNyoCpk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=QQh2NtJ3rhk:qVA3yNyoCpk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=QQh2NtJ3rhk:qVA3yNyoCpk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/QQh2NtJ3rhk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/life/history-problems.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.anysql.net/life/history-problems.html</feedburner:origLink></item>
		<item>
		<title>逻辑连接层与物理连接层(2)</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/E-32LwusiAc/webchart-logical-dbaccess2.html</link>
		<comments>http://www.anysql.net/tools/webchart-logical-dbaccess2.html#comments</comments>
		<pubDate>Tue, 26 Jan 2010 12:11:19 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=735</guid>
		<description><![CDATA[&#160; &#160; 上一次只想到了逻辑逻辑层和物理连接层之间的三种关系, 等价(FIRST), 随机(RANDOM), 顺序(FAILOVER). 其实后面一直在思考, 阅读了一些相关文章, 糊思乱想了一通后, 又增加了两种访问方式. 

&#160; &#160; 按位置(POSITION)访问, 指程序提供一个标识位置的数, 然后与逻辑连接层的连接源数目进行取余操作, 根据余数来获取指定位置的数据源. 继续上一次中的四个MySQL的例子, 我们创建如下逻辑连接, 在访问时如果提供的值是5, 则最后取到的是5余4的位置, 即SLAVE1. 


LOGICAL.DEFAULT=POSITION&#124;MASTER,SLAVE1,SLAVE2,SLAVE3


&#160; &#160; 按范围(RANGE)访问, 指程序提供一个标识位置的数, 然后与逻辑连接层的连接数据源进行比较操作, 按顺序找到指定位置的数据源. 继续上一次中的四个MySQL的例子, 我们创建如下逻辑连接, 在访问时如果提供的值是250, 则最后取到的是小于300的位置, 即SLAVE2. 同前面的按位置相比, 这个可以在增减数据源时, 将影响控制得更好.


LOGICAL.DEFAULT=POSITION&#124;MASTER,SLAVE1,SLAVE2,SLAVE3
LOGICAL.DEFAULT.VALUES=100,200,300,400


&#160; &#160; 在程序中, 可以根据业务特色提供这个标识位置的数, 然后在JDBC的访问URL中提供这个值, 访问代码如下所示. 


try {
&#160; Connection db = DriverManager.getConnection("jdbc:anysql:default/250", null);
&#160; ......
&#160; db.close();
}
catch (SQLException sqle) 
{
&#160; ......
}


&#160; &#160; 接下来当然还会思考有没有新的方式了, [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html">上一次</a>只想到了逻辑逻辑层和物理连接层之间的三种关系, 等价(FIRST), 随机(RANDOM), 顺序(FAILOVER). 其实后面一直在思考, 阅读了一些相关文章, 糊思乱想了一通后, 又增加了两种访问方式. </p>

<p>&nbsp; &nbsp; 按位置(POSITION)访问, 指程序提供一个标识位置的数, 然后与逻辑连接层的连接源数目进行取余操作, 根据余数来获取指定位置的数据源. 继续上一次中的四个MySQL的例子, 我们创建如下逻辑连接, 在访问时如果提供的值是5, 则最后取到的是5余4的位置, 即SLAVE1. </p>

<blockquote class="prefont">
LOGICAL.DEFAULT=POSITION|MASTER,SLAVE1,SLAVE2,SLAVE3
</blockquote>

<p>&nbsp; &nbsp; 按范围(RANGE)访问, 指程序提供一个标识位置的数, 然后与逻辑连接层的连接数据源进行比较操作, 按顺序找到指定位置的数据源. 继续上一次中的四个MySQL的例子, 我们创建如下逻辑连接, 在访问时如果提供的值是250, 则最后取到的是小于300的位置, 即SLAVE2. 同前面的按位置相比, 这个可以在增减数据源时, 将影响控制得更好.</p>

<blockquote class="prefont">
LOGICAL.DEFAULT=POSITION|MASTER,SLAVE1,SLAVE2,SLAVE3<br />
LOGICAL.DEFAULT.VALUES=100,200,300,400
</blockquote>

<p>&nbsp; &nbsp; 在程序中, 可以根据业务特色提供这个标识位置的数, 然后在JDBC的访问URL中提供这个值, 访问代码如下所示. </p>

<blockquote class="prefont">
try {<br />
&nbsp; Connection db = DriverManager.getConnection("jdbc:anysql:default/250", null);<br />
&nbsp; ......<br />
&nbsp; db.close();<br />
}<br />
catch (SQLException sqle) <br />
{<br />
&nbsp; ......<br />
}<br />
</blockquote>

<p>&nbsp; &nbsp; 接下来当然还会思考有没有新的方式了, 有了这些访问方式, 进一步抽像一下, 可以看看能不能将数据库当成一个磁盘(Database as Disk)来看, 写一个弱弱的DatabaseRaid类在实验室玩玩数据冗余. </p><h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/05 -- <a href="http://www.anysql.net/tools/webchart-forall-loop.html" title="DataReport中的FORALL循环">DataReport中的FORALL循环</a> (0)</li><li>2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" title="逻辑连接层与物理连接层">逻辑连接层与物理连接层</a> (3)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-super-expression.html" title="DataReport中的超级表达式">DataReport中的超级表达式</a> (0)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" title="DataReport的重复值合并">DataReport的重复值合并</a> (0)</li><li>2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" title="DataReport中的Cache为王">DataReport中的Cache为王</a> (4)</li><li>2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" title="统一DataReport的Servlet">统一DataReport的Servlet</a> (2)</li><li>2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" title="添加URL/HTML字符转义功能">添加URL/HTML字符转义功能</a> (1)</li><li>2009/09/21 -- <a href="http://www.anysql.net/tools/four-extra-businees-charts.html" title="多支持了四种业务图">多支持了四种业务图</a> (0)</li><li>2009/07/28 -- <a href="http://www.anysql.net/tools/webchart-jfreechart-support.html" title="DataReport增加JfreeChart支持">DataReport增加JfreeChart支持</a> (7)</li><li>2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" title="DataReport的图片服务功能">DataReport的图片服务功能</a> (0)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=E-32LwusiAc:gh2OUWf7Qj0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=E-32LwusiAc:gh2OUWf7Qj0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=E-32LwusiAc:gh2OUWf7Qj0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=E-32LwusiAc:gh2OUWf7Qj0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=E-32LwusiAc:gh2OUWf7Qj0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=E-32LwusiAc:gh2OUWf7Qj0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/E-32LwusiAc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-logical-dbaccess2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-logical-dbaccess2.html</feedburner:origLink></item>
		<item>
		<title>AnySQL JDBC Driver</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/Vb_nk18Qfik/anysql-jdbc-driver.html</link>
		<comments>http://www.anysql.net/tools/anysql-jdbc-driver.html#comments</comments>
		<pubDate>Thu, 21 Jan 2010 07:55:43 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=734</guid>
		<description><![CDATA[&#160; &#160; 上一篇中的逻辑连接层, 通过一个DBLogicalManager类来实现, 并不是标准的JDBC调用方式, 如果要使现有的程序能很快用上这个功能, 要么更改程序, 要么就去实现一个JDBC Driver类, 让程序透明化. 显然第二种方法很好, 于是就写一个AnySQL JDBC Driver类吧. 

&#160; &#160; JDBC Driver的类名为: 


com.lfx.db.AnySQLDriver


&#160; &#160; 使用这个类时, 需要传入一个保存连接配置信息(逻辑库, 物理库)的文件, 只要创建一个类实例就行了. 


new com.lfx.db.AnySQLDriver(Sting config_file);


&#160; &#160; 接下来就可以用标准的JDBC来获得逻辑库的连接了, URL规则为: 


jdbc:anysql:logical_database_name


&#160; &#160; 比如在批处理中, 要从上一篇的三个Slave库中的一个读取一条记录, 就可以使用如下代码. 


try {
&#160; Connection db = DriverManager.getConnection("jdbc:anysql:readdb", null);
&#160; ......
&#160; db.close();
}
catch (SQLException sqle) 
{
&#160; ......
}


&#160; &#160; 现在还没有真正投入使用, 只在实验室中测试了一下, 感觉上还可以. 

Relative Posts:2009/02/26 -- [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 上一篇中的逻辑连接层, 通过一个DBLogicalManager类来实现, 并不是标准的JDBC调用方式, 如果要使现有的程序能很快用上这个功能, 要么更改程序, 要么就去实现一个JDBC Driver类, 让程序透明化. 显然第二种方法很好, 于是就写一个AnySQL JDBC Driver类吧. </p>

<p>&nbsp; &nbsp; JDBC Driver的类名为: </p>

<blockquote class="prefont">
com.lfx.db.AnySQLDriver
</blockquote>

<p>&nbsp; &nbsp; 使用这个类时, 需要传入一个保存连接配置信息(逻辑库, 物理库)的文件, 只要创建一个类实例就行了. </p>

<blockquote class="prefont">
new com.lfx.db.AnySQLDriver(Sting config_file);
</blockquote>

<p>&nbsp; &nbsp; 接下来就可以用标准的JDBC来获得逻辑库的连接了, URL规则为: </p>

<blockquote class="prefont">
jdbc:anysql:logical_database_name
</blockquote>

<p>&nbsp; &nbsp; 比如在批处理中, 要从上一篇的三个Slave库中的一个读取一条记录, 就可以使用如下代码. </p>

<blockquote class="prefont">
try {<br />
&nbsp; Connection db = DriverManager.getConnection("jdbc:anysql:readdb", null);<br />
&nbsp; ......<br />
&nbsp; db.close();<br />
}<br />
catch (SQLException sqle) <br />
{<br />
&nbsp; ......<br />
}<br />
</blockquote>

<p>&nbsp; &nbsp; 现在还没有真正投入使用, 只在实验室中测试了一下, 感觉上还可以. </p>

<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2009/02/26 -- <a href="http://www.anysql.net/anysql/anysql_db_query.html" title="AnySQL DB查询组件">AnySQL DB查询组件</a> (0)</li><li>2009/01/14 -- <a href="http://www.anysql.net/developer/webchart_excel.html" title="WebChart的Excel导出">WebChart的Excel导出</a> (3)</li><li>2010/01/26 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess2.html" title="逻辑连接层与物理连接层(2)">逻辑连接层与物理连接层(2)</a> (0)</li><li>2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" title="逻辑连接层与物理连接层">逻辑连接层与物理连接层</a> (3)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-super-expression.html" title="DataReport中的超级表达式">DataReport中的超级表达式</a> (0)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" title="DataReport的重复值合并">DataReport的重复值合并</a> (0)</li><li>2010/01/05 -- <a href="http://www.anysql.net/tools/webchart-forall-loop.html" title="DataReport中的FORALL循环">DataReport中的FORALL循环</a> (0)</li><li>2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" title="DataReport中的Cache为王">DataReport中的Cache为王</a> (4)</li><li>2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" title="统一DataReport的Servlet">统一DataReport的Servlet</a> (2)</li><li>2009/12/04 -- <a href="http://www.anysql.net/tools/webchart-nagivation-links.html" title="报表页面导航链接定义">报表页面导航链接定义</a> (1)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vb_nk18Qfik:Q0VAIVyYQa0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vb_nk18Qfik:Q0VAIVyYQa0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vb_nk18Qfik:Q0VAIVyYQa0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=Vb_nk18Qfik:Q0VAIVyYQa0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vb_nk18Qfik:Q0VAIVyYQa0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Vb_nk18Qfik:Q0VAIVyYQa0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/Vb_nk18Qfik" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/anysql-jdbc-driver.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/anysql-jdbc-driver.html</feedburner:origLink></item>
		<item>
		<title>逻辑连接层与物理连接层</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/_93KQwd_M5A/webchart-logical-dbaccess.html</link>
		<comments>http://www.anysql.net/tools/webchart-logical-dbaccess.html#comments</comments>
		<pubDate>Wed, 20 Jan 2010 08:52:27 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=733</guid>
		<description><![CDATA[&#160; &#160; 为了更好地利用MySQL的廉价复制(Slave)功能, 在DataReport的数据库连接层中增加了逻辑连接层, 原来是直接指定物理边接层. 当然数据库连接池还是在物理连接层实现的, 逻辑连接层则可以指定一种关系, 然后根据关系来获得指定的数据库物理连接, 当应用使用逻辑连接层来访问时, 其实是自动根据关系挑选一个物理连接. 

&#160; &#160; 还是举一个例子来说明一下, 比如你有一台主MySQL库(master)后面挂了三台从MySQL库(Slave), 然后用DataReport去搭建一个以读为主的应用, 希望DataReport能首先随机挑选三个Slave库中的一台进行读取, 如果三台Slave都不行, 则从Master进行读取. 

&#160; &#160; 首先定义四台MySQL数据库的连接, 称为物理层的配置. 


PHYSICAL.DBLIST=MASTER&#124;SLAVE1&#124;SLAVE2&#124;SLAVE3


&#160; &#160; 然后定义逻辑连接层, 以实现上面的要求. 


LOGICAL.DBLIST=writedb&#124;slavedb&#124;readdb
LOGICAL.WRITEDB=FIRST&#124;MASTER
LOGICAL.SLAVEDB=RANDOM&#124;SLAVE1,SLAVE2,SLAVE3
LOGICAL.READDB=FAILOVER&#124;SLAVEDB,WRITEDB


&#160; &#160; 其中FIRST表示读取第一个连接池, RANDOM表示从后面的连接中随机选一个, FAILOVER表示第一个失败的话，取下一个. 通过这三种关系, 就实现了我们的要求. 然后给物理连接池及每个逻辑连接都加上状态判断, 当遇到连接关闭的错误时, 就将相应的连接池标记为不可用(Markdown), 逻辑库层可以主动跳过已经被Markdown的下一级节点, 按照规则查找到一个可用的物理数据库连接.

&#160; &#160; 在DataReport中还设置了一个守护进程, 会每分钟检查各个Markdown的物理连接池, 偿试去Markup, 一当出现意外的物理库回到正常状态, 就可以提供服务, 使应用保持高可用状态. 

Relative Posts:2010/01/08 -- DataReport中的超级表达式 (0)2010/01/08 -- DataReport的重复值合并 (0)2010/01/05 -- DataReport中的FORALL循环 [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 为了更好地利用MySQL的廉价复制(Slave)功能, 在DataReport的数据库连接层中增加了逻辑连接层, 原来是直接指定物理边接层. 当然数据库连接池还是在物理连接层实现的, 逻辑连接层则可以指定一种关系, 然后根据关系来获得指定的数据库物理连接, 当应用使用逻辑连接层来访问时, 其实是自动根据关系挑选一个物理连接. </p>

<p>&nbsp; &nbsp; 还是举一个例子来说明一下, 比如你有一台主MySQL库(master)后面挂了三台从MySQL库(Slave), 然后用DataReport去搭建一个以读为主的应用, 希望DataReport能首先随机挑选三个Slave库中的一台进行读取, 如果三台Slave都不行, 则从Master进行读取. </p>

<p>&nbsp; &nbsp; 首先定义四台MySQL数据库的连接, 称为物理层的配置. </p>

<blockquote class="prefont">
PHYSICAL.DBLIST=MASTER|SLAVE1|SLAVE2|SLAVE3
</blockquote>

<p>&nbsp; &nbsp; 然后定义逻辑连接层, 以实现上面的要求. </p>

<blockquote class="prefont">
LOGICAL.DBLIST=writedb|slavedb|readdb<br />
LOGICAL.WRITEDB=FIRST|MASTER<br />
LOGICAL.SLAVEDB=RANDOM|SLAVE1,SLAVE2,SLAVE3<br />
LOGICAL.READDB=FAILOVER|SLAVEDB,WRITEDB
</blockquote>

<p>&nbsp; &nbsp; 其中FIRST表示读取第一个连接池, RANDOM表示从后面的连接中随机选一个, FAILOVER表示第一个失败的话，取下一个. 通过这三种关系, 就实现了我们的要求. 然后给物理连接池及每个逻辑连接都加上状态判断, 当遇到连接关闭的错误时, 就将相应的连接池标记为不可用(Markdown), 逻辑库层可以主动跳过已经被Markdown的下一级节点, 按照规则查找到一个可用的物理数据库连接.</p>

<p>&nbsp; &nbsp; 在DataReport中还设置了一个守护进程, 会每分钟检查各个Markdown的物理连接池, 偿试去Markup, 一当出现意外的物理库回到正常状态, 就可以提供服务, 使应用保持高可用状态. </p>

<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-super-expression.html" title="DataReport中的超级表达式">DataReport中的超级表达式</a> (0)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" title="DataReport的重复值合并">DataReport的重复值合并</a> (0)</li><li>2010/01/05 -- <a href="http://www.anysql.net/tools/webchart-forall-loop.html" title="DataReport中的FORALL循环">DataReport中的FORALL循环</a> (0)</li><li>2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" title="DataReport中的Cache为王">DataReport中的Cache为王</a> (4)</li><li>2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" title="统一DataReport的Servlet">统一DataReport的Servlet</a> (2)</li><li>2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" title="添加URL/HTML字符转义功能">添加URL/HTML字符转义功能</a> (1)</li><li>2009/09/21 -- <a href="http://www.anysql.net/tools/four-extra-businees-charts.html" title="多支持了四种业务图">多支持了四种业务图</a> (0)</li><li>2009/07/28 -- <a href="http://www.anysql.net/tools/webchart-jfreechart-support.html" title="DataReport增加JfreeChart支持">DataReport增加JfreeChart支持</a> (7)</li><li>2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" title="DataReport的图片服务功能">DataReport的图片服务功能</a> (0)</li><li>2009/07/23 -- <a href="http://www.anysql.net/tools/webchart-cell-formater.html" title="更灵活的DataReport格式控制">更灵活的DataReport格式控制</a> (0)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=_93KQwd_M5A:e1GixlxBWjI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=_93KQwd_M5A:e1GixlxBWjI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=_93KQwd_M5A:e1GixlxBWjI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=_93KQwd_M5A:e1GixlxBWjI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=_93KQwd_M5A:e1GixlxBWjI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=_93KQwd_M5A:e1GixlxBWjI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/_93KQwd_M5A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-logical-dbaccess.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-logical-dbaccess.html</feedburner:origLink></item>
		<item>
		<title>两个用户的SQLULDR2需求</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/fcEHqZGuNGo/sqluldr2-create-table-syntax.html</link>
		<comments>http://www.anysql.net/tools/sqluldr2-create-table-syntax.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 13:28:47 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLLDR]]></category>
		<category><![CDATA[Table]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=732</guid>
		<description><![CDATA[&#160; &#160; 有两个用户要求SQLULDR2能根据查询语句的结果给出建表的语法, 先提出要求的是一个国外网友, 当时没有理他, 这周一个国内网友也提出了同样的需求, 想想也比较合理, 于是就满足一下吧. 

&#160; &#160; 建表的语法会写在SQLLDR的控制文件中, 并不生成独立的SQL文件, 当我们运行如下命令. 


sqluldr2 scott/tiger query=emp table=emp


&#160; &#160; 得到的SQLLDR控制文件(emp_sqlldr.ctl)中, 就包含了建表语法, 如下所示. 


--
-- SQL*UnLoader: Fast Oracle Text Unloader (GZIP), Release 3.0.1
-- (@) Copyright Lou Fangxin (AnySQL.net) 2004 - 2010, all rights reserved.
--
/*
&#160; CREATE TABLE emp (
&#160; &#160; EMPNO NUMBER(4),
&#160; &#160; ENAME VARCHAR2(10),
&#160; &#160; JOB VARCHAR2(9),
&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 有两个用户要求SQLULDR2能根据查询语句的结果给出建表的语法, 先提出要求的是一个国外网友, 当时没有理他, 这周一个国内网友也提出了同样的需求, 想想也比较合理, 于是就满足一下吧. </p>

<p>&nbsp; &nbsp; 建表的语法会写在SQLLDR的控制文件中, 并不生成独立的SQL文件, 当我们运行如下命令. </p>

<blockquote class="prefont">
sqluldr2 scott/tiger query=emp table=emp
</blockquote>

<p>&nbsp; &nbsp; 得到的SQLLDR控制文件(emp_sqlldr.ctl)中, 就包含了建表语法, 如下所示. </p>

<blockquote class="prefont">
--<br />
-- SQL*UnLoader: Fast Oracle Text Unloader (GZIP), Release 3.0.1<br />
-- (@) Copyright Lou Fangxin (AnySQL.net) 2004 - 2010, all rights reserved.<br />
--<br />
/*<br />
&nbsp; CREATE TABLE emp (<br />
&nbsp; &nbsp; EMPNO NUMBER(4),<br />
&nbsp; &nbsp; ENAME VARCHAR2(10),<br />
&nbsp; &nbsp; JOB VARCHAR2(9),<br />
&nbsp; &nbsp; MGR NUMBER(4),<br />
&nbsp; &nbsp; HIREDATE DATE,<br />
&nbsp; &nbsp; SAL NUMBER(7,2),<br />
&nbsp; &nbsp; COMM NUMBER(7,2),<br />
&nbsp; &nbsp; DEPTNO NUMBER(2)<br />
&nbsp; );<br />
*/<br />
OPTIONS(BINDSIZE=2097152,READSIZE=2097152,ERRORS=-1,ROWS=50000)<br />
LOAD DATA<br />
INFILE 'uldrdata.txt' "STR X'0a'"<br />
INSERT INTO TABLE emp<br />
FIELDS TERMINATED BY X'2c' TRAILING NULLCOLS<br />
(<br />
&nbsp; EMPNO CHAR(6) NULLIF EMPNO=BLANKS,<br />
&nbsp; ENAME CHAR(10) NULLIF ENAME=BLANKS,<br />
&nbsp; JOB CHAR(9) NULLIF JOB=BLANKS,<br />
&nbsp; MGR CHAR(6) NULLIF MGR=BLANKS,<br />
&nbsp; HIREDATE DATE "YYYY-MM-DD HH24:MI:SS" NULLIF HIREDATE=BLANKS,<br />
&nbsp; SAL CHAR(10) NULLIF SAL=BLANKS,<br />
&nbsp; COMM CHAR(10) NULLIF COMM=BLANKS,<br />
&nbsp; DEPTNO CHAR(4) NULLIF DEPTNO=BLANKS<br />
)
</blockquote>

<p>&nbsp; &nbsp; 数据类型的准确性还有待验证, 并且只是Oracle的建表语法, CHAR和VARCHAR2也没有进行区分, 若有必要可进一步改善. </p>


<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/02/08 -- <a href="http://www.anysql.net/tools/sqluldr2-form-display.html" title="SQLULDR2也可改善用户体验">SQLULDR2也可改善用户体验</a> (0)</li><li>2009/12/25 -- <a href="http://www.anysql.net/tools/sqluldr2-column-separator-option.html" title="SQLULDR2的按列文本输出">SQLULDR2的按列文本输出</a> (0)</li><li>2009/12/25 -- <a href="http://www.anysql.net/tools/sqluldr2-customized-escape-chars.html" title="SQLULDR2的自定义转义符处理">SQLULDR2的自定义转义符处理</a> (2)</li><li>2009/10/30 -- <a href="http://www.anysql.net/tools/sqluldr2-high-perf-insert-unload.html" title="SQLULDR2功能增加, 性能不减">SQLULDR2功能增加, 性能不减</a> (14)</li><li>2009/10/27 -- <a href="http://www.anysql.net/tools/sqluldr2-more-escape-chars.html" title="将SQLULDR2转义符进行到底">将SQLULDR2转义符进行到底</a> (3)</li><li>2009/10/26 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-escape-char.html" title="SQLULDR2处理MySQL转义符">SQLULDR2处理MySQL转义符</a> (1)</li><li>2009/08/31 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-null-value.html" title="SQLULDR2处理MySQL的空值">SQLULDR2处理MySQL的空值</a> (2)</li><li>2009/04/02 -- <a href="http://www.anysql.net/tools/sqluldr2_license.html" title="给SQLULDR2加上Key保护">给SQLULDR2加上Key保护</a> (6)</li><li>2009/03/12 -- <a href="http://www.anysql.net/tools/ociuldr_1000_columns.html" title="让ociuldr支持1000个列">让ociuldr支持1000个列</a> (4)</li><li>2008/01/25 -- <a href="http://www.anysql.net/tools/ociuldr_update_20080125.html" title="ociuldr更新(2008/01/25)">ociuldr更新(2008/01/25)</a> (13)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=fcEHqZGuNGo:BUrZuuYih_g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=fcEHqZGuNGo:BUrZuuYih_g:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=fcEHqZGuNGo:BUrZuuYih_g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=fcEHqZGuNGo:BUrZuuYih_g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=fcEHqZGuNGo:BUrZuuYih_g:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=fcEHqZGuNGo:BUrZuuYih_g:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/fcEHqZGuNGo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/sqluldr2-create-table-syntax.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/sqluldr2-create-table-syntax.html</feedburner:origLink></item>
		<item>
		<title>出售AUL固定许可证</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/97OAalUwqEM/aul-fixed-license-mode.html</link>
		<comments>http://www.anysql.net/aulmydul/aul-fixed-license-mode.html#comments</comments>
		<pubDate>Sun, 10 Jan 2010 11:58:43 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[AUL/MyDUL]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Recovery]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=731</guid>
		<description><![CDATA[&#160; &#160; 每次启动AUL都需要不同的许可证, 这种方式已经持续了好几年了, 不用说别人早已觉得烦了, 连我自已也觉得有点烦, 既然这样, 就将它改掉吧. 从Windows版本开始, 最新的AUL在同一台机器上, 注册码将不会再改变, 保持固定, 称之为固定许可证. 

&#160; &#160; 例如, 在我的笔记本上, 每次启动AUL都得到如下输出. 


Register Code: DETO-NODT-JETT-DNMX-DDCN
AUL : AnySQL UnLoader(MyDUL) for Oracle 8/8i/9i/10g/11g, release 5.1.1

(C) Copyright Lou Fangxin 2005-2010 (AnySQL.net), all rights reserved.

AUL&#62;


&#160; &#160; 这里所说的同一台机器, 并不是指物理的机器, 即使只是操作系统的重装, 也有可能让注册码发生更改, 从而需要新的许可证, 固定许可证方式将对AUL的用户更加有利, 其他平台的AUL也将一步一步进行许可证改造. 

&#160; &#160; 在固定许可证模式下, 你购买AUL时, 不只是得到了一次服务, 更重要的是你真正得到达了一个长期可用的许可证. 



Relative Posts:2009/06/09 -- AUL程序上的两处缺陷 [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 每次启动AUL都需要不同的许可证, 这种方式已经持续了好几年了, 不用说别人早已觉得烦了, 连我自已也觉得有点烦, 既然这样, 就将它改掉吧. 从Windows版本开始, 最新的AUL在同一台机器上, 注册码将不会再改变, 保持固定, 称之为固定许可证. </p>

<p>&nbsp; &nbsp; 例如, 在我的笔记本上, 每次启动AUL都得到如下输出. </p>

<blockquote class="prefont">
Register Code: DETO-NODT-JETT-DNMX-DDCN<br />
AUL : AnySQL UnLoader(MyDUL) for Oracle 8/8i/9i/10g/11g, release 5.1.1<br />
<br />
(C) Copyright Lou Fangxin 2005-2010 (AnySQL.net), all rights reserved.<br />
<br />
AUL&gt;
</blockquote>

<p>&nbsp; &nbsp; 这里所说的同一台机器, 并不是指物理的机器, 即使只是操作系统的重装, 也有可能让注册码发生更改, 从而需要新的许可证, 固定许可证方式将对AUL的用户更加有利, 其他平台的AUL也将一步一步进行许可证改造. </p>

<p>&nbsp; &nbsp; 在固定许可证模式下, 你购买AUL时, 不只是得到了一次服务, 更重要的是你真正得到达了一个长期可用的许可证. </p>



<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2009/06/09 -- <a href="http://www.anysql.net/aulmydul/aul-bugs-found-200906.html" title="AUL程序上的两处缺陷">AUL程序上的两处缺陷</a> (1)</li><li>2009/04/26 -- <a href="http://www.anysql.net/aulmydul/aul_customer_world_map.html" title="拯救数据, 拯救地球?">拯救数据, 拯救地球?</a> (9)</li><li>2008/08/01 -- <a href="http://www.anysql.net/aulmydul/to_date_from_quarter.html" title="终极Oracle数据恢复工具 &#8212; AUL">终极Oracle数据恢复工具 &#8212; AUL</a> (8)</li><li>2008/07/06 -- <a href="http://www.anysql.net/aulmydul/tuning_update_sql_01.html" title="连错库误删100多张表">连错库误删100多张表</a> (9)</li><li>2008/04/16 -- <a href="http://www.anysql.net/aulmydul/qq_by_mobile_phone.html" title="AUL Sybase数据恢复工具">AUL Sybase数据恢复工具</a> (4)</li><li>2008/03/30 -- <a href="http://www.anysql.net/tools/buy_lenovo_ibm_thinkpad.html" title="AUL也走品牌路线?">AUL也走品牌路线?</a> (2)</li><li>2008/03/28 -- <a href="http://www.anysql.net/aulmydul/blame_after_steal_mydul.html" title="选择AUL恢复数据的理由">选择AUL恢复数据的理由</a> (3)</li><li>2008/03/19 -- <a href="http://www.anysql.net/aulmydul/oracle_final_data_recovery.html" title="Oracle数据恢复服务模式">Oracle数据恢复服务模式</a> (0)</li><li>2007/11/06 -- <a href="http://www.anysql.net/aulmydul/aul_compress_beta.html" title="将完成AUL最后一个心愿, 支持Compress表">将完成AUL最后一个心愿, 支持Compress表</a> (2)</li><li>2009/11/20 -- <a href="http://www.anysql.net/aulmydul/aul-fail-oracle-bug-7705591.html" title="首次AUL恢复失败案例">首次AUL恢复失败案例</a> (1)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=97OAalUwqEM:Lhf2kQ3vva0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=97OAalUwqEM:Lhf2kQ3vva0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=97OAalUwqEM:Lhf2kQ3vva0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=97OAalUwqEM:Lhf2kQ3vva0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=97OAalUwqEM:Lhf2kQ3vva0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=97OAalUwqEM:Lhf2kQ3vva0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/97OAalUwqEM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/aulmydul/aul-fixed-license-mode.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.anysql.net/aulmydul/aul-fixed-license-mode.html</feedburner:origLink></item>
		<item>
		<title>DataReport中的超级表达式</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/3qwEuM59UZY/webchart-super-expression.html</link>
		<comments>http://www.anysql.net/tools/webchart-super-expression.html#comments</comments>
		<pubDate>Fri, 08 Jan 2010 11:08:32 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=730</guid>
		<description><![CDATA[&#160; &#160; 将部份报表从Oracle迁到MySQL中时, 发现要在MySQL中实现Oracle的分析函数功能, 解决诸如"每个员工在各自部门中按工资降序排列的名次"等问题, 在Oracle中我们以用"rank() over (partition by deptno order by sal desc)"这样的语句来实现, 可这个在MySQL中怎么实现? SQL实在难写. 

&#160; &#160; 这样的需求还是有一定的通用性的, 不如放到客户端来计算, 在DataReport中实现它吧! 下面这个报表的后台数据库是在MySQL上的, 先猜猜是如何完成的. 







empnoenamejobsaldeptnoPecentRank


7782CLARKMANAGER2450.010282


7839KINGPRESSIDEN5000.057.14291


7934MILLERCLERK1300.014.85713


7369SSMITHCLERK800.0207.35635


7566JONESSMANAGER2975.027.35633


7788SSCOTTANALYSST3000.027.58621


7876ADAMSSCLERK1100.010.11494


7902FORDANALYSST3000.027.58622


7499ALLENSSALESSMA1600.03017.02132


7521WARDSSALESSMA1250.013.29795


7654MARTINSSALESSMA1250.013.29794


7698BLAKEMANAGER2850.030.31911


7844TURNERSSALESSMA1500.015.95743


7900JAMESSCLERK950.010.10646




&#160; &#160; 所用的SQL只是非常简单的SELECT语句. 


select 
&#160; &#160; &#160; &#160; empno, ename, job, sal, deptno 
&#160; &#160; from emp_his order by deptno


&#160; &#160; 在报表定义文件中, 定义了两个虚拟列, 指定表达式, 就完成这个工作了. 


webchart.express_1=Pecent&#124;100*x/y&#124;sal,sum::sal&#124;deptno
&#160; &#160; Rank&#124;x&#124;rnk::sal&#124;deptno
webchart.merge_1=deptno


&#160; &#160; 这样在不同的数据库之间迁移起来就简单多了, DataReport中已经实现了"min, max, [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 将部份报表从Oracle迁到MySQL中时, 发现要在MySQL中实现Oracle的分析函数功能, 解决诸如"每个员工在各自部门中按工资降序排列的名次"等问题, 在Oracle中我们以用"rank() over (partition by deptno order by sal desc)"这样的语句来实现, 可这个在MySQL中怎么实现? SQL实在难写. </p>

<p>&nbsp; &nbsp; 这样的需求还是有一定的通用性的, 不如放到客户端来计算, 在DataReport中实现它吧! 下面这个报表的后台数据库是在MySQL上的, 先猜猜是如何完成的. </p>

<blockquote>
<table border="1" width="540" cellspacing="0" cellpadding="2">
<caption align="center">
<font size="5"></font>
</caption>
<tr>
<th width="10%">empno</th><th width="15%">ename</th><th width="22%">job</th><th width="15%">sal</th><th width="10%">deptno</th><th width="17%">Pecent</th><th width="10%">Rank</th>
</tr>
<tr>
<td bgcolor="#eeeeee" align="right">7782</td><td bgcolor="#eeeeee" align="center">CLARK</td><td bgcolor="#eeeeee" align="left">MANAGER</td><td bgcolor="#eeeeee" align="right">2450.0</td><td rowspan="3" align="right">10</td><td bgcolor="#eeeeee" align="right">28</td><td bgcolor="#eeeeee" align="right">2</td>
</tr>
<tr>
<td align="right">7839</td><td align="center">KING</td><td align="left">PRESSIDEN</td><td align="right">5000.0</td><td align="right">57.1429</td><td align="right">1</td>
</tr>
<tr>
<td bgcolor="#eeeeee" align="right">7934</td><td bgcolor="#eeeeee" align="center">MILLER</td><td bgcolor="#eeeeee" align="left">CLERK</td><td bgcolor="#eeeeee" align="right">1300.0</td><td bgcolor="#eeeeee" align="right">14.8571</td><td bgcolor="#eeeeee" align="right">3</td>
</tr>
<tr>
<td align="right">7369</td><td align="center">SSMITH</td><td align="left">CLERK</td><td align="right">800.0</td><td rowspan="5" align="right">20</td><td align="right">7.3563</td><td align="right">5</td>
</tr>
<tr>
<td bgcolor="#eeeeee" align="right">7566</td><td bgcolor="#eeeeee" align="center">JONESS</td><td bgcolor="#eeeeee" align="left">MANAGER</td><td bgcolor="#eeeeee" align="right">2975.0</td><td bgcolor="#eeeeee" align="right">27.3563</td><td bgcolor="#eeeeee" align="right">3</td>
</tr>
<tr>
<td align="right">7788</td><td align="center">SSCOTT</td><td align="left">ANALYSST</td><td align="right">3000.0</td><td align="right">27.5862</td><td align="right">1</td>
</tr>
<tr>
<td bgcolor="#eeeeee" align="right">7876</td><td bgcolor="#eeeeee" align="center">ADAMSS</td><td bgcolor="#eeeeee" align="left">CLERK</td><td bgcolor="#eeeeee" align="right">1100.0</td><td bgcolor="#eeeeee" align="right">10.1149</td><td bgcolor="#eeeeee" align="right">4</td>
</tr>
<tr>
<td align="right">7902</td><td align="center">FORD</td><td align="left">ANALYSST</td><td align="right">3000.0</td><td align="right">27.5862</td><td align="right">2</td>
</tr>
<tr>
<td bgcolor="#eeeeee" align="right">7499</td><td bgcolor="#eeeeee" align="center">ALLEN</td><td bgcolor="#eeeeee" align="left">SSALESSMA</td><td bgcolor="#eeeeee" align="right">1600.0</td><td rowspan="6" align="right">30</td><td bgcolor="#eeeeee" align="right">17.0213</td><td bgcolor="#eeeeee" align="right">2</td>
</tr>
<tr>
<td align="right">7521</td><td align="center">WARD</td><td align="left">SSALESSMA</td><td align="right">1250.0</td><td align="right">13.2979</td><td align="right">5</td>
</tr>
<tr>
<td bgcolor="#eeeeee" align="right">7654</td><td bgcolor="#eeeeee" align="center">MARTIN</td><td bgcolor="#eeeeee" align="left">SSALESSMA</td><td bgcolor="#eeeeee" align="right">1250.0</td><td bgcolor="#eeeeee" align="right">13.2979</td><td bgcolor="#eeeeee" align="right">4</td>
</tr>
<tr>
<td align="right">7698</td><td align="center">BLAKE</td><td align="left">MANAGER</td><td align="right">2850.0</td><td align="right">30.3191</td><td align="right">1</td>
</tr>
<tr>
<td bgcolor="#eeeeee" align="right">7844</td><td bgcolor="#eeeeee" align="center">TURNER</td><td bgcolor="#eeeeee" align="left">SSALESSMA</td><td bgcolor="#eeeeee" align="right">1500.0</td><td bgcolor="#eeeeee" align="right">15.9574</td><td bgcolor="#eeeeee" align="right">3</td>
</tr>
<tr>
<td align="right">7900</td><td align="center">JAMESS</td><td align="left">CLERK</td><td align="right">950.0</td><td align="right">10.1064</td><td align="right">6</td>
</tr>
</table>
</blockquote>

<p>&nbsp; &nbsp; 所用的SQL只是非常简单的SELECT语句. </p>

<blockquote class="prefont">
select <br />
&nbsp; &nbsp; &nbsp; &nbsp; empno, ename, job, sal, deptno <br />
&nbsp; &nbsp; from emp_his order by deptno
</blockquote>

<p>&nbsp; &nbsp; 在报表定义文件中, 定义了两个虚拟列, 指定表达式, 就完成这个工作了. </p>

<blockquote class="prefont">
webchart.express_1=Pecent|100*x/y|sal,sum::sal|deptno<br />
&nbsp; &nbsp; Rank|x|rnk::sal|deptno<br />
webchart.merge_1=deptno
</blockquote>

<p>&nbsp; &nbsp; 这样在不同的数据库之间迁移起来就简单多了, DataReport中已经实现了"min, max, sum, avg, cnt, row, rnk"这七个计算公式. 虽然功能很好, 但实现的逻辑并没有优化, 处理大量数据估计不行, 但一个页面上的少量数据, 应当没有什么问题. </p>

<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" title="逻辑连接层与物理连接层">逻辑连接层与物理连接层</a> (3)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" title="DataReport的重复值合并">DataReport的重复值合并</a> (0)</li><li>2010/01/05 -- <a href="http://www.anysql.net/tools/webchart-forall-loop.html" title="DataReport中的FORALL循环">DataReport中的FORALL循环</a> (0)</li><li>2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" title="DataReport中的Cache为王">DataReport中的Cache为王</a> (4)</li><li>2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" title="统一DataReport的Servlet">统一DataReport的Servlet</a> (2)</li><li>2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" title="添加URL/HTML字符转义功能">添加URL/HTML字符转义功能</a> (1)</li><li>2009/09/21 -- <a href="http://www.anysql.net/tools/four-extra-businees-charts.html" title="多支持了四种业务图">多支持了四种业务图</a> (0)</li><li>2009/07/28 -- <a href="http://www.anysql.net/tools/webchart-jfreechart-support.html" title="DataReport增加JfreeChart支持">DataReport增加JfreeChart支持</a> (7)</li><li>2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" title="DataReport的图片服务功能">DataReport的图片服务功能</a> (0)</li><li>2009/07/23 -- <a href="http://www.anysql.net/tools/webchart-cell-formater.html" title="更灵活的DataReport格式控制">更灵活的DataReport格式控制</a> (0)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=3qwEuM59UZY:jbf5VrM6Apc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=3qwEuM59UZY:jbf5VrM6Apc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=3qwEuM59UZY:jbf5VrM6Apc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=3qwEuM59UZY:jbf5VrM6Apc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=3qwEuM59UZY:jbf5VrM6Apc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=3qwEuM59UZY:jbf5VrM6Apc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/3qwEuM59UZY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-super-expression.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-super-expression.html</feedburner:origLink></item>
		<item>
		<title>DataReport的重复值合并</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/TqOhQi7mcAc/webchart-merge-dup-values.html</link>
		<comments>http://www.anysql.net/tools/webchart-merge-dup-values.html#comments</comments>
		<pubDate>Fri, 08 Jan 2010 03:04:33 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=729</guid>
		<description><![CDATA[&#160; &#160; DataReport的GROUP功能可以对左边的指定列进行重复值合并, 对于右边的列无能为力, 当我们在查询员工表时, 页面显示如下. 







EMPNOENAMEJOBSALDEPTNO


7782CLARKMANAGER245010


7839KINGPRESIDENT500010


7934MILLERCLERK130010


7369SMITHCLERK80020


7566JONESMANAGER297520


7902FORDANALYST300020


7499ALLENSALESMAN160030


7521WARDSALESMAN125030


7654MARTINSALESMAN125030


7698BLAKEMANAGER285030


7844TURNERSALESMAN150030


7900JAMESCLERK95030




&#160; &#160; 也许我们更希望, 最右边的部门号字段进行复值合并, 得到如下输出. 







EMPNOENAMEJOBSALDEPTNO


7782CLARKMANAGER245010


7839KINGPRESIDENT5000


7934MILLERCLERK1300


7369SMITHCLERK80020


7566JONESMANAGER2975


7902FORDANALYST3000


7499ALLENSALESMAN160030


7521WARDSALESMAN1250


7654MARTINSALESMAN1250


7698BLAKEMANAGER2850


7844TURNERSALESMAN1500


7900JAMESCLERK950




&#160; &#160; 在DataReport中现在可以做到了, 只需要指定要进行合并处理的列, 用如下标记. 


WEBCHART.MERGE_n=col1&#124;col2&#124;...


&#160; &#160; 如果你有网页查询系统要开发, 可以试试免费的DataReport软件. 

Relative Posts:2010/01/20 -- 逻辑连接层与物理连接层 (3)2010/01/08 -- DataReport中的超级表达式 (0)2010/01/05 -- DataReport中的FORALL循环 (0)2009/12/29 -- DataReport中的Cache为王 (4)2009/12/28 -- 统一DataReport的Servlet (2)2009/12/02 -- 添加URL/HTML字符转义功能 (1)2009/09/21 -- 多支持了四种业务图 (0)2009/07/28 -- DataReport增加JfreeChart支持 (7)2009/07/25 -- DataReport的图片服务功能 (0)2009/07/23 -- 更灵活的DataReport格式控制 (0)]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; DataReport的GROUP功能可以对左边的指定列进行重复值合并, 对于右边的列无能为力, 当我们在查询员工表时, 页面显示如下. </p>

<blockquote>
<table border="1" width="540" cellspacing="0" cellpadding="2">
<caption align="center">
<font size="5"></font>
</caption>
<tr>
<th width="14%">EMPNO</th><th width="22%">ENAME</th><th width="33%">JOB</th><th width="14%">SAL</th><th width="14%">DEPTNO</th>
</tr>
<tr>
<td align="right">7782</td><td align="center">CLARK</td><td bgcolor="#eeeeee" align="left">MANAGER</td><td bgcolor="#eeeeee" align="right">2450</td><td bgcolor="#eeeeee" align="right">10</td>
</tr>
<tr>
<td align="right">7839</td><td align="center">KING</td><td align="left">PRESIDENT</td><td align="right">5000</td><td align="right">10</td>
</tr>
<tr>
<td align="right">7934</td><td align="center">MILLER</td><td bgcolor="#eeeeee" align="left">CLERK</td><td bgcolor="#eeeeee" align="right">1300</td><td bgcolor="#eeeeee" align="right">10</td>
</tr>
<tr>
<td align="right">7369</td><td align="center">SMITH</td><td align="left">CLERK</td><td align="right">800</td><td align="right">20</td>
</tr>
<tr>
<td align="right">7566</td><td align="center">JONES</td><td bgcolor="#eeeeee" align="left">MANAGER</td><td bgcolor="#eeeeee" align="right">2975</td><td bgcolor="#eeeeee" align="right">20</td>
</tr>
<tr>
<td align="right">7902</td><td align="center">FORD</td><td align="left">ANALYST</td><td align="right">3000</td><td align="right">20</td>
</tr>
<tr>
<td align="right">7499</td><td align="center">ALLEN</td><td bgcolor="#eeeeee" align="left">SALESMAN</td><td bgcolor="#eeeeee" align="right">1600</td><td bgcolor="#eeeeee" align="right">30</td>
</tr>
<tr>
<td align="right">7521</td><td align="center">WARD</td><td align="left">SALESMAN</td><td align="right">1250</td><td align="right">30</td>
</tr>
<tr>
<td align="right">7654</td><td align="center">MARTIN</td><td bgcolor="#eeeeee" align="left">SALESMAN</td><td bgcolor="#eeeeee" align="right">1250</td><td bgcolor="#eeeeee" align="right">30</td>
</tr>
<tr>
<td align="right">7698</td><td align="center">BLAKE</td><td align="left">MANAGER</td><td align="right">2850</td><td align="right">30</td>
</tr>
<tr>
<td align="right">7844</td><td align="center">TURNER</td><td bgcolor="#eeeeee" align="left">SALESMAN</td><td bgcolor="#eeeeee" align="right">1500</td><td bgcolor="#eeeeee" align="right">30</td>
</tr>
<tr>
<td align="right">7900</td><td align="center">JAMES</td><td align="left">CLERK</td><td align="right">950</td><td align="right">30</td>
</tr>
</table>
</blockquote>

<p>&nbsp; &nbsp; 也许我们更希望, 最右边的部门号字段进行复值合并, 得到如下输出. </p>

<blockquote>
<table border="1" width="540" cellspacing="0" cellpadding="2">
<caption align="center">
<font size="5"></font>
</caption>
<tr>
<th width="14%">EMPNO</th><th width="22%">ENAME</th><th width="33%">JOB</th><th width="14%">SAL</th><th width="14%">DEPTNO</th>
</tr>
<tr>
<td align="right">7782</td><td align="center">CLARK</td><td bgcolor="#eeeeee" align="left">MANAGER</td><td bgcolor="#eeeeee" align="right">2450</td><td rowspan="3" align="right">10</td>
</tr>
<tr>
<td align="right">7839</td><td align="center">KING</td><td align="left">PRESIDENT</td><td align="right">5000</td>
</tr>
<tr>
<td align="right">7934</td><td align="center">MILLER</td><td bgcolor="#eeeeee" align="left">CLERK</td><td bgcolor="#eeeeee" align="right">1300</td>
</tr>
<tr>
<td align="right">7369</td><td align="center">SMITH</td><td align="left">CLERK</td><td align="right">800</td><td rowspan="3" align="right">20</td>
</tr>
<tr>
<td align="right">7566</td><td align="center">JONES</td><td bgcolor="#eeeeee" align="left">MANAGER</td><td bgcolor="#eeeeee" align="right">2975</td>
</tr>
<tr>
<td align="right">7902</td><td align="center">FORD</td><td align="left">ANALYST</td><td align="right">3000</td>
</tr>
<tr>
<td align="right">7499</td><td align="center">ALLEN</td><td bgcolor="#eeeeee" align="left">SALESMAN</td><td bgcolor="#eeeeee" align="right">1600</td><td rowspan="6" align="right">30</td>
</tr>
<tr>
<td align="right">7521</td><td align="center">WARD</td><td align="left">SALESMAN</td><td align="right">1250</td>
</tr>
<tr>
<td align="right">7654</td><td align="center">MARTIN</td><td bgcolor="#eeeeee" align="left">SALESMAN</td><td bgcolor="#eeeeee" align="right">1250</td>
</tr>
<tr>
<td align="right">7698</td><td align="center">BLAKE</td><td align="left">MANAGER</td><td align="right">2850</td>
</tr>
<tr>
<td align="right">7844</td><td align="center">TURNER</td><td bgcolor="#eeeeee" align="left">SALESMAN</td><td bgcolor="#eeeeee" align="right">1500</td>
</tr>
<tr>
<td align="right">7900</td><td align="center">JAMES</td><td align="left">CLERK</td><td align="right">950</td>
</tr>
</table>
</blockquote>

<p>&nbsp; &nbsp; 在DataReport中现在可以做到了, 只需要指定要进行合并处理的列, 用如下标记. </p>

<blockquote class="prefont">
WEBCHART.MERGE_n=col1|col2|...
</blockquote>

<p>&nbsp; &nbsp; 如果你有网页查询系统要开发, 可以试试免费的<a href="http://www.anysql.net/tag/WebChart">DataReport</a>软件. </p>

<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" title="逻辑连接层与物理连接层">逻辑连接层与物理连接层</a> (3)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-super-expression.html" title="DataReport中的超级表达式">DataReport中的超级表达式</a> (0)</li><li>2010/01/05 -- <a href="http://www.anysql.net/tools/webchart-forall-loop.html" title="DataReport中的FORALL循环">DataReport中的FORALL循环</a> (0)</li><li>2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" title="DataReport中的Cache为王">DataReport中的Cache为王</a> (4)</li><li>2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" title="统一DataReport的Servlet">统一DataReport的Servlet</a> (2)</li><li>2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" title="添加URL/HTML字符转义功能">添加URL/HTML字符转义功能</a> (1)</li><li>2009/09/21 -- <a href="http://www.anysql.net/tools/four-extra-businees-charts.html" title="多支持了四种业务图">多支持了四种业务图</a> (0)</li><li>2009/07/28 -- <a href="http://www.anysql.net/tools/webchart-jfreechart-support.html" title="DataReport增加JfreeChart支持">DataReport增加JfreeChart支持</a> (7)</li><li>2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" title="DataReport的图片服务功能">DataReport的图片服务功能</a> (0)</li><li>2009/07/23 -- <a href="http://www.anysql.net/tools/webchart-cell-formater.html" title="更灵活的DataReport格式控制">更灵活的DataReport格式控制</a> (0)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=TqOhQi7mcAc:UjKwKLzt1rM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=TqOhQi7mcAc:UjKwKLzt1rM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=TqOhQi7mcAc:UjKwKLzt1rM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=TqOhQi7mcAc:UjKwKLzt1rM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=TqOhQi7mcAc:UjKwKLzt1rM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=TqOhQi7mcAc:UjKwKLzt1rM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/TqOhQi7mcAc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-merge-dup-values.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-merge-dup-values.html</feedburner:origLink></item>
		<item>
		<title>DataReport中的FORALL循环</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/Ejbd3MJhpY8/webchart-forall-loop.html</link>
		<comments>http://www.anysql.net/tools/webchart-forall-loop.html#comments</comments>
		<pubDate>Tue, 05 Jan 2010 13:20:35 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=728</guid>
		<description><![CDATA[&#160; &#160; 在某个项目中上了10台MySQL数据库, 编写了几段脚本收集了MySQL及主机的性能信息, 如CPU利用率, 系统负载, MySQL中的事务数, 查询数量等. 在使用DataReport编写一个页面展示10个Master库的负载信息时, 发现要写很多的SQL语句, 比较繁硕, 若有调整, 更加麻烦. 


WEBCHART.QUERY_1=select ... from mysql_load where host='mysql1'
WEBCHART.QUERY_2=select ... from mysql_load where host='mysql1'
WEBCHART.QUERY_3=select ... from mysql_load where host='mysql1'
......
WEBCHART.QUERY_10=select ... from mysql_load where host='mysql1'


&#160; &#160; 同事数次询问有没有循环的功能, 以减轻DataReport页面编写的任务, 经过几番思量, 为其增加了FORALL循环功能. 


WEBCHART.FORALL_n= var1=var1 value 1; var2=var2 value 1
&#160; &#160; &#160;  var1=var1 value 2; var2=var2 value 2
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 在某个项目中上了10台MySQL数据库, 编写了几段脚本收集了MySQL及主机的性能信息, 如CPU利用率, 系统负载, MySQL中的事务数, 查询数量等. 在使用DataReport编写一个页面展示10个Master库的负载信息时, 发现要写很多的SQL语句, 比较繁硕, 若有调整, 更加麻烦. </p>

<blockquote class="prefont">
WEBCHART.QUERY_1=select ... from mysql_load where host='mysql1'<br />
WEBCHART.QUERY_2=select ... from mysql_load where host='mysql1'<br />
WEBCHART.QUERY_3=select ... from mysql_load where host='mysql1'<br />
......<br />
WEBCHART.QUERY_10=select ... from mysql_load where host='mysql1'
</blockquote>

<p>&nbsp; &nbsp; 同事数次询问有没有循环的功能, 以减轻DataReport页面编写的任务, 经过几番思量, 为其增加了FORALL循环功能. </p>

<blockquote class="prefont">
WEBCHART.FORALL_n= var1=var1 value 1; var2=var2 value 1<br />
&nbsp; &nbsp; &nbsp;  var1=var1 value 2; var2=var2 value 2<br />
&nbsp; &nbsp; &nbsp;  ......<br />
&nbsp; &nbsp; &nbsp;  var1=var1 value n; var2=var2 value n
</blockquote>

<p>&nbsp; &nbsp; 对于FORALL标记的每一行, 都会执行一次第n个定义的循环处理, 比如下面的页面定义. </p>

<blockquote class="prefont">
webchart.xsldoc=xsl/default.xsl<br />
<br />
webchart.forall_1=dno=10; title=Dept 10<br />
&nbsp;  dno=20; title=Dept 20<br />
&nbsp;  dno=30; title=Dept 30<br />
<br />
webchart.query_1=select&nbsp; empno, ename <br />
&nbsp; &nbsp;  from emp <br />
&nbsp; &nbsp;  where deptno = :dno
</blockquote>

<p>&nbsp; &nbsp; 就会执行三次对EMP表的查询, 分别列出不同部门的员工编号和员工名字, 有了这个功能后, 使得显示10个MySQL Master数据性能页面的编写变得简单可维护多了. </p>

<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/26 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess2.html" title="逻辑连接层与物理连接层(2)">逻辑连接层与物理连接层(2)</a> (0)</li><li>2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" title="逻辑连接层与物理连接层">逻辑连接层与物理连接层</a> (3)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-super-expression.html" title="DataReport中的超级表达式">DataReport中的超级表达式</a> (0)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" title="DataReport的重复值合并">DataReport的重复值合并</a> (0)</li><li>2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" title="DataReport中的Cache为王">DataReport中的Cache为王</a> (4)</li><li>2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" title="统一DataReport的Servlet">统一DataReport的Servlet</a> (2)</li><li>2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" title="添加URL/HTML字符转义功能">添加URL/HTML字符转义功能</a> (1)</li><li>2009/09/21 -- <a href="http://www.anysql.net/tools/four-extra-businees-charts.html" title="多支持了四种业务图">多支持了四种业务图</a> (0)</li><li>2009/07/28 -- <a href="http://www.anysql.net/tools/webchart-jfreechart-support.html" title="DataReport增加JfreeChart支持">DataReport增加JfreeChart支持</a> (7)</li><li>2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" title="DataReport的图片服务功能">DataReport的图片服务功能</a> (0)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=Ejbd3MJhpY8:9l2r2BskZoM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Ejbd3MJhpY8:9l2r2BskZoM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Ejbd3MJhpY8:9l2r2BskZoM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=Ejbd3MJhpY8:9l2r2BskZoM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Ejbd3MJhpY8:9l2r2BskZoM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Ejbd3MJhpY8:9l2r2BskZoM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/Ejbd3MJhpY8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-forall-loop.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-forall-loop.html</feedburner:origLink></item>
		<item>
		<title>最近在整理的几篇文档</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/rOkxjIFkr-o/my-first-book-content.html</link>
		<comments>http://www.anysql.net/life/my-first-book-content.html#comments</comments>
		<pubDate>Mon, 04 Jan 2010 15:01:48 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Book]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=727</guid>
		<description><![CDATA[&#160; &#160; 第一篇讲述的是数据收集的工具，一个从Oracle中导出数据成各种格式文本的工具。好的工具可以让工作变得轻松，让生活变得更美好，的确有了好的方便的工具之后，大家开始一起收集更多的数据了。

&#160; &#160; 第二篇讲述的是一个简单的数据展示平台，也就是在荒凉时期积累下来的DataReport程序，用它快速展示各种各样的数据，节约了原来用来学习PHP、Cacti、RRD Tool等的时间。收集了数据如果不加以展示和分析，无法发挥应用的作用，通过对数据种种图形的展示，不仅让我自已更快更好地了解了系统，也帮助了公司里的其他人更好地了解系统。

&#160; &#160; 第三篇讲述了作为DBA第一个要面临的空间管理问题，如何了解数据库中各个表的数据增长情况，如何得到业务量增长和数据量增长之间的关系，如何提前给表空间添加数据文件等，使空间管理更附合生活节奏。

&#160; &#160; 第四篇讲述了对备库的一点管理经验，对于备库的技术方面，大家没有任何问题，却在业务高速增升、数据高速增长的情况下的归档日志安全清理方面裁了不少跟头，导致了好几次备库的重建。

&#160; &#160; 第五篇讲述了Statspack与AWR所收集的性能数据的另一种分析方式，不同于各自产生的报表，着重于性能数据在时间轴上的变化趋势，同时也着重于如何将SQL的性能信息如何更好地分享给公司的开发人员及架构师。

&#160; &#160; 第六篇讲述了应用服务器到数据库服务器的连接数的分析，如何为应用服务器设置合理的连接数，以合理控制数据库的并发会话数，DBA、架构师和应用管理人员从这些数据的分析中得到了一些有用的认识。

&#160; &#160; 第七篇讲述了如何分析应用服务器与数据库的紧密程度，以便进行应用服务器的多机房分布问题，也为应用服务器的层次划分提供了一点数据依据，DBA及架构师从这部份数据的分析中得到了一些有用的认识。
	
&#160; &#160; 第八篇讲述了一种业务量实时预测与监控的原理，监控体系中必不可少的一部份，也是全公司所有人能毫无异议地理解一致的监控数据，是评估突发事件紧急性及影响程度的重要依据之一。

&#160; &#160; 第九篇讲述了如何用分析性能数据，进行数据库的垂直拆分。当一个数据库不足以满足业务量的增长需求时，就要进行拆分，垂直拆分总是先行的一步。拆分的难点并不在于拆分本身，而在于拆分前对于拆分后效果的有效评估。

&#160; &#160; 还是想努力去完成2009年初制定的写一本书的目标.
Relative Posts:2010/01/28 -- 谈谈历史遗留问题 (2)2009/09/11 -- DBA有什么个人前途? (17)2009/09/08 -- 因丈母娘的需求而买房? (5)2009/09/03 -- 收费有助于网购信用 (1)2009/08/25 -- 关于技术积累的几点想法 (5)2009/08/17 -- 努力创造DBA额外价值 (27)2009/08/12 -- 个人价值决定个人回报 (13)2009/08/04 -- DBA最缺的不是技术 (8)2009/08/02 -- 当群众演员比干DBA还累 (9)2009/07/29 -- 域名解释与行人问路 (2)]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 第一篇讲述的是数据收集的工具，一个从Oracle中导出数据成各种格式文本的工具。好的工具可以让工作变得轻松，让生活变得更美好，的确有了好的方便的工具之后，大家开始一起收集更多的数据了。</p>

<p>&nbsp; &nbsp; 第二篇讲述的是一个简单的数据展示平台，也就是在荒凉时期积累下来的DataReport程序，用它快速展示各种各样的数据，节约了原来用来学习PHP、Cacti、RRD Tool等的时间。收集了数据如果不加以展示和分析，无法发挥应用的作用，通过对数据种种图形的展示，不仅让我自已更快更好地了解了系统，也帮助了公司里的其他人更好地了解系统。</p>

<p>&nbsp; &nbsp; 第三篇讲述了作为DBA第一个要面临的空间管理问题，如何了解数据库中各个表的数据增长情况，如何得到业务量增长和数据量增长之间的关系，如何提前给表空间添加数据文件等，使空间管理更附合生活节奏。</p>

<p>&nbsp; &nbsp; 第四篇讲述了对备库的一点管理经验，对于备库的技术方面，大家没有任何问题，却在业务高速增升、数据高速增长的情况下的归档日志安全清理方面裁了不少跟头，导致了好几次备库的重建。</p>

<p>&nbsp; &nbsp; 第五篇讲述了Statspack与AWR所收集的性能数据的另一种分析方式，不同于各自产生的报表，着重于性能数据在时间轴上的变化趋势，同时也着重于如何将SQL的性能信息如何更好地分享给公司的开发人员及架构师。</p>

<p>&nbsp; &nbsp; 第六篇讲述了应用服务器到数据库服务器的连接数的分析，如何为应用服务器设置合理的连接数，以合理控制数据库的并发会话数，DBA、架构师和应用管理人员从这些数据的分析中得到了一些有用的认识。</p>

<p>&nbsp; &nbsp; 第七篇讲述了如何分析应用服务器与数据库的紧密程度，以便进行应用服务器的多机房分布问题，也为应用服务器的层次划分提供了一点数据依据，DBA及架构师从这部份数据的分析中得到了一些有用的认识。</p>
	
<p>&nbsp; &nbsp; 第八篇讲述了一种业务量实时预测与监控的原理，监控体系中必不可少的一部份，也是全公司所有人能毫无异议地理解一致的监控数据，是评估突发事件紧急性及影响程度的重要依据之一。</p>

<p>&nbsp; &nbsp; 第九篇讲述了如何用分析性能数据，进行数据库的垂直拆分。当一个数据库不足以满足业务量的增长需求时，就要进行拆分，垂直拆分总是先行的一步。拆分的难点并不在于拆分本身，而在于拆分前对于拆分后效果的有效评估。</p>

<p>&nbsp; &nbsp; 还是想努力去完成2009年初制定的写一本书的目标.</p>
<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/28 -- <a href="http://www.anysql.net/life/history-problems.html" title="谈谈历史遗留问题">谈谈历史遗留问题</a> (2)</li><li>2009/09/11 -- <a href="http://www.anysql.net/dba/where-is-dba-future.html" title="DBA有什么个人前途?">DBA有什么个人前途?</a> (17)</li><li>2009/09/08 -- <a href="http://www.anysql.net/life/why-we-buy-apartment.html" title="因丈母娘的需求而买房?">因丈母娘的需求而买房?</a> (5)</li><li>2009/09/03 -- <a href="http://www.anysql.net/life/build-online-trade-credit.html" title="收费有助于网购信用">收费有助于网购信用</a> (1)</li><li>2009/08/25 -- <a href="http://www.anysql.net/dba/dba-experience-growth.html" title="关于技术积累的几点想法">关于技术积累的几点想法</a> (5)</li><li>2009/08/17 -- <a href="http://www.anysql.net/life/create-dba-extra-values.html" title="努力创造DBA额外价值">努力创造DBA额外价值</a> (27)</li><li>2009/08/12 -- <a href="http://www.anysql.net/life/with-value-based-life.html" title="个人价值决定个人回报">个人价值决定个人回报</a> (13)</li><li>2009/08/04 -- <a href="http://www.anysql.net/dba/dba-most-important-things.html" title="DBA最缺的不是技术">DBA最缺的不是技术</a> (8)</li><li>2009/08/02 -- <a href="http://www.anysql.net/life/harder-work-than-dba.html" title="当群众演员比干DBA还累">当群众演员比干DBA还累</a> (9)</li><li>2009/07/29 -- <a href="http://www.anysql.net/dba/how-dns-work-for-us.html" title="域名解释与行人问路">域名解释与行人问路</a> (2)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=rOkxjIFkr-o:YSMGfJLNkmE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=rOkxjIFkr-o:YSMGfJLNkmE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=rOkxjIFkr-o:YSMGfJLNkmE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=rOkxjIFkr-o:YSMGfJLNkmE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=rOkxjIFkr-o:YSMGfJLNkmE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=rOkxjIFkr-o:YSMGfJLNkmE:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/rOkxjIFkr-o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/life/my-first-book-content.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.anysql.net/life/my-first-book-content.html</feedburner:origLink></item>
		<item>
		<title>DataReport中的Cache为王</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/Umk71qwNeMw/webchart-page-cache.html</link>
		<comments>http://www.anysql.net/tools/webchart-page-cache.html#comments</comments>
		<pubDate>Tue, 29 Dec 2009 14:22:52 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=726</guid>
		<description><![CDATA[&#160; &#160; DataReport充分发挥了数据库性能数据展示的作用, 不仅展示了核心Oracle数据库的数据, 也展示了众多的MySQL的数据, 并且访问的人数在激增, 其后台数据库压力日增, 访问的速度也慢下来了, 看来好象要增加一台应用服务器了. 

&#160; &#160; 但Web应用Cache为王, 加机器也解决不了单次访问时间的问题, 不能从根本上解决内部用户体验的问题, 所以为DataReport加上了Cache功能. 使用很简单, 有两个属性可以指定Cache相关属性. 


WEBCHART.CACHE=cache key
WEBCHART.KEEP_CACHE_TIME=expire time in seconds


&#160; &#160; 要启用Cache功能, 必须指定第一个参数, 用与指定页面的缓冲KEY, 在这里可以使用表达式方式, 比如我们有一个时间参数(PDAY), 则我们可以指定如下的缓冲KEY, 不同的日期条件会保存成不同的缓冲页面. 


WEBCHART.CACHE=CACHE_${REQUEST.FILE}_$PDAY


&#160; &#160; 有一些Load监控页面, 显示的数据比较多, 每次刷新要比较久的时间, 我们更多时侯只希望看到最近几分钟的数据就行了, 不一定要实时的, 这时可以启用这个功能, 用另一个参数控制页面缓冲过期的时间(默认为5分钟), 如1分钟的过期时间. 


WEBCHART.KEEP_CACHE_TIME=60


&#160; &#160; 可以在每一个页面进行独立的控制, HTML的内容和图片会一起进行缓存处理, 做了这样的改进之后, 使用起来超级爽. 
Relative Posts:2010/01/20 -- 逻辑连接层与物理连接层 (3)2010/01/08 -- DataReport中的超级表达式 (0)2010/01/08 -- [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; DataReport充分发挥了数据库性能数据展示的作用, 不仅展示了核心Oracle数据库的数据, 也展示了众多的MySQL的数据, 并且访问的人数在激增, 其后台数据库压力日增, 访问的速度也慢下来了, 看来好象要增加一台应用服务器了. </p>

<p>&nbsp; &nbsp; 但Web应用Cache为王, 加机器也解决不了单次访问时间的问题, 不能从根本上解决内部用户体验的问题, 所以为DataReport加上了Cache功能. 使用很简单, 有两个属性可以指定Cache相关属性. </p>

<blockquote class="prefont">
WEBCHART.CACHE=cache key<br />
WEBCHART.KEEP_CACHE_TIME=expire time in seconds
</blockquote>

<p>&nbsp; &nbsp; 要启用Cache功能, 必须指定第一个参数, 用与指定页面的缓冲KEY, 在这里可以使用表达式方式, 比如我们有一个时间参数(PDAY), 则我们可以指定如下的缓冲KEY, 不同的日期条件会保存成不同的缓冲页面. </p>

<blockquote class="prefont">
WEBCHART.CACHE=CACHE_${REQUEST.FILE}_$PDAY
</blockquote>

<p>&nbsp; &nbsp; 有一些Load监控页面, 显示的数据比较多, 每次刷新要比较久的时间, 我们更多时侯只希望看到最近几分钟的数据就行了, 不一定要实时的, 这时可以启用这个功能, 用另一个参数控制页面缓冲过期的时间(默认为5分钟), 如1分钟的过期时间. </p>

<blockquote class="prefont">
WEBCHART.KEEP_CACHE_TIME=60
</blockquote>

<p>&nbsp; &nbsp; 可以在每一个页面进行独立的控制, HTML的内容和图片会一起进行缓存处理, 做了这样的改进之后, 使用起来超级爽. </p>
<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" title="逻辑连接层与物理连接层">逻辑连接层与物理连接层</a> (3)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-super-expression.html" title="DataReport中的超级表达式">DataReport中的超级表达式</a> (0)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" title="DataReport的重复值合并">DataReport的重复值合并</a> (0)</li><li>2010/01/05 -- <a href="http://www.anysql.net/tools/webchart-forall-loop.html" title="DataReport中的FORALL循环">DataReport中的FORALL循环</a> (0)</li><li>2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" title="统一DataReport的Servlet">统一DataReport的Servlet</a> (2)</li><li>2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" title="添加URL/HTML字符转义功能">添加URL/HTML字符转义功能</a> (1)</li><li>2009/09/21 -- <a href="http://www.anysql.net/tools/four-extra-businees-charts.html" title="多支持了四种业务图">多支持了四种业务图</a> (0)</li><li>2009/07/28 -- <a href="http://www.anysql.net/tools/webchart-jfreechart-support.html" title="DataReport增加JfreeChart支持">DataReport增加JfreeChart支持</a> (7)</li><li>2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" title="DataReport的图片服务功能">DataReport的图片服务功能</a> (0)</li><li>2009/07/23 -- <a href="http://www.anysql.net/tools/webchart-cell-formater.html" title="更灵活的DataReport格式控制">更灵活的DataReport格式控制</a> (0)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=Umk71qwNeMw:USbnLQ2MYzA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Umk71qwNeMw:USbnLQ2MYzA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Umk71qwNeMw:USbnLQ2MYzA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=Umk71qwNeMw:USbnLQ2MYzA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Umk71qwNeMw:USbnLQ2MYzA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=Umk71qwNeMw:USbnLQ2MYzA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/Umk71qwNeMw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-page-cache.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-page-cache.html</feedburner:origLink></item>
		<item>
		<title>统一DataReport的Servlet</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/In-SvGY8OI0/webchart-one-java-servlet.html</link>
		<comments>http://www.anysql.net/tools/webchart-one-java-servlet.html#comments</comments>
		<pubDate>Mon, 28 Dec 2009 04:58:53 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=725</guid>
		<description><![CDATA[&#160; &#160; 在此以前的DataReport有三个Java Servlet, 分别管理数据展示, 安全登录及在线编辑三个方面, 集成程度不是很好. 周日下了一天的雪, 就利用了这个时间做了一下程序升级, 将三个Servlet合成了一个统一的Servlet, 当然功能没有减少, 全部集成到数据展示这个Servlet中. 

&#160; &#160; 为了集成安全登录和在线编辑功能, 保留了7个页面, 它们是: 


syslogin.&#60;FileExtention&#62;&#160;  -- Process Login
sysloginform.&#60;FileExtention&#62; -- Default Login Page
syspassword.&#60;FileExtention&#62;&#160; -- Change Password 
syspasswordform.&#60;FileExtention&#62; -- Default Password Page
syslogout.&#60;FileExtention&#62;&#160; -- Process Logout
syseditxsl.&#60;FileExtention&#62;&#160; -- XSLT for online editor page
sysedit.&#60;FileExtention&#62;&#160; -- Online Page Editor Page


&#160; &#160; 其中&#60;FileExtention&#62;在Java Web应用的配置文件中指定, 经此改进后的Web应用配置文件简洁如下: 


&#60;?xml version="1.0" encoding="ISO-8859-1"?&#62;
&#60;!DOCTYPE [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 在此以前的DataReport有三个Java Servlet, 分别管理数据展示, 安全登录及在线编辑三个方面, 集成程度不是很好. 周日下了一天的雪, 就利用了这个时间做了一下程序升级, 将三个Servlet合成了一个统一的Servlet, 当然功能没有减少, 全部集成到数据展示这个Servlet中. </p>

<p>&nbsp; &nbsp; 为了集成安全登录和在线编辑功能, 保留了7个页面, 它们是: </p>

<blockquote class="prefont">
syslogin.&lt;FileExtention&gt;&nbsp;  -- Process Login<br />
sysloginform.&lt;FileExtention&gt; -- Default Login Page<br />
syspassword.&lt;FileExtention&gt;&nbsp; -- Change Password <br />
syspasswordform.&lt;FileExtention&gt; -- Default Password Page<br />
syslogout.&lt;FileExtention&gt;&nbsp; -- Process Logout<br />
syseditxsl.&lt;FileExtention&gt;&nbsp; -- XSLT for online editor page<br />
sysedit.&lt;FileExtention&gt;&nbsp; -- Online Page Editor Page
</blockquote>

<p>&nbsp; &nbsp; 其中&lt;FileExtention&gt;在Java Web应用的配置文件中指定, 经此改进后的Web应用配置文件简洁如下: </p>

<blockquote class="prefont">
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<br />
&lt;!DOCTYPE web-app<br />
&nbsp; &nbsp; PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"<br />
&nbsp; &nbsp; "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;<br />
&lt;web-app&gt;<br />
&nbsp; &lt;display-name&gt;WebChart&lt;/display-name&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;description&gt;WebChart&lt;/description&gt;<br />
&nbsp; &lt;listener&gt;<br />
&nbsp; &nbsp; &lt;listener-class&gt;com.lfx.web.WebChartListener&lt;/listener-class&gt;<br />
&nbsp; &lt;/listener&gt;<br />
&nbsp; <br />
&nbsp; &lt;servlet&gt;<br />
&nbsp; &nbsp; &lt;servlet-name&gt;WebChart&lt;/servlet-name&gt;<br />
&nbsp; &nbsp; &lt;servlet-class&gt;com.lfx.web.WebChart2Servlet&lt;/servlet-class&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;init-param&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param-name&gt;FileExtention&lt;/param-name&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param-value&gt;.rhtml&lt;/param-value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/init-param&gt;<br />
&nbsp; &lt;/servlet&gt;<br />
<br />
&nbsp; &lt;servlet-mapping&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;servlet-name&gt;WebChart&lt;/servlet-name&gt;<br />
&nbsp; &nbsp; &lt;url-pattern&gt;*.rhtml&lt;/url-pattern&gt;<br />
&nbsp; &lt;/servlet-mapping&gt;<br />
<br />
&nbsp; &lt;session-config&gt;<br />
&nbsp; &nbsp; &lt;session-timeout&gt;900&lt;/session-timeout&gt; <br />
&nbsp; &lt;/session-config&gt;&nbsp;  <br />
&lt;/web-app&gt;<br />
</blockquote>

<p>&nbsp; &nbsp; 如果使用了登录功能, 在升级后需要调整与登录有关的部份代码, 这一次没有做到完全兼容, 这点需要注意. </p>

 <h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" title="逻辑连接层与物理连接层">逻辑连接层与物理连接层</a> (3)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-super-expression.html" title="DataReport中的超级表达式">DataReport中的超级表达式</a> (0)</li><li>2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" title="DataReport的重复值合并">DataReport的重复值合并</a> (0)</li><li>2010/01/05 -- <a href="http://www.anysql.net/tools/webchart-forall-loop.html" title="DataReport中的FORALL循环">DataReport中的FORALL循环</a> (0)</li><li>2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" title="DataReport中的Cache为王">DataReport中的Cache为王</a> (4)</li><li>2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" title="添加URL/HTML字符转义功能">添加URL/HTML字符转义功能</a> (1)</li><li>2009/09/21 -- <a href="http://www.anysql.net/tools/four-extra-businees-charts.html" title="多支持了四种业务图">多支持了四种业务图</a> (0)</li><li>2009/07/28 -- <a href="http://www.anysql.net/tools/webchart-jfreechart-support.html" title="DataReport增加JfreeChart支持">DataReport增加JfreeChart支持</a> (7)</li><li>2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" title="DataReport的图片服务功能">DataReport的图片服务功能</a> (0)</li><li>2009/07/23 -- <a href="http://www.anysql.net/tools/webchart-cell-formater.html" title="更灵活的DataReport格式控制">更灵活的DataReport格式控制</a> (0)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=In-SvGY8OI0:6qS3j8IFMDo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=In-SvGY8OI0:6qS3j8IFMDo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=In-SvGY8OI0:6qS3j8IFMDo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=In-SvGY8OI0:6qS3j8IFMDo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=In-SvGY8OI0:6qS3j8IFMDo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=In-SvGY8OI0:6qS3j8IFMDo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/In-SvGY8OI0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-one-java-servlet.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-one-java-servlet.html</feedburner:origLink></item>
		<item>
		<title>SQLULDR2的按列文本输出</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/wlu_P1ffvYE/sqluldr2-column-separator-option.html</link>
		<comments>http://www.anysql.net/tools/sqluldr2-column-separator-option.html#comments</comments>
		<pubDate>Fri, 25 Dec 2009 11:34:19 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[SQLLDR]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=724</guid>
		<description><![CDATA[&#160; &#160; 在一些非关系型数据库(NOSQL)中, 例如一些搜索引挚, 可以接受一种按列存贮的格式, 比如: 


&#60;row&#62;
COL1=column1 value
COL2=column2 value
......
&#60;/row&#62;


&#160; &#160; 为此SQLULDR2增加了三个选项, 分别用于指定行首(rowpre), 行尾(rowsuf), 及列名和列值之间的分隔符(colsep). 如下所示: 


rowpre&#160; = row prefix string for each line.
rowsuf&#160; = row sufix string for each line.
colsep&#160; = separator string between column name and value.


&#160; &#160; 和字段分隔符(field)及记录分隔符(record)结合起来, 总共有5种分隔符了, 对于任何一条记录, 其输出顺序如下: 


&#60;rowpre&#62;
&#160; [&#60;colmn 1 name&#62;&#60;colsep&#62;]&#60;column 1 value&#62;&#60;field&#62;
&#160; [&#60;colmn 2 name&#62;&#60;colsep&#62;]&#60;column 2 value&#62;&#60;field&#62;
&#160; ......
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 在一些非关系型数据库(NOSQL)中, 例如一些搜索引挚, 可以接受一种按列存贮的格式, 比如: </p>

<blockquote class="prefont">
&lt;row&gt;<br />
COL1=column1 value<br />
COL2=column2 value<br />
......<br />
&lt;/row&gt;<br />
</blockquote>

<p>&nbsp; &nbsp; 为此SQLULDR2增加了三个选项, 分别用于指定行首(rowpre), 行尾(rowsuf), 及列名和列值之间的分隔符(colsep). 如下所示: </p>

<blockquote class="prefont">
rowpre&nbsp; = row prefix string for each line.<br />
rowsuf&nbsp; = row sufix string for each line.<br />
colsep&nbsp; = separator string between column name and value.
</blockquote>

<p>&nbsp; &nbsp; 和字段分隔符(field)及记录分隔符(record)结合起来, 总共有5种分隔符了, 对于任何一条记录, 其输出顺序如下: </p>

<blockquote class="prefont">
&lt;rowpre&gt;<br />
&nbsp; [&lt;colmn 1 name&gt;&lt;colsep&gt;]&lt;column 1 value&gt;&lt;field&gt;<br />
&nbsp; [&lt;colmn 2 name&gt;&lt;colsep&gt;]&lt;column 2 value&gt;&lt;field&gt;<br />
&nbsp; ......<br />
&nbsp; [&lt;colmn n name&gt;&lt;colsep&gt;]&lt;column n value&gt;<br />
&lt;rowsuf&gt;<br />
&lt;record&gt;
</blockquote>

<p>&nbsp; &nbsp; 在最后一个列的后面并没有打印字段分隔符(field), 如果需要在最后一个字段后面加上字段分隔符, 可以通过在记录分隔符(record)中实现. 有了这5个灵活的选项后, 就可以生成格式更灵活的文本输出. 比如要按列文本输出: </p>

<blockquote class="prefont">
user=system/oracle<br />
query=select * from scott.dept<br />
file=-<br />
rowpre=&lt;row&gt;0x0a<br />
rowsuf=0x0a&lt;/row&gt;0x0a<br />
field=0x0a<br />
record=0x0a<br />
colsep==
</blockquote>

<p>&nbsp; &nbsp; 使用SQLULDR2导出时, 就生成了如下格式的文本, 可能就是一些搜索引挚或NOSQL所需要的格式. </p>

<blockquote class="prefont">
&lt;row&gt;<br />
DEPTNO=10<br />
DNAME=ACCOUNTING<br />
LOC=NEW YORK<br />
&lt;/row&gt;<br />
<br />
&lt;row&gt;<br />
DEPTNO=20<br />
DNAME=RESEARCH<br />
LOC=DALLAS<br />
&lt;/row&gt;<br />
......
</blockquote>

<p>&nbsp; &nbsp; 比如最近流行的jason文件格式, 我也可以考虑进去, 或者这5个选项是不是已经支持了. 加上上一篇的自定义转义符处理, 输出功能已经相当强劲了. </p>

<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2010/02/08 -- <a href="http://www.anysql.net/tools/sqluldr2-form-display.html" title="SQLULDR2也可改善用户体验">SQLULDR2也可改善用户体验</a> (0)</li><li>2010/01/15 -- <a href="http://www.anysql.net/tools/sqluldr2-create-table-syntax.html" title="两个用户的SQLULDR2需求">两个用户的SQLULDR2需求</a> (1)</li><li>2009/12/25 -- <a href="http://www.anysql.net/tools/sqluldr2-customized-escape-chars.html" title="SQLULDR2的自定义转义符处理">SQLULDR2的自定义转义符处理</a> (2)</li><li>2009/10/27 -- <a href="http://www.anysql.net/tools/sqluldr2-more-escape-chars.html" title="将SQLULDR2转义符进行到底">将SQLULDR2转义符进行到底</a> (3)</li><li>2009/10/26 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-escape-char.html" title="SQLULDR2处理MySQL转义符">SQLULDR2处理MySQL转义符</a> (1)</li><li>2009/08/31 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-null-value.html" title="SQLULDR2处理MySQL的空值">SQLULDR2处理MySQL的空值</a> (2)</li><li>2009/04/02 -- <a href="http://www.anysql.net/tools/sqluldr2_license.html" title="给SQLULDR2加上Key保护">给SQLULDR2加上Key保护</a> (6)</li><li>2008/01/25 -- <a href="http://www.anysql.net/tools/ociuldr_update_20080125.html" title="ociuldr更新(2008/01/25)">ociuldr更新(2008/01/25)</a> (13)</li><li>2007/08/22 -- <a href="http://www.anysql.net/tools/ociuldr_option_array.html" title="ociuldr的更新, 为了更好的long类型支持">ociuldr的更新, 为了更好的long类型支持</a> (1)</li><li>2007/01/02 -- <a href="http://www.anysql.net/tools/ociuldr_bind_variable.html" title="在ociuldr的SQL中使用绑定变量">在ociuldr的SQL中使用绑定变量</a> (4)</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=wlu_P1ffvYE:GFXOhSm1gas:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=wlu_P1ffvYE:GFXOhSm1gas:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=wlu_P1ffvYE:GFXOhSm1gas:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=wlu_P1ffvYE:GFXOhSm1gas:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=wlu_P1ffvYE:GFXOhSm1gas:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=wlu_P1ffvYE:GFXOhSm1gas:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/wlu_P1ffvYE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/sqluldr2-column-separator-option.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/sqluldr2-column-separator-option.html</feedburner:origLink></item>
	</channel>
</rss>
