`

SelectMethod=cursor

阅读更多

SelectMethod=cursor

 SelectMethod=cursor 

1.执行多个Statements的操作的时候用 
  2.需要手动使用事务的时候使用 

以上是在使用sqlserver数据库的连接字符串的时候使用过。 

例如:jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=071008_03;SelectMethod=cursor


用SQL Server驱动一次select很多数据最好在connection string中加上SelectMethod=Cursor,以利用服务器端游标加快速度,其实不只sqlserver,oracle的jdbc,只要使用PreparedStatement,驱动默认就使用游标,sqlserver则不然,必须使用SelectMethod=Cursor才打开游标。 
这点在使用jotm时,并且使用Xapool时,必须修改DataSourceFactory,把PreparedStatementPool禁掉,否则记录插的太快了,很可能是游标没来得及关闭 
即使不使用jotm,大量向oracle插入数据,例如每毫秒1条,也会引发游标用完,所以大量插入数据时,应该使用oracle的批处理batchupdate. 
可惜的是,微软的sqlserver的jdbc驱动不支持这个属性

分享到:
评论

相关推荐

    DBEdit2.1.1_setup.exe

    数据导入与导出工具 jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=szyes;SelectMethod=Cursor; jdbc:mysql://localhost:3306/webbase?useUnicode=true&characterEncoding=UTF-8

    hibernate.properties

    SelectMethod=cursor ## The New Microsoft Driver #hibernate.connection.driver_class com.microsoft.sqlserver.jdbc.SQLServerDriver #hibernate.connection.url jdbc:sqlserver://localhost ## jTDS (since ...

    select自定义样式

    form action="" method="post"> <div id="divselect"> 请选择特效分类 <li><a href="[removed];" selectid="1">导航菜单</a></li> <li><a href="[removed];" selectid="2">焦点幻灯片</a></li> <li><a href...

    eclipse-testng 离线包下载

    <xsl:output name="xhtml" method="xhtml" indent="yes" omit-xml-declaration="yes"/> name="testNgXslt.outputDir"/> <xsl:param name="testNgXslt.cssFile"/> <xsl:param name="testNgXslt....

    Delphi7.1 Update

    not all of the features mentioned in this file are available inall editions of the product.This update resolves the following issues:IDE* Using the up/down arrow keys to navigate and select items from...

    Select精美下拉框(漂亮)

    // ViaSelect Environment Constants var SS_ENV = new Object(); SS_ENV.IE_Version = new Number(((window.navigator.appVersion.split('; '))[1].split(' '))[1]); SS_ENV.CR = new Object(); SS_ENV.CR....

    无限级树(Java递归)

    else if(cursor.src.indexOf("images/tree_minusbottom.gif")>=0) {cursor.src="images/tree_plusbottom.gif";} else if(cursor.src.indexOf("images/tree_plus.gif")>=0) {cursor.src="images/tree_minus.gif";}...

    ddl语言自定义数据库字段

    "select * from view_alter" oRs.Open sSql,oConn,1,1 %> <table width="98%" align=center cellpadding="3" cellspacing=1 bgcolor="#cccccc"> <tbody><br> <Form method="post" id=...

    asp连接数据库代码实例

    <form name="form1" method="post" action="search.asp"> <input name="keyword" type="text" id="keyword" size="25"> <select name="select" size="1"> <option value="name" selected>名称</option> ...

    html个人网站xp界面

    <td width="15%" align="left"><img src="img/msg.jpg" width="100" height="25" onclick="javascript:window.location.href='msg.asp'" style="cursor:hand" /> <td width="85%" align="center" class=...

    PHP基础教程 是一个比较有价值的PHP新手教程!

    出处:风流的CG网络日志 时间:Mon, 28 Aug 2006 07:24:34 +0000 作者:yufeng ... 内容: ... ...本教程并不想让你完全了解这种语言,只是能使你尽快加入开发动态web站点的行列。...三年前,Rasmus Lerdorf为了创建他的在线...

    《ASP交互网页设计篇》书中源代码

    Rs1.Source = "SELECT * FROM Soft WHERE Deleted = " + Replace(Rs1__MMColParam, "'", "''") + "" Rs1.CursorType = 0 Rs1.CursorLocation = 2 Rs1.LockType = 1 Rs1.Open() Rs1_numRows = 0 %> Dim Repeat1__...

    ASP.NET程序中常用的三十三种代码.txt

    this.style.cursor=’default’;"); }  写在DataGrid的_ItemDataBound里 if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.AlternatingItem) { e.Item.Attributes.Add("onmouseover...

    ASP.NET常用代码

    this.style.cursor='default';"); } 写在DataGrid的_ItemDataBound里 if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.AlternatingItem) { e.Item.Attributes.Add("onmouseover",...

    VclZip pro v3.10.1

    Modified so that when cursor is changed to hourglass by VCLZip, previous cursor is saved correctly instead of just changing it back to default cursor. Now saves Central Directory Extra Fields ...

    DevExpress VCL 13.1.4(v2013vol1.4) 源码-例子-帮助-part2

    B238354 - Items designer - The Select All and Delete buttons do not always perform the associated operation with selected items in RAD Studio XE3 or later ExpressPageControl B238839 - A custom button...

    DevExpress VCL 13.1.4(v2013vol1.4) 源码-例子-帮助-part1

    B238354 - Items designer - The Select All and Delete buttons do not always perform the associated operation with selected items in RAD Studio XE3 or later ExpressPageControl B238839 - A custom button...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: The TFlexPanel.FindControlAtPoint method maked virtual to realize RealTime-capability when on mouse cursor moving the flex-object search not occurs. - FIX: After deleting the selected points ...

    plsqldev13.0.0.1882x32主程序+ v12中文包+keygen

    A new "Filter method" option has been added. It can be set to "Contains" to display all items that contain the filter text, or it can be set to "Starts with" to display all items that start with the ...

    android连接SQLite数据库源代码

    在分页有到Cursor(游标)取游标下一个值cursor.moveToNext(),用游标对象接数据 "select * from person limit ?,?" person不能加上where 关键字 4.在删除注意:sb.deleteCharAt(sb.length() - 1); 四、...

Global site tag (gtag.js) - Google Analytics