⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jdk 1.5学习之rowset(二).htm

📁 Sun的高速缓存CachedRowSet方案资料档
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0060)http://www.techan-shop.com/Procedures/java/200604/51953.html -->
<HTML><HEAD><TITLE>jdk 1.5学习之RowSet(二)</TITLE>
<META content="jdk 1.5学习之RowSet(二)" name=Keywords>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
href="jdk 1.5学习之RowSet(二).files/Skin2.css" type=text/css rel=stylesheet>
<STYLE type=text/css>.style2 {
	FONT-SIZE: 16px; COLOR: #ff0000
}
</STYLE>

<SCRIPT language=JavaScript>
<!--
//改变图片大小
function resizepic(thispic)
{
if(thispic.width>700) thispic.width=700;
}
//无级缩放图片大小
function bbimg(o)
{
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
}
-->
</SCRIPT>

<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>
<BODY>
<DIV id=menuDiv 
style="Z-INDEX: 1000; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #9cc5f8"></DIV>
<TABLE class=top_tdbgall style="WORD-BREAK: break-all" cellSpacing=0 
cellPadding=0 width=760 align=center border=0><!--顶部空距代码-->
  <TBODY>
  <TR>
    <TD class=top_top colSpan=2></TD></TR><!--频道显示代码-->
  <TR>
    <TD class=top_Channel align=right colSpan=2>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/Index.html">首页</A>&nbsp;|&nbsp;<A 
      class=Channel href="http://www.techan-shop.com/fanben/Index.html" 
      target=_self>范本</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/jiaoan/Index.html" 
      target=_self>教案</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/Procedures/Index.html" 
      target=_self>程序</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/wenxue/Index.html" 
      target=_self>文学</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/keji/Index.html" 
      target=_self>科技</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/lunwen/Index.html" 
      target=_self>论文</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/meishi/Index.html" 
      target=_self>美食</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/travel/Index.html" 
      target=_self>旅游</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/DC/Index.html" 
      target=_self>摄影</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/shoucang/Index.html" 
      target=_self>收藏</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/car/Index.html" 
      target=_self>汽车</A>&nbsp;|&nbsp;<A class=Channel 
      href="http://www.techan-shop.com/joke/Index.html" 
      target=_self>笑话</A>&nbsp;|&nbsp;</TD></TR>
  <TR>
    <TD align=middle><IMG src="jdk 1.5学习之RowSet(二).files/logo.gif"></TD>
    <TD align=middle>
      <SCRIPT language=javascript src="jdk 1.5学习之RowSet(二).files/1.js"></SCRIPT>
    </TD></TR></TBODY></TABLE><!--导航代码开始-->
<TABLE class=top_Path style="WORD-BREAK: break-all" cellSpacing=0 cellPadding=0 
width=760 align=center border=0>
  <TBODY>
  <TR>
    <TD align=middle width="5%"><IMG height=11 
      src="jdk 1.5学习之RowSet(二).files/arrow3.gif" width=29></TD>
    <TD width="73%">首页&gt;&gt;<A 
      href="http://www.techan-shop.com/Procedures">程序</A> &gt;&gt;<A 
      href="http://www.techan-shop.com/Procedures/java">java</A></TD>
    <TD align=right width="22%"><IMG height=13 
      src="jdk 1.5学习之RowSet(二).files/User_Login.gif" width=13 align=absMiddle> 
      <A class=top_UserLogin 
      href="http://www.techan-shop.com/User/User_Login.asp" 
      target=_blank>用户登录</A> <IMG height=13 
      src="jdk 1.5学习之RowSet(二).files/User_Reg.gif" width=13 align=absMiddle> <A 
      class=top_UserLogin href="http://www.techan-shop.com/Reg/User_Reg.asp" 
      target=_blank>新用户注册</A> </TD></TR></TBODY></TABLE>
<TABLE class=center_tdbgall cellSpacing=0 cellPadding=0 width=760 align=center 
border=0>
  <TBODY>
  <TR>
    <TD>
      <SCRIPT language=javascript src="jdk 1.5学习之RowSet(二).files/2.js"></SCRIPT>
    </TD></TR></TBODY></TABLE>
<TABLE class=center_tdbgall style="WORD-BREAK: break-all" cellSpacing=0 
cellPadding=0 width=760 align=center border=0>
  <TBODY>
  <TR>
    <TD width=1></TD>
    <TD class=main_tdbgall vAlign=top width=575><!--网页中部左栏文章内容代码开始-->
      <TABLE class=main_title_760 style="WORD-BREAK: break-all" cellSpacing=0 
      cellPadding=0 width="100%" align=center border=0>
        <TBODY>
        <TR>
          <TD vAlign=center width="3%"><IMG 
            src="jdk 1.5学习之RowSet(二).files/arrow.gif" align=absMiddle></TD>
          <TD width="66%"><STRONG>jdk 1.5学习之RowSet(二)</STRONG></TD>
          <TD align=right></TD></TR></TBODY></TABLE>
      <TABLE class=main_tdbg_575 style="WORD-BREAK: break-all" cellSpacing=0 
      cellPadding=0 width="100%" align=center border=0>
        <TBODY>
        <TR vAlign=center align=middle>
          <TD align=middle colSpan=2>
            <H1 class=style2>jdk 1.5学习之RowSet(二)</H1></TD></TR>
        <TR class=Article_tdbgall align=middle>
          <TD colSpan=2>
            <SCRIPT language=javascript 
            src="jdk 1.5学习之RowSet(二).files/3.js"></SCRIPT>
          </TD></TR>
        <TR>
          <TD id=fontzoom style="WORD-BREAK: break-all" vAlign=top colSpan=2 
          height=300>
            <TABLE cellSpacing=0 cellPadding=10 align=left border=0>
              <TBODY>
              <TR>
                <TD>
                  <SCRIPT language=javascript 
                  src="jdk 1.5学习之RowSet(二).files/4.js"></SCRIPT>
                </TD></TR></TBODY></TABLE><!--画中画广告结束-->
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">continue.....</P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">JoinRowSet接口:</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            这个接口可以提供我们在无连接的状态下直接对结果集进行Join。下面的代码提供了JoinRowSet的实现:</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>CachedRowSet crs1=new CaehedRowSetImpl();</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs1.setUrl(“jdbc:mydql://localhost:3306/test”);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs1.setUsername(“root”);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs1.setPassword(“”);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs1.setCommand(“select * from table<CHMETCNV tcsc="0" 
            numbertype="1" negative="False" hasspace="False" sourcevalue="1" 
            unitname="”" w:st="on">1”</CHMETCNV>);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs1.execute();</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>CachedRowSet crs2=new CaehedRowSetImpl();</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs2.setUrl(“jdbc:mydql://localhost:3306/test”);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs2.setUsername(“root”);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs2.setPassword(“”);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs2.setCommand(“select * from table<CHMETCNV tcsc="0" 
            numbertype="1" negative="False" hasspace="False" sourcevalue="2" 
            unitname="”" w:st="on">2”</CHMETCNV>);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>crs2.execute();</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>JoinRowSet jrs=new JoinRowSetImpl();</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>jrs.addRowSet(crs1,”id”);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>jrs.addRowSet(crs2,”id”);</P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left>while(jrs.next()) </P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -