Database cursor, and mysql-connector-java middle reaches of the subject using

2011-01-10  来源:本站原创  分类:Database  人气:167 

Knowledge of the cursor on the database can refer to:

http://blog.csdn.net/athoncj/archive/2006/12/25/1459816.aspx

http://ly-thumb-sina-com.javaeye.com/category/60674?show_full=true

Cursor

When using a cursor operation, the data from the query into the temporary table, then returns the first record of the temporary table cursor, and then iterate through the cursor result.

CacheSiz

Continuing the example, assume that the records match the query of 100, ie,. MoveNext This method loops through the result set need to interact with the server 100 times. We can allow customers to set CacheSize fewer communication with the server. The above example is actually CacheSize = 1, and this is the default.

Assuming CacheSize = 4, when the RecordSet object is opened, the server sends four records to the client. The first 4 times. MoveNext operation actually get the data in the client buffer, when the first 5 times. Movenext, the server sends only the next four records. Thus, reducing the network between client and server communication.

NA me is not to say that CacheSize bigger the better? Do not take it for granted. Everything has two sides, CacheSize is the same. Client requests data, the server sends the data, this process is a bit like a traffic management. CacheSize too high, blocking the traffic, or even cause data loss (such as when the client buffer is greater than Cachesize). For different applications, different values are taken.

Also to be noted that the use of any form of the cursor is not the most effective way to access data, Cachesize sometimes not the bottleneck, as far as possible into the program using the cursor result set for the program, performance will improve a lot.


Java implementation of the ResultSet using the jdbc package according to differ:

Using mysql-connector-java-5.1.14-bin.jar, you can view the source code,

About ResultSet.next () method, with three kinds of implementation, as follows:

RowDataCursor

RowDataDynamic

RowDataStatic

RowDataCursor have achieved is probably achieved with the cursor, the subject of further study.

