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

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

?? tinysqlstatement.java

?? TinySQL是一個輕量級的純java數據庫引擎
?? JAVA
字號:
/*
 * tinySQLStatement
 *
 * Statement object for the tinySQL driver
 *
 * A lot of this code is based on or directly taken from
 * George Reese's (borg@imaginary.com) mSQL driver.
 *
 * So, it's probably safe to say:
 *
 * Portions of this code Copyright (c) 1996 George Reese
 *
 * The rest of it:
 *
 * Copyright 1996, Brian C. Jepson
 *                 (bjepson@ids.net)
 * $Author: davis $
 * $Date: 2004/12/18 21:28:47 $
 * $Revision: 1.1 $
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 */

package com.sqlmagic.tinysql;

import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.ResultSet;
import java.sql.Connection;

/**
 * @author Thomas Morgner <mgs@sherito.org> statementString contains the last
 * used SQL-Query. Support for set/getFetchSize, ResultSets are created with a
 * reference to the creating statement
 */
public class tinySQLStatement implements java.sql.Statement {

  /**
   * Holds the last used queryString. execute() has to be synchronized,
   * to guarantee thread-safety
   */
  private String statementString;
  /**
   *
   * A connection object to execute queries and... stuff
   *
   */
  private tinySQLConnection connection;

  /**
   *
   * A result set returned from this query 
   *
   */
  private tinySQLResultSet result;

  /**
   *
   * The max field size for tinySQL
   * This can be pretty big, before things start to break.
   *
   */
  private int max_field_size = 0;

  /**
   *
   * The max rows supported by tinySQL
   * I can't think of any limits, right now, but I'm sure some
   * will crop up...
   *
   */
  private int max_rows = 65536;

  /**
   *
   * The number of seconds the driver will allow for a SQL statement to
   * execute before giving up.  The default is to wait forever (0).
   *
   */
  private int timeout = 0;

  /**
   * How many rows to fetch in a single run. Default is now 4096 rows.
   */
  private int fetchsize = 4096;
  /**
   * Debug flag
   */
  private static boolean debug=false;
  /**
   *
   * Constructs a new tinySQLStatement object.
   * @param conn the tinySQLConnection object
   *
   */
  public tinySQLStatement(tinySQLConnection conn) {

    connection = conn;
    if ( debug) System.out.println("connection is " + connection.toString());

  }

  /**
   *
   * Execute an SQL statement and return a result set.
   * @see java.sql.Statement#executeQuery
   * @exception SQLException raised for any errors
   * @param sql the SQL statement string
   * @return the result set from the query
   *
   */
  public synchronized ResultSet executeQuery(String sql)
       throws SQLException {

    // tinySQL only supports one result set at a time, so
    // don't let them get another one, just in case it's
    // hanging out.
    //
    tinySQLResultSet trs;
    result = null; 
    statementString = sql;

    // create a new tinySQLResultSet with the tsResultSet
    // returned from connection.executetinySQL()
    //
    if ( debug ) System.out.println("executeQuery conn is " + connection.toString());
    trs = new tinySQLResultSet(connection.executetinySQL(this), this);
    return trs; 
  }

  /**
   * 
   * Execute an update, insert, delete, create table, etc. This can
   * be anything that doesn't return rows.
   * @see java.sql.Statement#executeUpdate
   * @exception java.sql.SQLException thrown when an error occurs executing
   * the SQL
   * @return either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing
   */
  public synchronized int executeUpdate(String sql) throws SQLException {

    statementString = sql;
    return connection.executetinyUpdate(this);

  }

