﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-希望与大家一起分享Java-文章分类-数据库技术</title><link>http://www.blogjava.net/haoqingshi/category/2740.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 02 Mar 2007 18:47:15 GMT</lastBuildDate><pubDate>Fri, 02 Mar 2007 18:47:15 GMT</pubDate><ttl>60</ttl><item><title>MySQL的几个问题</title><link>http://www.blogjava.net/haoqingshi/articles/52487.html</link><dc:creator>Java&amp;Inter</dc:creator><author>Java&amp;Inter</author><pubDate>Tue, 13 Jun 2006 07:43:00 GMT</pubDate><guid>http://www.blogjava.net/haoqingshi/articles/52487.html</guid><wfw:comment>http://www.blogjava.net/haoqingshi/comments/52487.html</wfw:comment><comments>http://www.blogjava.net/haoqingshi/articles/52487.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/haoqingshi/comments/commentRss/52487.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/haoqingshi/services/trackbacks/52487.html</trackback:ping><description><![CDATA[
		<p>
				<font size="2">    最近由于做一个小型的项目，用到了Mysql，遇到了一些问题，到网上google了一下，找到了一些解决的方法，希望对您有些帮助，呵呵。 <br /><br /><span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore">1.<span style="FONT: 7pt 'Times New Roman'">       </span></span></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在安装</span><span lang="EN-US">Mysql</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之后，在</span><span lang="EN-US">service</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里面没有出现</span><span lang="EN-US">mysql</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的服务<br /></span></font>
				<span lang="EN-US">
						<font size="2">        C:\mysql\bin\mysqld –install<br /></font>
				</span>
				<font size="2">
						<span lang="EN-US">        C:\mysql\bin\mysqld-nt –standalone</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（不想把</span>
						<span lang="EN-US">mysql</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为一个服务启动）<br /><br /></span>
				</font>
				<font size="2">
						<span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'">
								<span style="mso-list: Ignore">2.<span style="FONT: 7pt 'Times New Roman'">       </span></span>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当把</span>
						<span lang="EN-US">mysql</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装到</span>
						<span lang="EN-US">c</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">盘意外的地方的时候，启动</span>
						<span lang="EN-US">mysql</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">会报错：</span>
						<span lang="EN-US" style="COLOR: black; FONT-FAMILY: Arial; mso-bidi-font-size: 10.5pt">1067</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
						<font size="2">解决方案：<br /></font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Arial">
						<font size="2">you seemed have your mysql installed in windows. so this problem may becaused if you're not installing mysql in c:\mysql.<br /><br />you can simply copy all files to c:\mysql   or<br />create a file call my.ini(store it in %windows%) OR my.cnf (store it in c:\) and the followingcontent should be in the file<br />assume you have mysql ind:\mysql<br /><br /></font>
						<font size="2">
								<b style="mso-bidi-font-weight: normal">[mysqld]<br />#set basedir to the installationpath<br />basedir=d:/mysql<br />datadir=d:/mysql/data<br /></b>
								<br />note that the forward slashes (/) are being used.</font>
				</span>
				<font size="2">
				</font>
		</p>
