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

<channel>
	<title>Tin&#039;s Blog &#187; Database</title>
	<atom:link href="http://www.diamondtin.com/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.diamondtin.com</link>
	<description>you are coming a long way...</description>
	<lastBuildDate>Thu, 05 Jan 2012 00:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>在 OSX 10.5 (Leopard) 安装 MySQL-Python</title>
		<link>http://www.diamondtin.com/2008/install-mysql-python-osx-105-leopard-%e5%ae%89%e8%a3%85-mysql-python/</link>
		<comments>http://www.diamondtin.com/2008/install-mysql-python-osx-105-leopard-%e5%ae%89%e8%a3%85-mysql-python/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 15:12:10 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[Tech.技术]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://tin.zztin.com/?p=193</guid>
		<description><![CDATA[友人nicholas.ding说： 尝试安装了一下 MySQL-python，发现竟然编译不过去，在网上搜了一下，找到了一个 workaround，应该是作者疏忽了。 原文在：http://www.keningle.com/?p=11 需要下载源码自行编译，首... ]]></description>
			<content:encoded><![CDATA[<div class="entry">
<p>友人nicholas.ding说：</p>
<p>尝试安装了一下 MySQL-python，发现竟然编译不过去，在网上搜了一下，找到了一个 workaround，应该是作者疏忽了。</p>
<p>原文在：http://www.keningle.com/?p=11</p>
<p>需要下载源码自行编译，首先修改 _mysql.c，删除从 34 行开始的 3 行。</p>
<pre>#ifndef uint
#define uint unsigned int
#endif
</pre>
<p>将</p>
<pre>uint port = MYSQL_PORT;
uint client_flag = 0;
</pre>
<p>修改为</p>
<pre>unsigned int port = MYSQL_PORT;
unsigned int client_flag = 0;
</pre>
<p>创建一个符号链接</p>
<pre>$ sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
</pre>
<p>最后编译安装就可以了</p>
<pre>$ python setup.py install

在我这里这样还是不可以，最后发现还要做如下改动，原因可能是我使用了mysql官方提供的package安装mysql，结果路径有些差异造成的：
在安装前还需要修改setup_posix.py，把mysql_config.path = "mysql_config"修改为：
mysql_config.path = "/usr/local/mysql/bin/mysql_config"

然后再sudo python setup.py install就OK了。
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2008/install-mysql-python-osx-105-leopard-%e5%ae%89%e8%a3%85-mysql-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于存储过程和直接执行SQL对比</title>
		<link>http://www.diamondtin.com/2006/%e5%85%b3%e4%ba%8e%e5%ad%98%e5%82%a8%e8%bf%87%e7%a8%8b%e5%92%8c%e7%9b%b4%e6%8e%a5%e6%89%a7%e8%a1%8csql%e5%af%b9%e6%af%94/</link>
		<comments>http://www.diamondtin.com/2006/%e5%85%b3%e4%ba%8e%e5%ad%98%e5%82%a8%e8%bf%87%e7%a8%8b%e5%92%8c%e7%9b%b4%e6%8e%a5%e6%89%a7%e8%a1%8csql%e5%af%b9%e6%af%94/#comments</comments>
		<pubDate>Mon, 13 Feb 2006 20:57:00 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[Tech.技术]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://tin.zztin.com/2006/02/%e5%85%b3%e4%ba%8e%e5%ad%98%e5%82%a8%e8%bf%87%e7%a8%8b%e5%92%8c%e7%9b%b4%e6%8e%a5%e6%89%a7%e8%a1%8csql%e5%af%b9%e6%af%94/</guid>
		<description><![CDATA[读http://www.blogjava.net/waterye/archive/2006/01/13/27952.html的感想： 关于存储过程和直接执行SQL：需要注意以下几点：1、从数据库角度，存储过程总是要比它所对应的纯SQL要慢。2、存储过程目的在于简... ]]></description>
			<content:encoded><![CDATA[<div>读<a href="http://www.blogjava.net/waterye/archive/2006/01/13/27952.html">http://www.blogjava.net/waterye/archive/2006/01/13/27952.html</a>的感想：</div>
<div>关于存储过程和直接执行SQL：<br />需要注意以下几点：<br />1、从数据库角度，存储过程总是要比它所对应的纯SQL要慢。<br />2、存储过程目的在于简化特别复杂的SQL复合应用的场景。<br />3、但是对于一个拥有多条SQL的存储过程来说，它可以提升效率。因为减少了SQL传输的网络延迟。所以说SQL复杂时，存储过程可以增加实际的运行效率。注意对比第1条，第一条是对应服务器调用，这条对应实际的网络环境。<br />4、还有就是存储过程很容易减少多条SQL之间数据传递的麻烦（有可能带来没有实际意义的中间变量），可以在服务器端把它们隐藏。<br />所以我想应该考虑这几点来选择存储过程：<br />1、拥有复杂的数据操作，需要SQL复合。<br />2、中间传递的临时数据过多或者过大的时候。</div>
<div> </div>
<div>使用存储过程的Java代码：JDBC call Stored Procedure</div>
<div>CallableStatement cstmt = conn.prepareCall(&quot;{ ? = call md5( ? ) }&quot;);<br />// CallableStatement cstmt = conn.prepareCall(&quot;begin ? := md5( ? ); end;&quot;); // oracle syntax<br />cstmt.registerOutParameter(1, Types.VARCHAR); // set out parameters<br />cstmt.setString(2, &quot;idea&quot;); // set in parameters<br />cstmt.execute();<br />String md5Str = cstmt.getString(1); // Getting OUT Parameter Values<br />cstmt.close();</div>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2006/%e5%85%b3%e4%ba%8e%e5%ad%98%e5%82%a8%e8%bf%87%e7%a8%8b%e5%92%8c%e7%9b%b4%e6%8e%a5%e6%89%a7%e8%a1%8csql%e5%af%b9%e6%af%94/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

