﻿<?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-谷文天空</title><link>http://www.blogjava.net/lcgxc/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 07:54:21 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 07:54:21 GMT</pubDate><ttl>60</ttl><item><title>解决SQLServer Unsupported method: ResultSet.last的问题</title><link>http://www.blogjava.net/lcgxc/archive/2009/02/26/256800.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Thu, 26 Feb 2009 05:29:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/archive/2009/02/26/256800.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/256800.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/archive/2009/02/26/256800.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/256800.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/256800.html</trackback:ping><description><![CDATA[<div>在数据库查询中，一般我们都是先获得查询的结果集，然后通过ResultSet.last (/rs.last)&nbsp;将游标移到记录集末，再用ResultSet.getRow() 函数来获得最后一条记录的行号，由此来获得该记录集的数量。
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这个方法在oracle 数据库中运行正常，但是换到MS SQL中就会报出</p>
<span style="font-weight: bold">
<p>java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported method: ResultSet.last</p>
<font size="2">
<h3><font size="2">这样的错误。</font></h3>
</font></span>
<p>解决办法是：</p>
<p>Statement变量要按照如下设置：</p>
<p>stmt = conn.createStatement(<strong>ResultSet.TYPE_SCROLL_SENSITIVE</strong>, ResultSet.CONCUR_UPDATABLE);&nbsp;&nbsp;&nbsp; </p>
<p>或： </p>
<p>Statement stmt = conn.createStatementResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);</p>
<p>但这样做是将游标移到最后一条记录的位置比较耗时，少量的记录不太明显。以下是测试的记录：&nbsp;</p>
<p>1，用COUNT函数方法，该方法是在查询中通过SQL的统计函数COUNT来统计查询的记录数。 <br />
2，用ResultSet.last()方法。 <br />
3，环境为XP，SQL SERVER 2000,JAVA <br />
4，记录数：100000。 <br />
5，结果：COUNT方法用时270毫秒；ResultSet.last()方法用时31846毫秒,大约32秒。 <br />
这个结果大家是不是大吃一惊。<br />
&nbsp;<font color="#000099"><strong>原文地址</strong></font> <a href="http://blog.csdn.net/yoyo_yaya/archive/2007/01/29/1497112.aspx" target="_blank">http://blog.csdn.net/yoyo_yaya/archive/2007/01/29/1497112.aspx</a> <br />
</p>
</div>
<img src ="http://www.blogjava.net/lcgxc/aggbug/256800.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2009-02-26 13:29 <a href="http://www.blogjava.net/lcgxc/archive/2009/02/26/256800.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jsp+mysql连接</title><link>http://www.blogjava.net/lcgxc/articles/140059.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Mon, 27 Aug 2007 09:30:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/articles/140059.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/140059.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/articles/140059.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/140059.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/140059.html</trackback:ping><description><![CDATA[<p>import java.sql.Connection;<br>import java.sql.DriverManager;<br>import java.sql.ResultSet;<br>import java.sql.Statement;</p>
<p>public class mysqlceshi {<br>&nbsp;public static&nbsp; void main(String para[]){<br>&nbsp;&nbsp; Connection conn=null;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try{<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Class.forName("com.mysql.jdbc.Driver");<br>&nbsp;&nbsp;&nbsp;conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/hospital","root","sa");<br>&nbsp;&nbsp;&nbsp;System.out.println("234");<br>&nbsp;&nbsp;&nbsp;Statement stmt=conn.createStatement();<br>&nbsp;&nbsp;&nbsp;ResultSet rs=stmt.executeQuery("SELECT COUNT(*) FROM administrator");<br>&nbsp;&nbsp;&nbsp;System.out.println("24356");<br>&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;catch(Exception ex){<br>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(ex);<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;}<br>}<br></p>
<img src ="http://www.blogjava.net/lcgxc/aggbug/140059.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-08-27 17:30 <a href="http://www.blogjava.net/lcgxc/articles/140059.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse+MyEclipse+Tomcat/JBoss配置手記 </title><link>http://www.blogjava.net/lcgxc/articles/140005.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Mon, 27 Aug 2007 08:27:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/articles/140005.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/140005.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/articles/140005.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/140005.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/140005.html</trackback:ping><description><![CDATA[<a href="http://blog.csdn.net/success_dream/archive/2007/03/03/1519989.aspx">http://blog.csdn.net/success_dream/archive/2007/03/03/1519989.aspx</a>
<img src ="http://www.blogjava.net/lcgxc/aggbug/140005.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-08-27 16:27 <a href="http://www.blogjava.net/lcgxc/articles/140005.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>配置JBOSS4.0服务器开发JSP</title><link>http://www.blogjava.net/lcgxc/articles/140004.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Mon, 27 Aug 2007 08:25:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/articles/140004.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/140004.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/articles/140004.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/140004.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/140004.html</trackback:ping><description><![CDATA[<a href="http://www.54bk.com/user1/6944/archives/2005/16544.html">http://www.54bk.com/user1/6944/archives/2005/16544.html</a>
<img src ="http://www.blogjava.net/lcgxc/aggbug/140004.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-08-27 16:25 <a href="http://www.blogjava.net/lcgxc/articles/140004.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在jsp中使用smartupload组件上传文件</title><link>http://www.blogjava.net/lcgxc/archive/2007/07/27/132874.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Fri, 27 Jul 2007 11:34:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/archive/2007/07/27/132874.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/132874.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/archive/2007/07/27/132874.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/132874.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/132874.html</trackback:ping><description><![CDATA[<font size=4>&nbsp;jsp对上传文件的支持不象php中支持的那么好，直接做成了函数，也不象asp中要通过组件才能实现。jsp中可以通过javabean来实现。但是我们没有必要自己去写一个上载的bean，在网上已经有了很多成型的技术，smartupload就是其中的一个。但是smartupload是将文件先读到服务器的内存中，所以上传太大的文件（超过100兆）有可能会出问题，也算是一个美中不足吧：）</font>
<p align=left><font size=4>&nbsp;&nbsp; 先说一下提交的页面，smartupload组件要求用字节流的方式来提交&lt;FORM action="upload.jsp"&nbsp; encType=multipart/form-data method=post&gt;。下面就是个例子upload.htm：</font></p>
<p align=left><font size=4>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;<br>&lt;!-- saved from url=(0057)</font><a href="http://localhost:8080/jspsmartfile/jsp/uploadTemplate.jsp"><font color=#0000ff size=4><u>http://localhost:8080/jspsmartfile/jsp/uploadTemplate.jsp</u></font></a><font size=4> --&gt;<br>&lt;HTML&gt;&lt;HEAD&gt;<br>&lt;META content="text/html; charset=gb2312" http-equiv=Content-Type&gt;<br>&lt;META content="MSHTML 5.00.2920.0" name=GENERATOR&gt;&lt;/HEAD&gt;<br>&lt;BODY bgColor=#e6e6e6&gt;&lt;BR&gt;<br>&lt;FORM action="upload.jsp"&nbsp; encType=multipart/form-data method=post&gt;<br>&lt;TABLE&gt;<br>&nbsp; &lt;TBODY&gt;<br>&nbsp; &lt;TR&gt;<br>&nbsp;&nbsp;&nbsp; &lt;TD&gt;&lt;FONT color=#000000 face=helv,helvetica size=1&gt;&amp;nbsp;&amp;nbsp;File&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;INPUT&nbsp; size=60 type=file&nbsp; name="file"&gt;&lt;/TD&gt;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TR&gt;<br>&nbsp;&nbsp;&nbsp; &lt;TR&gt;<br>&nbsp;&nbsp;&nbsp; &lt;TD&gt;&lt;FONT color=#000000 face=helv,helvetica size=1&gt;&amp;nbsp;&amp;nbsp;File&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;INPUT&nbsp; size=60 type=file&nbsp; name="file1"&gt;&lt;/TD&gt;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TR&gt;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; &lt;TD&gt;&lt;FONT color=#000000 face=helv,helvetica size=1&gt;&amp;nbsp;&amp;nbsp;File&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;INPUT&nbsp; size=60 type=text&nbsp; name="text"&gt;&lt;/TD&gt;&lt;/TR&gt;<br>&nbsp; &lt;TR&gt;<br>&nbsp;&nbsp;&nbsp; &lt;TD <br>align=right&gt;&lt;INPUT type=submit value=Send name="send"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/FORM&gt;&lt;/BODY&gt;&lt;/HTML&gt;</font></p>
<p align=left><font size=4>&nbsp; 再来看一下接收的页面 ，我们把文件上传到服务器以后就直接把它再存入数据库中：upload.jsp</font></p>
<p align=left><font size=4>&lt;%@ page contentType="text/html;charset=gb2312"%&gt;<br>&lt;%@ page import="java.sql.*"%&gt;<br>&lt;%@ page import="com.jspsmart.upload.*" %&gt;<br>&lt;%@ page import="DBstep.iDBManager2000.*"%&gt;<br>&lt;%<br>&nbsp;&nbsp;&nbsp;</font><a href="file://实/"><font color=#0000ff size=4><u>//实</u></font></a><font size=4>例化上载bean<br>&nbsp;&nbsp;&nbsp; com.jspsmart.upload.SmartUpload mySmartUpload=new com.jspsmart.upload.SmartUpload();<br>&nbsp;&nbsp;&nbsp; </font><a href="file://初/"><font color=#0000ff size=4><u>//初</u></font></a><font size=4>始化<br>&nbsp;&nbsp;&nbsp; mySmartUpload.initialize(pageContext);&nbsp;<br>&nbsp;&nbsp;&nbsp; </font><a href="file://设/"><font color=#0000ff size=4><u>//设</u></font></a><font size=4>置上载的最大值<br>&nbsp;&nbsp;&nbsp; mySmartUpload.setMaxFileSize(500 * 1024*1024);<br>&nbsp;&nbsp;&nbsp; </font><a href="file://上/"><font color=#0000ff size=4><u>//上</u></font></a><font size=4>载文件<br>&nbsp;&nbsp;&nbsp; mySmartUpload.upload();<br>&nbsp;&nbsp; </font><a href="file://循/"><font color=#0000ff size=4><u>//循</u></font></a><font size=4>环取得所有上载的文件<br>&nbsp;&nbsp; for (int i=0;i&lt;mySmartUpload.getFiles().getCount();i++){<br>&nbsp;&nbsp; </font><a href="file://取/"><font color=#0000ff size=4><u>//取</u></font></a><font size=4>得上载的文件<br>&nbsp;&nbsp; com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i);<br>&nbsp;&nbsp; if (!myFile.isMissing())<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp; </font><a href="file://取/"><font color=#0000ff size=4><u>//取</u></font></a><font size=4>得上载的文件的文件名<br>&nbsp;&nbsp;&nbsp; String myFileName=myFile.getFileName();<br>&nbsp;&nbsp;&nbsp; </font><a href="file://取/"><font color=#0000ff size=4><u>//取</u></font></a><font size=4>得不带后缀的文件名<br>&nbsp;&nbsp;&nbsp; String&nbsp; suffix=myFileName.substring(0,myFileName.lastIndexOf('.'));<br>&nbsp;&nbsp;&nbsp; </font><a href="file://取/"><font color=#0000ff size=4><u>//取</u></font></a><font size=4>得后缀名<br>&nbsp;&nbsp;&nbsp; String&nbsp; ext= mySmartUpload.getFiles().getFile(0).getFileExt();&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; </font><a href="file://取/"><font color=#0000ff size=4><u>//取</u></font></a><font size=4>得文件的大小&nbsp; <br>&nbsp;&nbsp;&nbsp; int fileSize=myFile.getSize();<br>&nbsp;&nbsp;&nbsp; </font><a href="file://保/"><font color=#0000ff size=4><u>//保</u></font></a><font size=4>存路径<br>&nbsp;&nbsp;&nbsp; String aa=getServletContext().getRealPath("/")+"jsp\\";<br>&nbsp;&nbsp;&nbsp; String trace=aa+myFileName;<br>&nbsp;&nbsp;&nbsp; </font><a href="file://取/"><font color=#0000ff size=4><u>//取</u></font></a><font size=4>得别的参数<br>&nbsp;&nbsp;&nbsp; String explain=(String)mySmartUpload.getRequest().getParameter("text");<br>&nbsp;&nbsp;&nbsp; String send=(String)mySmartUpload.getRequest().getParameter("send");<br>&nbsp;&nbsp;&nbsp; </font><a href="file://将/"><font color=#0000ff size=4><u>//将</u></font></a><font size=4>文件保存在服务器端 <br>&nbsp;&nbsp;&nbsp; myFile.saveAs(trace,mySmartUpload.SAVE_PHYSICAL);<br>&nbsp;&nbsp;&nbsp; </font><a href="file://下/"><font color=#0000ff size=4><u>//下</u></font></a><font size=4>面的是将上载的文件保存到数据库中<br>&nbsp;&nbsp;&nbsp; </font><a href="file://将/"><font color=#0000ff size=4><u>//将</u></font></a><font size=4>文件读到流中 <br>&nbsp;&nbsp;&nbsp; java.io.File file = new java.io.File(trace);<br>&nbsp;&nbsp;&nbsp; java.io.FileInputStream fis = new java.io.FileInputStream(file);<br>&nbsp; out.println(file.length());<br>&nbsp;&nbsp; </font><a href="file://打/"><font color=#0000ff size=4><u>//打</u></font></a><font size=4>开数据库<br>&nbsp;&nbsp; ResultSet result=null;<br>&nbsp;&nbsp; String mSql=null;<br>&nbsp;&nbsp; PreparedStatement prestmt=null; <br>&nbsp;&nbsp; DBstep.iDBManager2000 DbaObj=new DBstep.iDBManager2000();<br>&nbsp;&nbsp; DbaObj.OpenConnection();<br>&nbsp;&nbsp; </font><a href="file://将/"><font color=#0000ff size=4><u>//将</u></font></a><font size=4>文件写到数据库中<br>&nbsp;&nbsp; mSql="insert into marklist (markname,password,marksize,markdate,MarkBody) values (?,?,?,?,?)";<br>&nbsp;&nbsp; prestmt =DbaObj.Conn.prepareStatement(mSql);<br>&nbsp;&nbsp; prestmt.setString(1, "aaa1");<br>&nbsp;&nbsp; prestmt.setString(2, "0000");<br>&nbsp;&nbsp; prestmt.setInt(3, fileSize);<br>&nbsp;&nbsp; prestmt.setString(4, DbaObj.GetDateTime());<br>&nbsp;&nbsp; prestmt.setBinaryStream(5,fis,(int)file.length());<br>&nbsp;&nbsp; DbaObj.Conn.setAutoCommit(true) ;<br>&nbsp;&nbsp; prestmt.executeUpdate();<br>&nbsp;&nbsp; DbaObj.Conn.commit();<br>&nbsp;&nbsp; out.println(("上载成功！！！").toString());<br>&nbsp;&nbsp; }<br>&nbsp;&nbsp; else <br>&nbsp;&nbsp; { out.println(("上载失败！！！").toString()); } <br>&nbsp;&nbsp; }//与前面的if对应<br>%&gt;</font></p>
<p align=left><font size=4>&nbsp;&nbsp; 再说一下下载，下载分两种情况1。从数据库直接下载2。从服务器上下载</font></p>
<p align=left><font size=4>&nbsp; 先说从数据库直接下载的情形：就是把输入流从数据库里读出来，然后转存为文件</font></p>
<p align=left><font size=4>&lt;%@ page contentType="text/html; charset=gb2312" %&gt;<br>&lt;%@ page import="java.sql.*"%&gt;<br>&lt;%@ page import="java.io.*" %&gt;<br>&lt;%@ page import="DBstep.iDBManager2000.*"%&gt;<br>&lt;%<br>&nbsp;&nbsp;&nbsp; int bytesum=0;<br>&nbsp;&nbsp;&nbsp; int byteread=0;<br>&nbsp; </font><a href="file://打/"><font color=#0000ff size=4><u>//打</u></font></a><font size=4>开数据库<br>&nbsp; ResultSet result=null;<br>&nbsp; String Sql=null;<br>&nbsp; PreparedStatement prestmt=null; <br>&nbsp; DBstep.iDBManager2000 DbaObj=new DBstep.iDBManager2000();<br>&nbsp; DbaObj.OpenConnection();<br>&nbsp;</font><a href="file://取/"><font color=#0000ff size=4><u>//取</u></font></a><font size=4>得数据库中的数据<br>&nbsp;Sql="select&nbsp; *&nbsp; from&nbsp; t_local_zhongzhuan ";<br>&nbsp;result=DbaObj.ExecuteQuery(Sql);<br>&nbsp;result.next();</font></p>
<p align=left><font size=4>&nbsp;</font><a href="file://将/"><font color=#0000ff size=4><u>//将</u></font></a><font size=4>数据库中的数据读到流中 <br>InputStream inStream=result.getBinaryStream("content"); <br>FileOutputStream fs=new FileOutputStream( "c:/dffdsafd.doc");</font></p>
<p align=left><font size=4>&nbsp; byte[]&nbsp; buffer =new&nbsp; byte[1444];<br>int length;<br>&nbsp;&nbsp;&nbsp; while ((byteread=inStream.read(buffer))!=-1)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; out.println("&lt;DT&gt;&lt;B&gt;"+byteread+"&lt;/B&gt;&lt;/DT&gt;");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bytesum+=byteread;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(bytesum);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fs.write(buffer,0,byteread);<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>%&gt;</font></p>
<p align=left><font size=4>再说从服务器上下载的情形：</font></p>
<p align=left><font size=4>&lt;%@ page contentType="text/html; charset=gb2312" %&gt;<br>&lt;%@ page import="java.io.*" %&gt;<br>&lt;%<br>&nbsp; String fileName = "zsc104.swf".toString();<br></font><a href="file://读/"><font color=#0000ff size=4><u>//读</u></font></a><font size=4>到流中<br>InputStream inStream=new FileInputStream("c:/zsc104.swf");<br>&nbsp;</font><a href="file://设/"><font color=#0000ff size=4><u>//设</u></font></a><font size=4>置输出的格式 <br>&nbsp; response.reset(); <br>&nbsp; response.setContentType("bin");<br>&nbsp; response.addHeader("Content-Disposition","attachment; filename=\"" + fileName + "\"");<br>&nbsp;</font><a href="file://循/"><font color=#0000ff size=4><u>//循</u></font></a><font size=4>环取出流中的数据 <br>&nbsp; byte[] b = new byte[100]; <br>&nbsp; int len; <br>&nbsp; while((len=inStream.read(b)) &gt;0) <br>&nbsp; response.getOutputStream().write(b,0,len); &nbsp;<br>&nbsp; inStream.close(); <br>%&gt;</font></p>
<p align=left><font size=4>&nbsp;&nbsp; 好了，到这里只要不是太大的文件的上传下载的操作都可以完成了。</font></p>
摘自：<a href="http://dev.csdn.net/develop/article/18/18987.shtm">http://dev.csdn.net/develop/article/18/18987.shtm</a>
<img src ="http://www.blogjava.net/lcgxc/aggbug/132874.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-07-27 19:34 <a href="http://www.blogjava.net/lcgxc/archive/2007/07/27/132874.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSP编程技巧集锦</title><link>http://www.blogjava.net/lcgxc/archive/2007/07/27/132804.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Fri, 27 Jul 2007 07:56:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/archive/2007/07/27/132804.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/132804.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/archive/2007/07/27/132804.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/132804.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/132804.html</trackback:ping><description><![CDATA[1. &nbsp; 如何让选中的一行记录高亮显示？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050105/09/3699823.html &nbsp; <br>&nbsp; 2. &nbsp; 如何在下拉列表框里选择一个值后跳出新窗口? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050107/15/3707444.html &nbsp; <br>&nbsp; 3. &nbsp; 如何在JSP中启动execl? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4909154 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4685297 &nbsp; <br>&nbsp; 4. &nbsp; 两级联动菜单 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20040730/16/3227437.html &nbsp; <br>&nbsp; 5. &nbsp; java中如何把一个<nobr oncontextmenu="return false;" onmousemove=kwM(6); id=key5 onmouseover="kwE(event,6, this);" style="COLOR: #6600ff; BORDER-BOTTOM: #6600ff 1px dotted; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout="kwL(event, this);" target="_blank">目录</nobr>下的文件移到另一个指定的目录？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050112/13/3719237.html &nbsp; <br>&nbsp; 6. &nbsp; 如何制作表格线? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5130862 &nbsp; <br>&nbsp; 7. &nbsp; jsp如判别一个字符在A到Z之间? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050113/08/3721286.html &nbsp; <br>&nbsp; 8. &nbsp; 得到一浮点数小数点后4位，如何写以函数截取为两位 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050117/14/3731712.html &nbsp; <br>&nbsp; 9. &nbsp; 整型转字符? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20030526/22/1837632.html &nbsp; <br>&nbsp; 10. &nbsp; 显示数据库的记录，点击哪个标题栏，就按照哪个标题排序 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20041226/15/3677011.html &nbsp; <br>&nbsp; 11. &nbsp; 制作两个按钮 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ？？ &nbsp; <br>&nbsp; 12. &nbsp; 用什么sql语句将数据库中的一条记录,复制为两条? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050120/17/3741746.html &nbsp; <br>&nbsp; 13. &nbsp; 有兩個按鈕A,B,其中A按下去,A就不可以再按,另外B按下去,A可以再按..請問如何用javascript控制.? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050120/17/3741568.html &nbsp; <br>&nbsp; 14. &nbsp; 请问jsp中的数据库的连接方式 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20030107/11/1334377.html &nbsp; <br>&nbsp; 15. &nbsp; 在jsp中,怎么实现按回车就可提交表单? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050121/11/3743133.html &nbsp; <br>&nbsp; 16. &nbsp; 在JSP中如何传递数组? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20030624/17/1952227.html &nbsp; <br>&nbsp; 17. &nbsp; 如何按地址取图片？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4894525 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4990451 &nbsp; <br>&nbsp; 18. &nbsp; JSP中如何上传图片到数据库字段？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4923127 &nbsp; <br>&nbsp; 19. &nbsp; 页面自动刷新？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20040430/16/3025697.html &nbsp; <br>&nbsp; 20. &nbsp; 表单自动提交？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4681334 &nbsp; <br>&nbsp; 21. &nbsp; 如何从JSP传数据的到JAVABEAN里? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; 这个不就是参数传递么？？ &nbsp; <br>&nbsp; 22. &nbsp; weblogic &nbsp; 数据池连接? &nbsp; &nbsp; 数据源 &nbsp; JNDI名字 &nbsp; &nbsp; mysource &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20040915/22/3376617.html &nbsp; <br>&nbsp; 23. &nbsp; 三级联动菜单? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://blog.csdn.net/overmind/archive/2005/10/27/517856.aspx &nbsp; <br>&nbsp; 24. &nbsp; 在JSP中如何调用浏览器中的"另存为"功能? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050509/09/3990931.html &nbsp; <br>&nbsp; 25. &nbsp; 网页全屏显示 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5057245 &nbsp; <br>&nbsp; 26. &nbsp; 求两个日期相隔了多少天:输入时间格式为(yyyy-mm-dd) &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050516/10/4009546.html &nbsp; <br>&nbsp; 27. &nbsp; 上传文件对话框 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4961980 &nbsp; <br>&nbsp; 28. &nbsp; 分页测试 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4925123 &nbsp; <br>&nbsp; 29. &nbsp; 下载文件 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5019146 &nbsp; <br>&nbsp; 30. &nbsp; 简单汉字判断 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://blog.csdn.net/duanxd/archive/2005/05/19/376481.aspx &nbsp; <br>&nbsp; 31. &nbsp; 可否将JSP的变量或者bean传递给JAVASCRIPT使用？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050520/14/4022667.html &nbsp; <br>&nbsp; 32. &nbsp; 怎么把一种格式（如yyyy-mm-dd）的日期变量转换成另外一种格式（如dd-mm-yyyy）的日期变量！ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20050602/21/4055209.html &nbsp; <br>&nbsp; 33. &nbsp; 如何实现在页面上添加一行输入对话框 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; ?? &nbsp; <br>&nbsp; 34. &nbsp; 如何制作验证码图片? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4857455 &nbsp; &nbsp; &nbsp; <br>&nbsp; 35. &nbsp; 图片缩小放大功能 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20041227/09/3678138.html &nbsp; <br>&nbsp; 36. &nbsp; 如何点击输入框弹出日期选择？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5020494 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://www.dynarch.com/projects/calendar/ &nbsp; <br>&nbsp; 37. &nbsp; 如何在图片上传前查看自己要上传的图片? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4825282 &nbsp; <br>&nbsp; 38. &nbsp; 如何在图片排列的页面上选中一个图片,然后把它删掉? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5162107 &nbsp; <br>&nbsp; 39. &nbsp; 显示某目录下的所有文件 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5056503 &nbsp; <br>&nbsp; 40. &nbsp; 如何把复选框中选中的值直接显示在输入文本框中？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5004830 &nbsp; <br>&nbsp; 41. &nbsp; 如何选择路径下的文件直接显示文件内容? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5194181 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5121413 &nbsp; <br>&nbsp; 42. &nbsp; 如何制作进度条? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20051120/03/4405364.html &nbsp; <br>&nbsp; 43. &nbsp; 如何对较长字符省略显示? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5124078 &nbsp; <br>&nbsp; 44. &nbsp; 如何制作日历? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 这个太多了 &nbsp; <br>&nbsp; 45. &nbsp; 点击文本弹出一个选择框，选中值后返回并显示 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4979197 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4988006 &nbsp; <br>&nbsp; 46. &nbsp; 如何关闭框架页面回到没框架的页面? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4970057 &nbsp; <br>&nbsp; 47. &nbsp; 如何选中多条记录一次性删除? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4762839 &nbsp; <br>&nbsp; 48. &nbsp; 如何自动获取页面文件名？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4945500 &nbsp; <br>&nbsp; 49. &nbsp; 如何在JSP中调用ActiveX控件? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4919689 &nbsp; <br>&nbsp; 50. &nbsp; 如何使用SmartUpload实现文件上传? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4911791 &nbsp; <br>&nbsp; 51. &nbsp; 如何使用iReport和Jasperreport<nobr oncontextmenu="return false;" onmousemove=kwM(1); id=key1 onmouseover="kwE(event,1, this);" style="COLOR: #6600ff; BORDER-BOTTOM: #6600ff 1px dotted; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout="kwL(event, this);" target="_blank">开发</nobr>报表? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5038328 &nbsp; <br>&nbsp; 52. &nbsp; 如何使用iText生成PDF？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.lowagie.com/iText/tutorial/ch07.html#htmlparsing &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://<nobr oncontextmenu="return false;" onmousemove=kwM(8); id=key6 onmouseover="kwE(event,8, this);" style="COLOR: #6600ff; BORDER-BOTTOM: #6600ff 1px dotted; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout="kwL(event, this);" target="_blank">java</nobr>.ccidnet.com/art/3565/20050309/480327_1.html &nbsp; <br>&nbsp; 53. &nbsp; 如何制作图片水印？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5212770 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4885889 &nbsp; <br>&nbsp; 54. &nbsp; 如何在页面中屏蔽<nobr oncontextmenu="return false;" onmousemove=kwM(0); id=key0 onmouseover="kwE(event,0, this);" style="COLOR: #6600ff; BORDER-BOTTOM: #6600ff 1px dotted; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout="kwL(event, this);" target="_blank">键盘</nobr>功能键？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4356360 &nbsp; <br>&nbsp; 55. &nbsp; 如何禁止用户复制网页内容？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4356360 &nbsp; <br>&nbsp; 56. &nbsp; 如何实现不在地址拦中显示当前URL？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4678351 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4863808 &nbsp; <br>&nbsp; 57. &nbsp; 如何获取用户的真实IP地址？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4718686 &nbsp; <br>&nbsp; 58. &nbsp; 如何获取用户浏览器信息？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4987045 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4898974 &nbsp; <br>&nbsp; 59. &nbsp; 如何获取当前绝对路径？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5157921 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5178848 &nbsp; <br>&nbsp; 60. &nbsp; 如何将HTML文件转换成XML文件? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4542984 &nbsp; <br>&nbsp; 61. &nbsp; 如何结合XML和XSL输出HTML页面？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4355891 &nbsp; <br>&nbsp; 62. &nbsp; 如何制作动态树型菜单制作？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.blogjava.net/rickhunter/articles/59742.html &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4966014 &nbsp; <br>&nbsp; 63. &nbsp; 如何制作类似QQ的短消息提示？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4702037 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5087584 &nbsp; <br>&nbsp; 64. &nbsp; 如何用jfreechat制作拄、饼、曲线图型? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.inspiresky.com/Article/ShowArticle.asp?ArticleID=731 &nbsp; <br>&nbsp; 65. &nbsp; 文本框怎么只容许输入数字? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4927727 &nbsp; <br>&nbsp; 66. &nbsp; 如何打开Word和Execl文件? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=5194181 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://community.csdn.net/Expert/TopicView1.asp?id=4685297 &nbsp; <br>&nbsp; 67. &nbsp; 如何生成Word &nbsp; 和 &nbsp; Excel文档？ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://sourceforge.net/project/showfiles.php?group_id=15255&amp;release_id=167948 &nbsp; <br>&nbsp; 68. &nbsp; JSP如何读取Word内容? &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://topic.csdn.net/t/20030217/13/1435281.html&nbsp;&nbsp; <br>摘自：<a href="http://topic.csdn.net/t/20061209/01/5218000.html">http://topic.csdn.net/t/20061209/01/5218000.html</a>
<img src ="http://www.blogjava.net/lcgxc/aggbug/132804.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-07-27 15:56 <a href="http://www.blogjava.net/lcgxc/archive/2007/07/27/132804.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>javascript 中getSelection使用</title><link>http://www.blogjava.net/lcgxc/articles/130540.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Mon, 16 Jul 2007 04:51:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/articles/130540.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/130540.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/articles/130540.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/130540.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/130540.html</trackback:ping><description><![CDATA[<p>&lt;head&gt;</p>
<p>&lt;script LANGUAGE="JavaScript"&gt;<br>var isNav = (navigator.appName.indexOf("Netscape") !=-1);</p>
<p>function showSelection(){<br>&nbsp;if (window.getSelection) {<br>alert(window.getSelection());<br>document.forms[0].selectedText.value=window.getSelection();<br>} else if (document.getSelection) {<br>alert(document.getSelection());<br>document.forms[0].selectedText.value=document.getSelection();<br>} else if (document.selection) {<br>alert(document.selection.createRange().text);<br>document.forms[0].selectedText.value=document.selection.createRange().text;<br>}</p>
<p><br>}</p>
<p>if (isNav) {</p>
<p>document.captureEvents(Event.MOUSEUP);</p>
<p>}</p>
<p>document.onmouseup = showSelection;</p>
<p><br>&lt;/script&gt;<br>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;P&gt;<br>这些都是用来测试的文本，您可以用鼠标来选中，然后试一试选择文本后产生的结构。<br>&lt;/P&gt;</p>
<p>&lt;form name="dataholder"&gt;</p>
<p><br>&lt;textarea name="selectedText" rows = 3 cols=40 wrap="virtusl"&gt;<br>&lt;/textarea&gt;<br>&lt;/form&gt;<br>&lt;/body&gt;</p>
<img src ="http://www.blogjava.net/lcgxc/aggbug/130540.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-07-16 12:51 <a href="http://www.blogjava.net/lcgxc/articles/130540.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>hibernate中 实体生命周期三态变化</title><link>http://www.blogjava.net/lcgxc/articles/130539.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Mon, 16 Jul 2007 04:50:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/articles/130539.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/130539.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/articles/130539.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/130539.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/130539.html</trackback:ping><description><![CDATA[<div class=item-content>
<p>Tuser user=new Tuser();</p>
<p>user.setName("gxc");</p>
<p>Transaction tx=session.beginTransaction();</p>
<p>session.save(user);&nbsp;&nbsp; 自由态变为持久态</p>
<p>tx.commit();</p>
<p>Transaction tx2=session.beginTransaction();</p>
<p>session.delete(user);&nbsp; 持久态变为游离态</p>
<p>tx2.commit();</p>
</div>
<img src ="http://www.blogjava.net/lcgxc/aggbug/130539.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-07-16 12:50 <a href="http://www.blogjava.net/lcgxc/articles/130539.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>windows xp下jsp连接sql 2000 的问题</title><link>http://www.blogjava.net/lcgxc/articles/130538.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Mon, 16 Jul 2007 04:48:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/articles/130538.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/130538.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/articles/130538.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/130538.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/130538.html</trackback:ping><description><![CDATA[&nbsp;在winxp下需将sql 2000的补丁sp3 和sp4打上。需要注意：<strong>下载这两个补丁后。先解压缩，然后找到x86下的setup进行安装。</strong>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 建立一个工程后，写一段代码：</p>
<p>&lt;%@ page language="java" import="java.sql.*,java.lang.*" contentType="text/html;charset=gb2312"%&gt;<br>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;<br>&lt;html&gt;<br>&nbsp; &lt;head&gt;<br>&nbsp; &lt;/head&gt;<br>&nbsp; <br>&nbsp; &lt;body&gt;<br>&nbsp;&nbsp;&nbsp; This is my JSP page. &lt;br&gt;<br>&nbsp;&nbsp; &lt;% Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();<br>&nbsp;String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=gxc";<br>&nbsp;String user="sa";<br>&nbsp;String password="sa";<br>&nbsp;Connection conn= DriverManager.getConnection(url,user,password);<br>&nbsp;System.out.println("lianjie ok");<br>&nbsp;Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);<br>&nbsp;System.out.println("lianjiehou ok");<br>&nbsp;String sql="select * from b1";<br>&nbsp;ResultSet rs=stmt.executeQuery(sql);<br>&nbsp;while(rs.next()) {%&gt;<br>&nbsp;您的第一个字段内容为：&lt;%=rs.getString(1)%&gt;<br>&nbsp;您的第二个字段内容为：&lt;%=rs.getString(2)%&gt;<br>&nbsp;&lt;%}<br>&nbsp;<br>&nbsp;%&gt;<br>&nbsp; &lt;/body&gt;<br>&lt;/html&gt;<br>&nbsp;&nbsp;&nbsp; <strong>要将三个sql包烤到tomcat下的lib中</strong>。</p>
<img src ="http://www.blogjava.net/lcgxc/aggbug/130538.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-07-16 12:48 <a href="http://www.blogjava.net/lcgxc/articles/130538.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>tabled的使用</title><link>http://www.blogjava.net/lcgxc/articles/130537.html</link><dc:creator>lcgxc</dc:creator><author>lcgxc</author><pubDate>Mon, 16 Jul 2007 04:46:00 GMT</pubDate><guid>http://www.blogjava.net/lcgxc/articles/130537.html</guid><wfw:comment>http://www.blogjava.net/lcgxc/comments/130537.html</wfw:comment><comments>http://www.blogjava.net/lcgxc/articles/130537.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lcgxc/comments/commentRss/130537.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lcgxc/services/trackbacks/130537.html</trackback:ping><description><![CDATA[<div class=item-content>
<p>import java.awt.*;<br>import java.awt.event.ActionEvent;<br>import java.awt.event.ActionListener;<br>import java.sql.Connection;<br>import java.sql.DriverManager;<br>import java.sql.ResultSet;<br>import java.sql.SQLException;<br>import java.sql.Statement;</p>
<p>import javax.swing.JButton;<br>import javax.swing.JFrame;<br>import javax.swing.JTable;</p>
<p>public class table extends JFrame&nbsp; implements ActionListener{<br>&nbsp;Object a[][];<br>&nbsp;Object&nbsp; b[]={"name","password"};<br>&nbsp;Container con;<br>&nbsp;JButton button;<br>&nbsp;String name,password;<br>&nbsp;<br>&nbsp;public table(){<br>&nbsp;&nbsp;a=new Object[30][2];<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;JTable table=new JTable(a,b);<br>&nbsp;&nbsp;table.setSize(300,300);<br>&nbsp;&nbsp;button=new JButton("chaxun");<br>&nbsp;&nbsp;button.addActionListener(this);<br>&nbsp;&nbsp;con=getContentPane();<br>&nbsp;&nbsp;con.add(table,BorderLayout.CENTER);<br>&nbsp;&nbsp;con.add(button,BorderLayout.SOUTH);<br>&nbsp;&nbsp;this.setExtendedState(JFrame.MAXIMIZED_BOTH);&nbsp;&nbsp;<br>&nbsp;&nbsp;this.setVisible(true);<br>&nbsp;}</p>
<p>&nbsp;public void actionPerformed(ActionEvent e) {<br>&nbsp;&nbsp;// TODO 自动生成方法存根<br>&nbsp;&nbsp;if(e.getSource()==button){<br>&nbsp;&nbsp;String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; <br>&nbsp;&nbsp;String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=gxc";<br>&nbsp;&nbsp;String user="sa";<br>&nbsp;&nbsp;String password="sa";<br>&nbsp;&nbsp;Statement&nbsp; stmt=null;<br>&nbsp;&nbsp;ResultSet result=null;<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;Connection dbConn =null;<br>&nbsp;&nbsp;int i=0;<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;try {<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Class.forName(driverName);<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;} catch (ClassNotFoundException e1) {<br>&nbsp;&nbsp;&nbsp;// TODO 自动生成 catch 块<br>&nbsp;&nbsp;&nbsp;e1.printStackTrace();<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;try {<br>&nbsp;&nbsp;&nbsp;dbConn = DriverManager.getConnection(url, user, password);<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;stmt=dbConn.createStatement();&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;String sql="select * from b1";<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;result =stmt.executeQuery(sql);<br>&nbsp;&nbsp;&nbsp;while(result.next())<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;name=result.getString(1);<br>&nbsp;&nbsp;&nbsp;password=result.getString(2);<br>&nbsp;&nbsp;&nbsp;&nbsp;a[i][0]=name;<br>&nbsp;&nbsp;&nbsp;&nbsp;a[i][1]=password;<br>&nbsp;&nbsp;&nbsp;&nbsp;i++;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;repaint();<br>&nbsp;&nbsp;&nbsp;dbConn.close();<br>&nbsp;&nbsp;} catch (SQLException e1) {<br>&nbsp;&nbsp;&nbsp;// TODO 自动生成 catch 块<br>&nbsp;&nbsp;&nbsp;e1.printStackTrace();<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;}&nbsp;</p>
<p>&nbsp;}<br>&nbsp;public static void main(String para[]){<br>&nbsp;&nbsp; table table=new table();<br>&nbsp;&nbsp; <br>&nbsp;}</p>
<p>}<br></p>
<div class=clear></div>
</div>
<img src ="http://www.blogjava.net/lcgxc/aggbug/130537.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lcgxc/" target="_blank">lcgxc</a> 2007-07-16 12:46 <a href="http://www.blogjava.net/lcgxc/articles/130537.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>