<img src ="http://www.blogjava.net/haoqingshi/aggbug/52487.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/haoqingshi/" target="_blank">Java&Inter</a> 2006-06-13 15:43 <a href="http://www.blogjava.net/haoqingshi/articles/52487.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>恼人的oracle xmldb--Oracle与Tomcat的端口冲突</title><link>http://www.blogjava.net/haoqingshi/articles/20187.html</link><dc:creator>Java&amp;Inter</dc:creator><author>Java&amp;Inter</author><pubDate>Thu, 17 Nov 2005 01:59:00 GMT</pubDate><guid>http://www.blogjava.net/haoqingshi/articles/20187.html</guid><wfw:comment>http://www.blogjava.net/haoqingshi/comments/20187.html</wfw:comment><comments>http://www.blogjava.net/haoqingshi/articles/20187.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/haoqingshi/comments/commentRss/20187.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/haoqingshi/services/trackbacks/20187.html</trackback:ping><description><![CDATA[<P>恼人的oracle xmldb,一装完oracle,默认xmldb就占了8080端口</P>
<P>1.使用sys登录Oracle，利用dbms_xdb修改端口设置</P>
<P>&nbsp; SQL&gt; -- Change the HTTP/WEBDAV port from 8080 to 8081<BR>&nbsp; SQL&gt; <B>call dbms_xdb.cfg_update(updateXML(</B><BR>&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>&nbsp; dbms_xdb.cfg_get()</B><BR>&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>, '/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()'</B><BR>&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>, 8081))</B><BR>&nbsp;&nbsp;&nbsp; 5&nbsp; <B>/</B><BR><BR>&nbsp; Call completed. <BR><BR><BR>&nbsp; SQL&gt; -- Change the FTP port from 2100 to 2111<BR>&nbsp; SQL&gt; <B>call dbms_xdb.cfg_update(updateXML(</B><BR>&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>&nbsp; dbms_xdb.cfg_get()</B><BR>&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>, '/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()'</B><BR>&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>, 2111))</B><BR>&nbsp;&nbsp;&nbsp; 5&nbsp; <B>/</B><BR><BR>&nbsp; Call completed. <BR><BR><BR>&nbsp; SQL&gt; <B>COMMIT;</B><BR><BR>&nbsp; Commit complete. <BR><BR><BR>&nbsp; SQL&gt; <B>EXEC dbms_xdb.cfg_refresh;</B><BR><BR>&nbsp; PL/SQL procedure successfully completed.</P>
<P><BR>2.使用OEM console，选择数据库，XML Database，Configuration。更改XDB的有关设置。</P>3.去掉数据库的初始化参数：&nbsp; dispatchers='(PROTOCOL=TCP) (SERVICE=XDB)'，将会禁止XDB的http和ftp服务<A><BR></A><BR>4.呵呵,当然就是改变Tomcat的Port了哦<img src ="http://www.blogjava.net/haoqingshi/aggbug/20187.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/haoqingshi/" target="_blank">Java&Inter</a> 2005-11-17 09:59 <a href="http://www.blogjava.net/haoqingshi/articles/20187.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle数据库的Blob,LongRaw类型的访问</title><link>http://www.blogjava.net/haoqingshi/articles/10328.html</link><dc:creator>Java&amp;Inter</dc:creator><author>Java&amp;Inter</author><pubDate>Wed, 17 Aug 2005 05:13:00 GMT</pubDate><guid>http://www.blogjava.net/haoqingshi/articles/10328.html</guid><wfw:comment>http://www.blogjava.net/haoqingshi/comments/10328.html</wfw:comment><comments>http://www.blogjava.net/haoqingshi/articles/10328.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/haoqingshi/comments/commentRss/10328.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/haoqingshi/services/trackbacks/10328.html</trackback:ping><description><![CDATA[<P><FONT size=2>在现在很多的应用中，数据库会经常要存取一些大容量的数据，典型的代表：Blob,LongRaw<BR>本文主要介绍这两种类型存取图形的操作(jsp页面的访问)。<BR><BR>一&nbsp; Blob<BR>&nbsp;&nbsp;&nbsp; 建立Table:</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">CREATE&nbsp;TABLE&nbsp;PHOTO<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>(<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;PHOTO_NO&nbsp;&nbsp;VARCHAR2(</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NOT&nbsp;NULL,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;IMAGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BLOB<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>)</SPAN></DIV></DIV></FONT>&nbsp; <BR>&nbsp; showimage.jsp<BR>&nbsp; 
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;%</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG id=Codehighlighter1_5_56_Open_Image onclick="this.style.display='none'; Codehighlighter1_5_56_Open_Text.style.display='none'; Codehighlighter1_5_56_Closed_Image.style.display='inline'; Codehighlighter1_5_56_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_5_56_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_5_56_Closed_Text.style.display='none'; Codehighlighter1_5_56_Open_Image.style.display='inline'; Codehighlighter1_5_56_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;</FONT></SPAN><SPAN id=Codehighlighter1_5_56_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><FONT size=2>/**/</FONT></SPAN><SPAN id=Codehighlighter1_5_56_Open_Text><SPAN style="COLOR: #008000"><FONT size=2>/*</FONT></SPAN><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;從Oracle數據庫中讀取Blob的類型,並且在jsp頁面中顯示出來<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;</FONT></SPAN><SPAN style="COLOR: #008000"><FONT size=2>*/</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><SPAN style="COLOR: #000000"><FONT size=2>%&gt;</FONT></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;contentType</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">text/html;&nbsp;charset=BIG5</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;import</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.io.*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;import</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.sql.*,&nbsp;javax.sql.*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;import</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.util.*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;import</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.math.*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><SPAN style="COLOR: #000000"><FONT size=2>&lt;%</FONT></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>String&nbsp;photo_no&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;request.getParameter(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">photo_no</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>//</SPAN><SPAN style="COLOR: #0000ff">out</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">.print(photo_no);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Oracle連結</SPAN></FONT><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&nbsp;Class.forName(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">oracle.jdbc.driver.OracleDriver</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;String&nbsp;url</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">jdbc:oracle:thin:@IP:1521:SID</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;String&nbsp;userName</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">user</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;String&nbsp;pwd</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"pwd</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;Connection&nbsp;conn</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">DriverManager.getConnection(url,userName,pwd);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_794_1226_Open_Image onclick="this.style.display='none'; Codehighlighter1_794_1226_Open_Text.style.display='none'; Codehighlighter1_794_1226_Closed_Image.style.display='inline'; Codehighlighter1_794_1226_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_794_1226_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_794_1226_Closed_Text.style.display='none'; Codehighlighter1_794_1226_Open_Image.style.display='inline'; Codehighlighter1_794_1226_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">try</SPAN><SPAN id=Codehighlighter1_794_1226_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_794_1226_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>Statement&nbsp;stmt&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;conn.createStatement();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>String&nbsp;sql&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;SELECT&nbsp;*&nbsp;FROM&nbsp;PHOTO&nbsp;WHERE&nbsp;photo_no&nbsp;=&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;photo_no;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>ResultSet&nbsp;rs&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;stmt.executeQuery(sql);<BR><IMG id=Codehighlighter1_957_1202_Open_Image onclick="this.style.display='none'; Codehighlighter1_957_1202_Open_Text.style.display='none'; Codehighlighter1_957_1202_Closed_Image.style.display='inline'; Codehighlighter1_957_1202_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_957_1202_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_957_1202_Closed_Text.style.display='none'; Codehighlighter1_957_1202_Open_Image.style.display='inline'; Codehighlighter1_957_1202_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(rs.next())&nbsp;</SPAN><SPAN id=Codehighlighter1_957_1202_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_957_1202_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>Blob&nbsp;b&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;rs.getBlob(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">image</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">long</SPAN><SPAN style="COLOR: #000000">&nbsp;size&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;b.length();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">out.print(size);</SPAN></FONT><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">byte</SPAN><SPAN style="COLOR: #000000">[]&nbsp;bs&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;b.getBytes(</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">,&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">)size);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>response.setContentType(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">image/jpeg</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>OutputStream&nbsp;outs&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;response.getOutputStream();&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>outs.write(bs);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>outs.flush();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>rs.close();&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG id=Codehighlighter1_1209_1224_Open_Image onclick="this.style.display='none'; Codehighlighter1_1209_1224_Open_Text.style.display='none'; Codehighlighter1_1209_1224_Closed_Image.style.display='inline'; Codehighlighter1_1209_1224_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1209_1224_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1209_1224_Closed_Text.style.display='none'; Codehighlighter1_1209_1224_Open_Image.style.display='inline'; Codehighlighter1_1209_1224_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_1209_1224_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_1209_1224_Open_Text><SPAN style="COLOR: #000000"><FONT size=2>{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>rs.close();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG id=Codehighlighter1_1235_1251_Open_Image onclick="this.style.display='none'; Codehighlighter1_1235_1251_Open_Text.style.display='none'; Codehighlighter1_1235_1251_Closed_Image.style.display='inline'; Codehighlighter1_1235_1251_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_1235_1251_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1235_1251_Closed_Text.style.display='none'; Codehighlighter1_1235_1251_Open_Image.style.display='inline'; Codehighlighter1_1235_1251_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">finally</SPAN><SPAN id=Codehighlighter1_1235_1251_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_1235_1251_Open_Text><SPAN style="COLOR: #000000"><FONT size=2>{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>conn.close();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><SPAN style="COLOR: #000000"><FONT size=2>%&gt;</FONT></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN></DIV></DIV><BR>index.html<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">HTML</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">HEAD</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">TITLE</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">图像测试</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">TITLE</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">HEAD</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">BODY</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">TABLE</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">TR</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">TD</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">图像测试</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">TD</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">TR</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">TR</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">TD</SPAN><SPAN style="COLOR: #000000">&gt;&lt;</SPAN><SPAN style="COLOR: #000000">img&nbsp;src</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">showimage.jsp?photo_no=1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;&lt;/</SPAN><SPAN style="COLOR: #000000">TD</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">TR</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">TABLE</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">BODY</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">HTML</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN></DIV></DIV><BR>&nbsp;<FONT size=2>二 LongRaw&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 建立Table:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">CREATE&nbsp;TABLE&nbsp;PHOTO_2<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>(<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;PHOTO_NO&nbsp;&nbsp;VARCHAR2(</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NOT&nbsp;NULL,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;IMAGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LONG&nbsp;RAW<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>)</SPAN></DIV></DIV></FONT><BR>&nbsp;showimage.jsp<BR>&nbsp; 
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;%</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG id=Codehighlighter1_5_59_Open_Image onclick="this.style.display='none'; Codehighlighter1_5_59_Open_Text.style.display='none'; Codehighlighter1_5_59_Closed_Image.style.display='inline'; Codehighlighter1_5_59_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_5_59_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_5_59_Closed_Text.style.display='none'; Codehighlighter1_5_59_Open_Image.style.display='inline'; Codehighlighter1_5_59_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;</FONT></SPAN><SPAN id=Codehighlighter1_5_59_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><FONT size=2>/**/</FONT></SPAN><SPAN id=Codehighlighter1_5_59_Open_Text><SPAN style="COLOR: #008000"><FONT size=2>/*</FONT></SPAN><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;從Oracle數據庫中讀取LongRaw的類型,並且在jsp頁面中顯示出來<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;</FONT></SPAN><SPAN style="COLOR: #008000"><FONT size=2>*/</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><SPAN style="COLOR: #000000"><FONT size=2>%&gt;</FONT></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;contentType</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">text/html;&nbsp;charset=BIG5</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;import</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.io.*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;import</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.sql.*,&nbsp;javax.sql.*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;import</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.util.*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;page&nbsp;import</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.math.*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></FONT><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><SPAN style="COLOR: #000000"><FONT size=2>&lt;%</FONT></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>String&nbsp;photo_no&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;request.getParameter(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">photo_no</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">out</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">.print(photo_no);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Oracle連結</SPAN></FONT><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&nbsp;Class.forName(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">oracle.jdbc.driver.OracleDriver</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;String&nbsp;url</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">jdbc:oracle:thin:@IP:1521:SID</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;String&nbsp;userName</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">user</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;String&nbsp;pwd</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">pwd</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;Connection&nbsp;conn</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">DriverManager.getConnection(url,userName,pwd);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_797_1152_Open_Image onclick="this.style.display='none'; Codehighlighter1_797_1152_Open_Text.style.display='none'; Codehighlighter1_797_1152_Closed_Image.style.display='inline'; Codehighlighter1_797_1152_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_797_1152_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_797_1152_Closed_Text.style.display='none'; Codehighlighter1_797_1152_Open_Image.style.display='inline'; Codehighlighter1_797_1152_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">try</SPAN><SPAN id=Codehighlighter1_797_1152_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_797_1152_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>Statement&nbsp;stmt&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;conn.createStatement();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>String&nbsp;sql&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;SELECT&nbsp;*&nbsp;FROM&nbsp;PHOTO_2&nbsp;WHERE&nbsp;photo_no&nbsp;=&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;photo_no;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>ResultSet&nbsp;rs&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;stmt.executeQuery(sql);<BR><IMG id=Codehighlighter1_962_1128_Open_Image onclick="this.style.display='none'; Codehighlighter1_962_1128_Open_Text.style.display='none'; Codehighlighter1_962_1128_Closed_Image.style.display='inline'; Codehighlighter1_962_1128_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_962_1128_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_962_1128_Closed_Text.style.display='none'; Codehighlighter1_962_1128_Open_Image.style.display='inline'; Codehighlighter1_962_1128_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(rs.next())&nbsp;</SPAN><SPAN id=Codehighlighter1_962_1128_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_962_1128_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">byte</SPAN><SPAN style="COLOR: #000000">&nbsp;bs[]</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">rs.getBytes(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">image</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>response.setContentType(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">image/jpeg</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>OutputStream&nbsp;outs&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;response.getOutputStream();&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>outs.write(bs);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>outs.flush();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>rs.close();&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG id=Codehighlighter1_1135_1150_Open_Image onclick="this.style.display='none'; Codehighlighter1_1135_1150_Open_Text.style.display='none'; Codehighlighter1_1135_1150_Closed_Image.style.display='inline'; Codehighlighter1_1135_1150_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1135_1150_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1135_1150_Closed_Text.style.display='none'; Codehighlighter1_1135_1150_Open_Image.style.display='inline'; Codehighlighter1_1135_1150_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_1135_1150_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_1135_1150_Open_Text><SPAN style="COLOR: #000000"><FONT size=2>{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>rs.close();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG id=Codehighlighter1_1161_1177_Open_Image onclick="this.style.display='none'; Codehighlighter1_1161_1177_Open_Text.style.display='none'; Codehighlighter1_1161_1177_Closed_Image.style.display='inline'; Codehighlighter1_1161_1177_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_1161_1177_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1161_1177_Closed_Text.style.display='none'; Codehighlighter1_1161_1177_Open_Image.style.display='inline'; Codehighlighter1_1161_1177_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">finally</SPAN><SPAN id=Codehighlighter1_1161_1177_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_1161_1177_Open_Text><SPAN style="COLOR: #000000"><FONT size=2>{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>conn.close();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN><SPAN style="COLOR: #000000"><FONT size=2>%&gt;</FONT></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN></DIV></DIV><BR>&nbsp; <FONT size=2><STRONG>PS:这样的访问必须要保证这些Blog或LongRaw类型的字段中存储的是图片文件。</STRONG></FONT><img src ="http://www.blogjava.net/haoqingshi/aggbug/10328.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/haoqingshi/" target="_blank">Java&Inter</a> 2005-08-17 13:13 <a href="http://www.blogjava.net/haoqingshi/articles/10328.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle中如何删除重复的纪录</title><link>http://www.blogjava.net/haoqingshi/articles/9972.html</link><dc:creator>Java&amp;Inter</dc:creator><author>Java&amp;Inter</author><pubDate>Fri, 12 Aug 2005 08:51:00 GMT</pubDate><guid>http://www.blogjava.net/haoqingshi/articles/9972.html</guid><wfw:comment>http://www.blogjava.net/haoqingshi/comments/9972.html</wfw:comment><comments>http://www.blogjava.net/haoqingshi/articles/9972.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/haoqingshi/comments/commentRss/9972.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/haoqingshi/services/trackbacks/9972.html</trackback:ping><description><![CDATA[如何查找重复的纪录：<BR>&nbsp; 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: Ó×Ô²; mso-bidi-font-family: Ó×Ô²; mso-font-kerning: 0pt">&nbsp;SELECT * FROM TABLE_NAME<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: Ó×Ô²; mso-bidi-font-family: Ó×Ô²; mso-font-kerning: 0pt">WHERE ROWID!=(SELECT MAX(ROWID) FROM TABLE_NAME D<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: Ó×Ô²; mso-bidi-font-family: Ó×Ô²; mso-font-kerning: 0pt">WHERE TABLE_NAME.COL1=D.COL1 AND TABLE_NAME.COL2=D.COL2);<BR><o:p><BR></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Ó×Ô²; mso-bidi-font-family: Ó×Ô²; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN><SPAN style="FONT-FAMILY: 衿埴; mso-bidi-font-family: 衿埴; mso-font-kerning: 0pt; mso-hansi-font-family: Ó×Ô²">如何删除重复记录？<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: Ó×Ô²; mso-bidi-font-family: Ó×Ô²; mso-font-kerning: 0pt">DELETE FROM TABLE_NAME<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: Ó×Ô²; mso-bidi-font-family: Ó×Ô²; mso-font-kerning: 0pt">WHERE ROWID!=(SELECT MAX(ROWID) FROM TABLE_NAME D<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: Ó×Ô²; mso-bidi-font-family: Ó×Ô²; mso-font-kerning: 0pt">WHERE TABLE_NAME.COL1=D.COL1 AND TABLE_NAME.COL2=D.COL2)</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Ó×Ô²; mso-bidi-font-family: Ó×Ô²; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"></o:p></SPAN></P><img src ="http://www.blogjava.net/haoqingshi/aggbug/9972.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/haoqingshi/" target="_blank">Java&Inter</a> 2005-08-12 16:51 <a href="http://www.blogjava.net/haoqingshi/articles/9972.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>