亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mysqlio.java

?? jsp數據庫系統
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/*
   Copyright (C) 2002 MySQL AB

      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2 of the License, or
      (at your option) any later version.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.

      You should have received a copy of the GNU General Public License
      along with this program; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 */
package com.mysql.jdbc;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;

import java.lang.ref.SoftReference;

import java.net.Socket;

import java.security.NoSuchAlgorithmException;

import java.sql.SQLException;
import java.sql.SQLWarning;

import java.util.ArrayList;
import java.util.Properties;
import java.util.zip.Deflater;
import java.util.zip.Inflater;


/**
 * This class is used by Connection for communicating with the MySQL server.
 *
 * @author Mark Matthews
 * @version $Id: MysqlIO.java,v 1.32.2.46 2004/02/06 00:54:42 mmatthew Exp $
 *
 * @see java.sql.Connection
 */
public class MysqlIO {
    static final int NULL_LENGTH = ~0;
    static final int COMP_HEADER_LENGTH = 3;
    static final int MIN_COMPRESS_LEN = 50;
    static final int HEADER_LENGTH = 4;
    private static int maxBufferSize = 65535;
    private static final int CLIENT_COMPRESS = 32; /* Can use compression
    protcol */
    private static final int CLIENT_CONNECT_WITH_DB = 8;
    private static final int CLIENT_FOUND_ROWS = 2;
    private static final int CLIENT_IGNORE_SPACE = 256; /* Ignore spaces
    before '(' */
    private static final int CLIENT_LOCAL_FILES = 128; /* Can use LOAD DATA
    LOCAL */

    /* Found instead of
       affected rows */
    private static final int CLIENT_LONG_FLAG = 4; /* Get all column flags */
    private static final int CLIENT_LONG_PASSWORD = 1; /* new more secure
    passwords */
    private static final int CLIENT_PROTOCOL_41 = 512; // for > 4.1.1
    private static final int CLIENT_INTERACTIVE = 1024;
    private static final int CLIENT_SSL = 2048;
    private static final int CLIENT_RESERVED = 16384; // for 4.1.0 only
    private static final int CLIENT_SECURE_CONNECTION = 32768;
    private static final String FALSE_SCRAMBLE = "xxxxxxxx";

    /**
     * We store the platform 'encoding' here, only used to avoid munging
     * filenames for LOAD DATA LOCAL INFILE...
     */
    private static String jvmPlatformCharset = null;

    static {
        OutputStreamWriter outWriter = null;

        //
        // Use the I/O system to get the encoding (if possible), to avoid
        // security restrictions on System.getProperty("file.encoding") in
        // applets (why is that restricted?)
        //
        try {
            outWriter = new OutputStreamWriter(new ByteArrayOutputStream());
            jvmPlatformCharset = outWriter.getEncoding();
        } finally {
            try {
                outWriter.close();
            } catch (IOException ioEx) {
                // ignore
            }
        }
    }

    //
    // Use this when reading in rows to avoid thousands of new()
    // calls, because the byte arrays just get copied out of the
    // packet anyway
    //
    private Buffer reusablePacket = null;
    private Buffer sendPacket = null;
    private Buffer sharedSendPacket = null;

    /** Data to the server */

    //private DataOutputStream     _Mysql_Output             = null;
    private BufferedOutputStream mysqlOutput = null;
    private com.mysql.jdbc.Connection connection;
    private Deflater deflater = null;
    private Inflater inflater = null;

    /** Buffered data from the server */

    //private BufferedInputStream  _Mysql_Buf_Input          = null;

    /** Buffered data to the server */

    //private BufferedOutputStream _Mysql_Buf_Output         = null;

    /** Data from the server */

    //private DataInputStream      _Mysql_Input              = null;
    private InputStream mysqlInput = null;
    private RowData streamingData = null;

    //
    // For SQL Warnings
    //
    private SQLWarning warningChain = null;

    /** The connection to the server */
    private Socket mysqlConnection = null;
    private SocketFactory socketFactory = null;

    //
    // Packet used for 'LOAD DATA LOCAL INFILE'
    //
    // We use a SoftReference, so that we don't penalize intermittent
    // use of this feature
    //
    private SoftReference loadFileBufRef;