  /**
   * 
   * Executes some SQL and returns true or false, depending on
   * the success. The result set is stored in result, and can
   * be retrieved with getResultSet();
   * @see java.sql.Statement#execute
   * @exception SQLException raised for any errors
   * @param sql the SQL to be executed
   * @return true if there is a result set available
   */
  public boolean execute(String sql) throws SQLException {

    // a result set object
    //
    tsResultSet r;

    // execute the query 
    //
    r = connection.executetinySQL(this);

    // check for a null result set. If it wasn't null,
    // use it to create a tinySQLResultSet, and return whether or
    // not it is null (not null returns true).
    //
    if( r == null ) {
      result = null;
    } else {
      result = new tinySQLResultSet(r, this);
    }
    return (result != null);

  }

  /**
   * Returns the current query-String 
   */
  public String getSQLString ()
  {
  	return statementString;
  }

  /**
   * 
   * Close any result sets. This is not used by tinySQL.
   * @see java.sql.Statement#close
   *
   */
  public void close() throws SQLException {
  }

  /**
   * 
   * Returns the last result set
   * @see java.sql.Statement#getResultSet
   * @return null if no result set is available, otherwise a result set
   *
   */
  public ResultSet getResultSet() throws SQLException {

    ResultSet r;

    r = result;    // save the existing result set
    result = null; // null out the existing result set
    return r;      // return the previously extant result set
  }

  /**
   * 
   * Return the row count of the last operation. tinySQL does not support
   * this, so it returns -1
   * @see java.sql.Statement#getUpdateCount
   * @return -1
   */
  public int getUpdateCount() throws SQLException {
    return -1;
  }

  /**
   *
   * This returns true if there are any pending result sets. This
   * should only be true after invoking execute() 
   * @see java.sql.Statement#getMoreResults
   * @return true if rows are to be gotten
   *
   */
  public boolean getMoreResults() throws SQLException {

    return (result != null);

  }

  /**
   *
   * Get the maximum field size to return in a result set.
   * @see java.sql.Statement#getMaxFieldSize
   * @return the value of max field size
   *
   */
  public int getMaxFieldSize() throws SQLException {
    return max_field_size;
  }

  /**
   *
   * set the max field size.
   * @see java.sql.Statement#setMaxFieldSize
   * @param max the maximum field size
   *
   */
  public void setMaxFieldSize(int max) throws SQLException {
    max_field_size = max;
  }

  /**
   * 
   * Get the maximum row count that can be returned by a result set.
   * @see java.sql.Statement#getMaxRows
   * @return the maximum rows 
   *
   */
  public int getMaxRows() throws SQLException {
    return max_rows;
  }

  /**
   *
   * Get the maximum row count that can be returned by a result set.
   * @see java.sql.Statement.setMaxRows
   * @param max the max rows
   *
   */
  public void setMaxRows(int max) throws SQLException {
    max_rows = max;
  }

  /**
   *
   * If escape scanning is on (the default) the driver will do
   * escape substitution before sending the SQL to the database.
   * @see java.sql.Statement#setEscapeProcessing
   * @param enable this does nothing right now
   *
   */
  public void setEscapeProcessing(boolean enable)
       throws SQLException {
    throw new SQLException("The tinySQL Driver doesn't " +
                           "support escape processing.");
  }

  /**
   *
   * Discover the query timeout.
   * @see java.sql.Statement#getQueryTimeout
   * @see setQueryTimeout
   * @return the timeout value for this statement
   *
   */
  public int getQueryTimeout() throws SQLException {
    return timeout;
  }

  /**
   *
   * Set the query timeout.
   * @see java.sql.Statement#setQueryTimeout
   * @see getQueryTimeout
   * @param x the new query timeout value
   *
   */
  public void setQueryTimeout(int x) throws SQLException {
    timeout = x;
  }

  /**
   *
   * This can be used by another thread to cancel a statement. This
   * doesn't matter for tinySQL, as far as I can tell.
   * @see java.sql.Statement#cancel
   *
   */
  public void cancel() {
  }

  /**
   *
   * Get the warning chain associated with this Statement
   * @see java.sql.Statement#getWarnings
   * @return the chain of warnings
   *
   */
  public final SQLWarning getWarnings() throws SQLException {
    return null;
  }