相关文章
  • The middle reaches of the subject to use Oracle 2011-04-13

    The middle reaches of the subject to use Oracle Cursor (cursor) can be seen as pointing to the result set (a set of rows) in the row pointer (pointer). In oracle database can be displayed or hidden using the two kinds of cursors. Implicit Cursor: Whe

  • Database cursor, and mysql-connector-java middle reaches of the subject using 2011-01-10

    Knowledge of the cursor on the database can refer to: http://blog.csdn.net/athoncj/archive/2006/12/25/1459816.aspx http://ly-thumb-sina-com.javaeye.com/category/60674?show_full=true Cursor When using a cursor operation, the data from the query into t

  • mysql connector java garbage to solve their own experience 2010-12-30

    1, used in the case of hibernate hibernate.cfg.xml file needs to add <property name="connection.url"> jdbc: mysql: / / localhost: 3306/logistics? useUnicode = true & characterEncoding = UTF-8 </ Property> 2 First, write a java cl

  • Middle reaches of the subject use, and DB2 stored procedures written 2010-07-15

    Question 1: When not found exception will occur, and the db2 sqlcode value is in how the change? In db2 in a select statement has not found exception may occur, for example, declare sqlcode integer default 0; declare sql_code integer default 0; decla

  • MySQL的JDBC驱动 MySQL Connector/J 2008-09-09

    MySQL Connector/J 网站 : http://www.mysql.com 官方的MySQL JDBC驱动程序,目前最新版本是5.1.6,兼容JDBC-4.0规范. 驱动类名:com.mysql.jdbc.Driver URL格式:jdbc:mysql://servername:port/database LGPL for Connector/J 2.0.14, GPL for Connector/J 3.0.0 授权协议: GPL 开发语言: Java 操作系统: 跨平台

  • Oracle database migration to MySQL Migration Notes combat 2011-03-31

    Oracle database migration to MySQL Migration Notes combat (2010-10-20 14:32:18) Reproduced Tags: Transplant trigger mysql oracle it Category: Database I. Introduction The original project is based on the company's Oracle database, Oracle is powerful,

  • Database connection pool using the JAVA version BoneCP 2011-09-21

    BoneCP is a fast, free, open-source, Java database connection pool (JDBC Pool) library. If you are familiar with C3P0 and DBCP then you already know what this means. For the rest, this is a library that will manage a database connection for you to ge

  • mysql oracle java type 2010-03-30

    Mysql Oracle Java BIGINT NUMBER (19,0) java.lang.Long BIT RAW byte [] BLOB BLOB RAW byte [] CHAR CHAR java.lang.String DATE DATE java.sql.Date DATETIME DATE java.sql.Timestamp DECIMAL FLOAT (24) java.math.BigDecimal DOUBLE FLOAT (24) java.lang.Double

  • Create a database with the MySQL database tables and 2010-12-31

    Learn some basic operation command, let us learn how to create a database and database tables. 1, using the SHOW statement to find out what currently exists on the server database: mysql> SHOW DATABASES; +----------+ | Database | +----------+ | mysql

  • Database cursor What is the role, how to write? 2011-05-17

    Go http://hi.baidu.com/enson666/blog/item/3af09b80079839db9023d95f.html Cursor is the system for the user to open a data buffer, storing the results of SQL statement execution. Each area has a cursor name. Users can use the SQL statement to retrieve

  • Creating a database using the MySQL database and tables 2010-12-31

    Understand some of the most basic operation command, let us learn how to create a database and database tables. 1, use the SHOW statement to find out what currently exists on the server database: mysql> SHOW DATABASES; +----------+ | Database | +----

  • How To Set Up Database Replication In MySQL 2011-04-11

    Version 1.1 Author: Falko Timme <ft [at] falkotimme [dot] com> Last edited: 01/14/2006 This tutorial describes how to set up database replication in MySQL. MySQL replication allows you to have an exact copy of a database from a master server on anot

  • Mysql Oracle Java data types were 2011-06-29

    Mysql Oracle Java BIGINT NUMBER (19,0) java.lang.Long BIT RAW byte [] BLOB BLOB RAW byte [] CHAR CHAR java.lang.String DATE DATE java.sql.Date DATETIME DATE java.sql.Timestamp DECIMAL FLOAT (24) java.math.BigDecimal DOUBLE FLOAT (24) java.lang.Double

  • MySQL Connector/Arduino 2013-10-31

    MySQL Connector/Arduino 网站 : https://launchpad.net/mysql-arduino MySQL Connector/Arduino 是 Arduino 上的 MySQL 驱动,允许 Arduino 代码直接作为 MySQL 或者 MariaDB 的客户端,支持以太网和 WIFI 连接. 授权协议: 未知 开发语言: C/C++ 操作系统: 嵌入式

  • 解析MySql与Java的时间类型 2014-11-11

    本篇文章是对MySql与Java的时间类型进行了详细的分析介绍,需要的朋友参考下 MySql的时间类型有 Java中与之对应的时间类型date java.sql.Date Datetime java.sql.Timestamp Timestamp java.sql.Timestamp Time java.sql.Time Year java.sql.Date 对其进行分析参考MySql 的reference manual Date:A date. The supported range is '

  • [原创]MySQL Connector/C 库的版本选择 2014-10-31

    公司内部封装的的 dbi 库依赖于 mysql connector/c 库,但由于历史原因,其所依赖的 mysql connector/c 库的版本为原始的 v6.0.2 , 为了对此现状作出调整,现梳理如下: v6.0.2 [win] (动态库) libmysql.dll libmysql.lib (静态库) mysqlclient.lib [linux] (共享库) libmysql.so.16.0.0 (静态库) libmysqlclient.a v6.1.5 === 以下针对动态库 ==

  • win2000 call cmd command under the java database data into mysql (problem solving path with spaces) 2010-10-18

    rem set the path to the file path to increase the implementation of set Path =% path%; C: \ Program Files \ MySQL \ MySQL Server 5.4 \ bin \ mysql-uroot-pzxzboy <F: \ tomcat \ db_robot_data.sql exit This is the bat file. . Save as F: \ tomcat \ impor

  • MySql and Java time type 2010-04-14

    MySql time types are Java types in the corresponding time date java.sql.Date Datetime java.sql.Timestamp Timestamp java.sql.Timestamp Time java.sql.Time Year java.sql.Date Analyze the reference manual reference MySql Date: A date. The supported range

  • Database cursor learning summary 2010-07-14

    Cursor is a system for the user to open a data buffer for storing results of SQL statement execution. Each area has a cursor name. Users can use SQL statements one by one, to obtain records from the cursor. In the database development process, when y

  • PHP + MYSQL in Java, why not worth OA 2010-12-25

    Oa on the market today can basically be attributed to the two camps, that is, java php camp and the camp. However, near the contact oa users, often only see their appearances, but significant differences in price, it is difficult to see the real diff