    //
    // Used to send large packets to the server versions 4+
    // We use a SoftReference, so that we don't penalize intermittent
    // use of this feature
    //
    private SoftReference splitBufRef;
    private String host = null;
    private String seed;
    private String serverVersion = null;
    private String socketFactoryClassName = null;
    private byte[] packetHeaderBuf = new byte[4];
    private boolean clearStreamBeforeEachQuery = false;
    private boolean colDecimalNeedsBump = false; // do we need to increment the colDecimal flag?
    private boolean has41NewNewProt = false;

    /** Does the server support long column info? */
    private boolean hasLongColumnInfo = false;
    private boolean isInteractiveClient = false;

    /**
     * Does the character set of this connection match the character set of the
     * platform
     */
    private boolean platformDbCharsetMatches = true;
    private boolean profileSql = false;

    /** Should we use 4.1 protocol extensions? */
    private boolean use41Extensions = false;
    private boolean useCompression = false;
    private boolean useNewLargePackets = false;
    private boolean useNewUpdateCounts = false; // should we use the new larger update counts?
    private byte packetSequence = 0;
    private byte protocolVersion = 0;
    private int clientParam = 0;

    // changed once we've connected.
    private int maxAllowedPacket = 1024 * 1024;
    private int maxThreeBytes = 255 * 255 * 255;
    private int port = 3306;
    private int serverMajorVersion = 0;
    private int serverMinorVersion = 0;
    private int serverSubMinorVersion = 0;

    /**
     * Constructor:  Connect to the MySQL server and setup a stream connection.
     *
     * @param host the hostname to connect to
     * @param port the port number that the server is listening on
     * @param socketFactoryClassName the socket factory to use
     * @param props the Properties from DriverManager.getConnection()
     * @param conn the Connection that is creating us
     * @param socketTimeout the timeout to set for the socket (0 means no
     *        timeout)
     *
     * @throws IOException if an IOException occurs during connect.
     * @throws java.sql.SQLException if a database access error occurs.
     */
    protected MysqlIO(String host, int port, String socketFactoryClassName,
        Properties props, com.mysql.jdbc.Connection conn, int socketTimeout)
        throws IOException, java.sql.SQLException {
        this.connection = conn;
        this.reusablePacket = new Buffer(this.connection.getNetBufferLength());
        this.port = port;
        this.host = host;
        this.socketFactoryClassName = socketFactoryClassName;
        this.socketFactory = createSocketFactory();
        this.mysqlConnection = socketFactory.connect(this.host, props);
        this.clearStreamBeforeEachQuery = this.connection.alwaysClearStream();

        if (socketTimeout != 0) {
            try {
                this.mysqlConnection.setSoTimeout(socketTimeout);
            } catch (Exception ex) {
                /* Ignore if the platform does not support it */
            }
        }

        this.mysqlConnection = this.socketFactory.beforeHandshake();

        if (!this.connection.isUsingUnbufferedInput()) {
            this.mysqlInput = new BufferedInputStream(this.mysqlConnection
                    .getInputStream(), 16384);
        } else {
            this.mysqlInput = this.mysqlConnection.getInputStream();
        }

        this.mysqlOutput = new BufferedOutputStream(this.mysqlConnection
                .getOutputStream(), 16384);
        this.isInteractiveClient = this.connection.isInteractiveClient();
    }

    /**
     * Should the driver generate SQL statement profiles?
     *
     * @param flag should the driver enable profiling?
     */
    protected void setProfileSql(boolean flag) {
        this.profileSql = flag;
    }