  /**
   *
   * Clear the warning chain associated with this Statement
   * @see java.sql.Statement#clearWarnings
   *
   */
  public void clearWarnings() throws SQLException {
  }

  /**
   * 
   * Sets the cursor name for this connection. Presently unsupported.
   *
   */
  public void setCursorName(String unused) throws SQLException {
    throw new SQLException("tinySQL does not support cursors.");
  }

    //--------------------------JDBC 2.0-----------------------------


    /**
     * JDBC 2.0
     *
     * Gives the driver a hint as to the direction in which
         * the rows in a result set
     * will be processed. The hint applies only to result sets created 
     * using this Statement object.  The default value is 
     * ResultSet.FETCH_FORWARD.
     * <p>Note that this method sets the default fetch direction for 
         * result sets generated by this <code>Statement</code> object.
         * Each result set has its own methods for getting and setting
         * its own fetch direction.
     * @param direction the initial direction for processing rows
     * @exception SQLException if a database access error occurs
         * or the given direction
     * is not one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or
     * ResultSet.FETCH_UNKNOWN
     */
    public void setFetchDirection(int direction) throws SQLException {
      throw new SQLException("tinySQL does not support setFetchDirection.");
    }

    /**
     * JDBC 2.0
     *
     * Retrieves the direction for fetching rows from
         * database tables that is the default for result sets
         * generated from this <code>Statement</code> object.
         * If this <code>Statement</code> object has not set
         * a fetch direction by calling the method <code>setFetchDirection</code>,
         * the return value is implementation-specific.
     *
     * @return the default fetch direction for result sets generated
         *          from this <code>Statement</code> object
     * @exception SQLException if a database access error occurs
     */
    public int getFetchDirection() throws SQLException {
      throw new SQLException("tinySQL does not support getFetchDirection.");
    }

    /**
     * JDBC 2.0
     *
     * Gives the JDBC driver a hint as to the number of rows that should 
     * be fetched from the database when more rows are needed.  The number 
     * of rows specified affects only result sets created using this 
     * statement. If the value specified is zero, then the hint is ignored.
     * The default value is zero.
     *
     * @param rows the number of rows to fetch
     * @exception SQLException if a database access error occurs, or the
     * condition 0 <= rows <= this.getMaxRows() is not satisfied.
     */
    public void setFetchSize(int rows) throws SQLException {
      if ((rows <= 0) || (rows >= this.getMaxRows ()))
    		  throw new SQLException ("Condition 0 <= rows <= this.getMaxRows() is not satisfied");
    
      fetchsize = rows;  
    }

    /**
     * JDBC 2.0
     *
     * Retrieves the number of result set rows that is the default 
         * fetch size for result sets
         * generated from this <code>Statement</code> object.
         * If this <code>Statement</code> object has not set
         * a fetch size by calling the method <code>setFetchSize</code>,
         * the return value is implementation-specific.
     * @return the default fetch size for result sets generated
         *          from this <code>Statement</code> object
     * @exception SQLException if a database access error occurs
     */
    public int getFetchSize() throws SQLException {
      return fetchsize;
    }

    /**
     * JDBC 2.0
     *
     * Retrieves the result set concurrency.
     */
    public int getResultSetConcurrency() throws SQLException {
      throw new SQLException("tinySQL does not support ResultSet concurrency.");
    }

    /**
     * JDBC 2.0
     *
     * Determine the result set type.
     */
    public int getResultSetType()  throws SQLException {
      throw new SQLException("tinySQL does not support getResultSetType.");
    }

    /**
     * JDBC 2.0
     *
     * Adds a SQL command to the current batch of commmands for the statement.
     * This method is optional.
     *
     * @param sql typically this is a static SQL INSERT or UPDATE statement
     * @exception SQLException if a database access error occurs, or the
     * driver does not support batch statements
     */
    public void addBatch( String sql ) throws SQLException {
      throw new SQLException("tinySQL does not support addBatch.");
    }