    /**
     * Build a result set. Delegates to buildResultSetWithRows() to build a
     * JDBC-version-specific ResultSet, given rows as byte data, and field
     * information.
     *
     * @param columnCount the number of columns in the result set
     * @param maxRows the maximum number of rows to read (-1 means all rows)
     * @param resultSetType the type of result set (CONCUR_UPDATABLE or
     *        READ_ONLY)
     * @param streamResults should the result set be read all at once, or
     *        streamed?
     * @param catalog the database name in use when the result set was created
     *
     * @return a result set
     *
     * @throws Exception if a database access error occurs
     */
    protected ResultSet getResultSet(long columnCount, int maxRows,
        int resultSetType, boolean streamResults, String catalog)
        throws Exception {
        Buffer packet; // The packet from the server
        Field[] fields = new Field[(int) columnCount];

        // Read in the column information
        for (int i = 0; i < columnCount; i++) {
            packet = readPacket();
            fields[i] = unpackField(packet, false);
        }

        packet = reuseAndReadPacket(this.reusablePacket);

        RowData rowData = null;

        if (!streamResults) {
            ArrayList rows = new ArrayList();

            // Now read the data
            byte[][] rowBytes = nextRow((int) columnCount);
            int rowCount = 0;

            if (rowBytes != null) {
                rows.add(rowBytes);
                rowCount = 1;
            }

            while ((rowBytes != null) && (rowCount < maxRows)) {
                rowBytes = nextRow((int) columnCount);

                if (rowBytes != null) {
                    rows.add(rowBytes);
                    rowCount++;
                } else {
                    if (Driver.TRACE) {
                        Debug.msg(this, "* NULL Row *");
                    }
                }
            }

            //
            // Clear any outstanding data left on the wire
            // when we've artifically limited the number of 
            // rows we retrieve (fix for BUG#1695)
            //
            if (rowCount <= maxRows) {
                clearInputStream();
            }

            if (Driver.TRACE) {
                Debug.msg(this,
                    "* Fetched " + rows.size() + " rows from server *");
            }

            rowData = new RowDataStatic(rows);
            reclaimLargeReusablePacket();
        } else {
            rowData = new RowDataDynamic(this, (int) columnCount);
            this.streamingData = rowData;
        }

        return buildResultSetWithRows(catalog, fields, rowData, resultSetType);
    }

    /**
     * Forcibly closes the underlying socket to MySQL.
     */
    protected final void forceClose() {
        try {
            if (this.mysqlInput != null) {
                this.mysqlInput.close();
            }
        } catch (IOException ioEx) {
            // we can't do anything constructive about this
            // Let the JVM clean it up later
            this.mysqlInput = null;
        }

        try {
            if (this.mysqlOutput != null) {
                this.mysqlOutput.close();
            }
        } catch (IOException ioEx) {
            // we can't do anything constructive about this
            // Let the JVM clean it up later
            this.mysqlOutput = null;
        }

        try {
            if (this.mysqlConnection != null) {
                this.mysqlConnection.close();
            }
        } catch (IOException ioEx) {
            // we can't do anything constructive about this
            // Let the JVM clean it up later
            this.mysqlConnection = null;
        }
    }

    /**

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91色综合久久免费分享| 亚洲成a人v欧美综合天堂| 国产精品你懂的| 国产成人午夜视频| 婷婷国产v国产偷v亚洲高清| 五月婷婷激情综合| 亚洲欧美激情一区二区| 久久疯狂做爰流白浆xx| 91久久精品一区二区三区| 久久久久久亚洲综合影院红桃| 依依成人综合视频| 成人网在线播放| 久久久久久夜精品精品免费| 日韩高清一区二区| 91精品国产欧美一区二区| 日韩vs国产vs欧美| 成人美女在线观看| 久久亚洲免费视频| 日韩av电影天堂| 欧美色涩在线第一页| 欧美国产一区在线| 国产传媒日韩欧美成人| 欧美电影免费观看完整版| 日本网站在线观看一区二区三区| 一本在线高清不卡dvd| 亚洲欧美一区二区在线观看| 国产馆精品极品| 国产亚洲欧美一区在线观看| 国产尤物一区二区在线| 亚洲精品一区在线观看| 另类小说视频一区二区| 日韩一区二区在线观看视频 | av在线综合网| 国产精品色哟哟网站| 国产成人av自拍| 亚洲国产精品v| 成人国产视频在线观看| 亚洲天堂av老司机| 在线观看视频一区| 性欧美大战久久久久久久久| 欧美日韩国产免费| 精品在线观看视频| 久久先锋影音av| 国产99精品国产| 中文字幕一区av| 欧美色偷偷大香| 免费在线观看一区| 久久久久99精品一区| 丁香啪啪综合成人亚洲小说 | 久久综合九色综合欧美98| 国内精品免费**视频| 欧美国产一区二区在线观看 | 欧美一区二区在线不卡| 精品一区二区在线观看| 国产欧美一区二区在线| 99国产精品国产精品久久| 调教+趴+乳夹+国产+精品| www一区二区| av亚洲精华国产精华| 亚洲午夜久久久久久久久电影网 | 国产精品不卡视频| 欧美色图激情小说| 国产米奇在线777精品观看| 中文字幕一区av| 91精品欧美福利在线观看| 国产成人鲁色资源国产91色综| 亚洲精品视频自拍| 欧美tickle裸体挠脚心vk| 99国产精品久| 看电视剧不卡顿的网站| 中文字幕一区二区日韩精品绯色| 欧美日本精品一区二区三区| 成人深夜在线观看| 日日摸夜夜添夜夜添国产精品| 国产无人区一区二区三区| 欧美日韩国产乱码电影| 成人影视亚洲图片在线| 视频一区视频二区在线观看| 国产精品毛片大码女人| 欧美岛国在线观看| 91激情五月电影| 国产精品99久久久| 人人精品人人爱| 一区二区三区在线免费观看| 欧美国产日韩亚洲一区| 精品嫩草影院久久| 欧美年轻男男videosbes| 96av麻豆蜜桃一区二区| 久久精品国产99国产| 亚洲二区在线观看| 中文字幕一区二区三区四区| 久久欧美一区二区| 欧美电影免费观看高清完整版在| 欧美日韩卡一卡二| 色8久久人人97超碰香蕉987| 9人人澡人人爽人人精品| 国产精品18久久久久久久久| 久久国产生活片100| 亚洲国产wwwccc36天堂| 亚洲欧美一区二区三区极速播放| 欧美激情一区二区三区不卡| 久久久久久亚洲综合| 日韩精品一区二区在线| 欧美高清精品3d| 欧美放荡的少妇| 欧美高清你懂得| 色老头久久综合| va亚洲va日韩不卡在线观看| 成人综合婷婷国产精品久久蜜臀| 精品一区二区三区在线视频| 久久精品国产亚洲a| 久久99热99| 久久精品国产秦先生| 蜜臀精品一区二区三区在线观看| 日韩精品欧美精品| 日韩一区精品字幕| 午夜av电影一区| 日韩精品亚洲一区| 久久精工是国产品牌吗| 精品一区二区三区在线播放| 韩国一区二区三区| 成人免费毛片高清视频| av色综合久久天堂av综合| 99久久er热在这里只有精品66| 色香蕉久久蜜桃| 在线观看区一区二| 日韩欧美在线观看一区二区三区| 日韩精品一区二区三区视频 | 这里只有精品电影| 91精品国产高清一区二区三区蜜臀| 8x福利精品第一导航| 日韩一区二区免费视频| 欧美一区日韩一区| 久久免费美女视频| 国产精品久久久99| 亚洲小说欧美激情另类| 麻豆国产91在线播放| 大白屁股一区二区视频| 一本一本久久a久久精品综合麻豆| 欧美色爱综合网| 精品久久久久久无| 国产精品成人免费在线| 亚洲一区二区三区在线播放| 精品亚洲成a人| 91蜜桃免费观看视频| 欧美一区二区观看视频| 欧美国产一区视频在线观看| 亚洲午夜精品在线| 黑人精品欧美一区二区蜜桃| 91丨porny丨中文| 日韩一区二区三区观看| 国产精品丝袜久久久久久app| 亚洲成人午夜电影| 国产精品99久久久久久宅男| 欧美伊人精品成人久久综合97| 日韩美女一区二区三区四区| 亚洲欧美偷拍卡通变态| 激情图片小说一区| 欧美中文字幕一区二区三区亚洲| 久久麻豆一区二区| 性感美女久久精品| 国产精品资源在线| 欧美日韩一区精品| 国产精品第四页| 九九久久精品视频| 欧美区视频在线观看| 亚洲欧洲av另类| 国产精品羞羞答答xxdd| 这里只有精品免费| 亚洲最大色网站| 成人免费不卡视频| 久久综合九色综合欧美就去吻| 午夜精品久久久久久不卡8050| 99国产一区二区三精品乱码| 2024国产精品视频| 欧美96一区二区免费视频| 欧美丝袜丝nylons| 国产精品传媒在线| 国产成人亚洲综合色影视| 欧美大片在线观看一区| 亚洲va韩国va欧美va| 91国模大尺度私拍在线视频| 国产精品国产三级国产三级人妇| 国产毛片精品一区| 精品日韩一区二区三区免费视频| 香蕉久久夜色精品国产使用方法| 在线影视一区二区三区| 亚洲四区在线观看| eeuss鲁片一区二区三区在线看| 日韩女优av电影| 麻豆精品一区二区av白丝在线| 欧美日本韩国一区二区三区视频| 亚洲电影一级黄| 欧美日韩免费观看一区二区三区| 亚洲精品乱码久久久久| 色狠狠av一区二区三区| 亚洲视频小说图片| 色综合天天视频在线观看| 亚洲精品国产精华液| 色菇凉天天综合网|