    /**
     * JDBC 2.0
     *
     * Makes the set of commands in the current batch empty.
     * This method is optional.
     *
     * @exception SQLException if a database access error occurs or the
     * driver does not support batch statements
     */
    public void clearBatch() throws SQLException {
      throw new SQLException("tinySQL does not support clearBatch.");
    }

    /**
     * JDBC 2.0
     * 
     * Submits a batch of commands to the database for execution.
     * This method is optional.
     *
     * @return an array of update counts containing one element for each
     * command in the batch.  The array is ordered according 
     * to the order in which commands were inserted into the batch.
     * @exception SQLException if a database access error occurs or the
     * driver does not support batch statements
     */
    public int[] executeBatch() throws SQLException {
      throw new SQLException("tinySQL does not support executeBatch.");
    }

    /**
     * JDBC 2.0
     * 
     * Returns the <code>Connection</code> object
         * that produced this <code>Statement</code> object.
         * @return the connection that produced this statement
     * @exception SQLException if a database access error occurs
     */
    public Connection getConnection()  throws SQLException
    {
      return connection;
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩专区在线| 国产传媒日韩欧美成人| www国产精品av| 日韩一级二级三级精品视频| 91在线精品一区二区三区| 成人免费视频caoporn| 国产麻豆精品视频| 国产精品一二三在| 成a人片亚洲日本久久| 成人国产在线观看| 欧美性受xxxx黑人xyx| 精品视频在线免费观看| 欧美一区二区三区在线观看视频| 欧美一区二区在线不卡| 精品奇米国产一区二区三区| 久久久精品黄色| 国产精品美女久久久久久 | 日韩激情一区二区| 亚洲精品第一国产综合野| 夜夜夜精品看看| 豆国产96在线|亚洲| 成人久久久精品乱码一区二区三区| 国产a级毛片一区| 99精品欧美一区二区蜜桃免费 | 激情久久五月天| 国产精品一线二线三线| 91天堂素人约啪| 精品视频色一区| 久久夜色精品国产欧美乱极品| 国产精品久久久久久久久果冻传媒 | 麻豆精品在线播放| 国产精品综合二区| 色屁屁一区二区| 亚洲图片激情小说| 欧美日韩午夜精品| 亚洲女与黑人做爰| 久久精品72免费观看| 成人av影院在线| 777午夜精品免费视频| 国产日韩av一区| 日本美女一区二区三区视频| 成人短视频下载 | 亚洲成人激情综合网| 国产综合色在线视频区| 91豆麻精品91久久久久久| 欧美精品一区二区三区蜜臀| 一区二区三区不卡在线观看| 国产精品18久久久久久久久久久久| 一本大道久久精品懂色aⅴ | 一区二区三区精品视频在线| 国产自产视频一区二区三区 | 日韩欧美激情四射| 国产麻豆午夜三级精品| 91久久国产综合久久| 欧美激情一区二区三区在线| 日本伊人精品一区二区三区观看方式| 成人午夜在线免费| 久久久综合视频| 国内精品伊人久久久久影院对白| 欧美日韩三级一区| 一区二区三区欧美| 高清国产午夜精品久久久久久| 日韩精品在线看片z| 视频一区视频二区中文| 欧美影片第一页| 国产精品电影院| 国模娜娜一区二区三区| 精品国产精品网麻豆系列| 免费三级欧美电影| 51久久夜色精品国产麻豆| 亚洲综合一二区| 国产乱一区二区| 激情文学综合丁香| 精品在线播放午夜| 国产一区高清在线| 日韩欧美专区在线| 美国毛片一区二区| 精品免费日韩av| 经典三级在线一区| 久久久www成人免费无遮挡大片| 免费高清在线一区| 精品蜜桃在线看| 成人国产精品免费观看| 亚洲欧美偷拍另类a∨色屁股| 97se狠狠狠综合亚洲狠狠| 亚洲一二三级电影| 7777精品伊人久久久大香线蕉经典版下载| 亚洲国产精品嫩草影院| 欧美二区三区91| 卡一卡二国产精品| 欧美国产国产综合| 色欧美日韩亚洲| 亚洲无线码一区二区三区| 精品国产乱码久久久久久浪潮| 久久久蜜桃精品| 国产精品女上位| k8久久久一区二区三区| 综合在线观看色| 欧美午夜在线一二页| 日韩精品电影在线| 国产丝袜欧美中文另类| 99国产精品久| 青青青爽久久午夜综合久久午夜| 亚洲精品一区二区三区精华液| 成人综合在线观看| 亚洲chinese男男1069| 久久综合国产精品| 欧美性淫爽ww久久久久无| 精品影视av免费| 一区二区三区国产豹纹内裤在线| 精品欧美乱码久久久久久| www.一区二区| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲免费高清视频在线| 欧美xxxx老人做受| 欧美午夜宅男影院| 亚洲精品自拍动漫在线| 高清av一区二区| 午夜视黄欧洲亚洲| 一本色道久久加勒比精品| 亚洲精品v日韩精品| 日韩欧美一级特黄在线播放| av亚洲精华国产精华| 视频精品一区二区| 日韩理论电影院| 精品国产一区二区三区不卡| 欧美日韩一级视频| 99视频精品免费视频| 韩国女主播一区| 日韩中文字幕91| 亚洲一区二区三区四区在线观看 | www.成人网.com| 极品少妇xxxx精品少妇偷拍| 亚洲女同一区二区| 国产精品久久久久毛片软件| 欧美精品一区二区三区在线播放| 日本久久一区二区| 日本不卡视频在线| 欧美日韩中文字幕一区二区| 国产亚洲精品aa| 51精品久久久久久久蜜臀| 91福利视频久久久久| 不卡一区二区在线| 成人免费毛片a| 成人理论电影网| 成人精品国产免费网站| 国产成人免费视频网站| 国产精品99久久久久久似苏梦涵| 国产一区二三区好的| 极品尤物av久久免费看| 麻豆精品视频在线观看免费| 五月天欧美精品| 亚洲午夜一区二区| 亚洲国产毛片aaaaa无费看| 亚洲精品日产精品乱码不卡| 悠悠色在线精品| 亚洲一区日韩精品中文字幕| 亚洲精品欧美专区| 五月综合激情婷婷六月色窝| 丝袜美腿成人在线| 日精品一区二区| 福利一区福利二区| 国产麻豆精品在线观看| 亚洲乱码国产乱码精品精小说| 国产精品久久久久永久免费观看| 中文文精品字幕一区二区| 中文字幕一区二区三区视频| 中文字幕日韩av资源站| 亚洲影院理伦片| 美国十次了思思久久精品导航| 极品销魂美女一区二区三区| 国产ts人妖一区二区| 成人国产精品免费| 欧美日韩精品一区二区三区| 欧美大片在线观看一区二区| 欧美国产禁国产网站cc| 亚洲成人免费观看| 激情五月播播久久久精品| 成人国产精品免费观看视频| 欧美老女人第四色| 日本一区二区不卡视频| 成人免费在线观看入口| 国产精品久久久久久户外露出| 五月激情六月综合| 国产一区二区三区久久悠悠色av| 99久久国产综合精品女不卡| 欧美日韩黄色一区二区| 伊人婷婷欧美激情| 国产专区欧美精品| 国产婷婷精品av在线| 亚洲国产视频直播| 国产在线精品一区二区三区不卡 | 午夜电影一区二区| 国产一区二区h| 欧洲精品一区二区三区在线观看| 久久久www成人免费毛片麻豆| 亚洲免费看黄网站| 国产一区二区三区免费在线观看| 欧美中文字幕不卡| 国产精品二三区|