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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tinysqlresultset.java

?? TinySQL是一個輕量級的純java數(shù)據(jù)庫引擎
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/*
 * The tinySQLResultSet class for the tinySQL JDBC 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:30:40 $
 * $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.Date;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Ref;
import java.sql.Array;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Hashtable;
import java.text.ParsePosition;

/**
 * @author Thomas Morgner <mgs@sherito.org> 
 * <ul>
 * <li>tinySQLResultSet now holds a reference
 * to statement which created it. If the resultset was not created by an statement,
 * <code>null</code> is returned (f.i. used in DatabaseMetaData-Queries).  
 * <li>Changed the code to support setting a fetchsize for queries.
 * <li>Parsing of dates corrected to format yyyyMMdd
 * <li>Now supporting the FetchDirection methods, getType().
 * <li>Concurrency is not returned as CONCUR_READ_ONLY as lowest common standard.
 * <li>getColumnTypes returns now values given in tsResultSet and does not try to
 * guess from strings.
 * </ul>
 */
public class tinySQLResultSet implements java.sql.ResultSet {

  // The Statement that created this resultset
  private tinySQLStatement statement=(tinySQLStatement)null;
  private tinySQLPreparedStatement preparedStatement=(tinySQLPreparedStatement)null;

  /**
   *
   * The tsResultSet
   * 
   */
  private tsResultSet result;

  /**
   *
   * A tsRow object to hold the current row
   *
   */
  private tsRow current_row;

  /**
   *
   * The index of the current row
   *
   */
  private int current_row_index = 0;

  /**
   *
   * The meta data for this result set.
   *
   */
  private tinySQLResultSetMetaData meta;

  /**
   *
   * A Hashtable that maps column names to columns
   *
   */
  private Hashtable column_map = null;

  /**
   *
   * Given a tsResultSet, this will construct a new tinySQLResultSet
   * @param res the tsResultSet from a query
   *
   */
   public tinySQLResultSet(tsResultSet res, tinySQLStatement inputStatement) {
    result = res;
     this.statement = inputStatement;
  }
   public tinySQLResultSet(tsResultSet res, tinySQLPreparedStatement inputStatement) {
    result = res;
     this.preparedStatement = inputStatement;
  }

  /**
   *
   * Advance to the next row in the result set. 
   * @see java.sql.ResultSet#next
   * @exception SQLException thrown in case of error
   * @return true if there are any more rows to process, otherwise false.
   *
   */
  public synchronized boolean next() throws SQLException {

    try {

      // automatically return false if the
      // result set is empty
      //
      if( result.size() < 1 ) {
        return false;
      }

      // increment the current row index
      //
      current_row_index++;
      // retrieve the row at the current_row_index and store
      // it in the current_row field.
      //
      current_row = result.rowAt(current_row_index - 1);

      // If no rows was retrieved, return false to indicate
      // that there are no more results.
      if (current_row == null)
      {
      	return false;
      }
      return true;

    } catch( Exception e ) {
      throw new SQLException(e.getMessage());
    }

  }

  /**
   *
   * Provides a method to close a ResultSet
   * 
   * @see java.sql.ResultSet#close
   *
   */
  public void close() throws SQLException {
  }

  /**
   *
   * Returns whether or not the last column read was null.
   * tinySQL doesn't have nulls, so this is inconsequential...
   * @see java.sql.ResultSet#wasNull
   * @return true if the column was null, false otherwise
   *
   */
  public boolean wasNull() throws SQLException {
    return false;
  }

  /**
   * 
   * Gets the value of a column (by index) as a String.
   * @see java.sql.ResultSet#getString
   * @exception SQLException thrown for bogus column index
   * @param column the column index
   * @return the column's String value
   *
   */
  public String getString(int column) throws SQLException
  {
     String columnValue;
    // retrieve the column at the specified index. tinySQL
    // has a column offset of zero, while JDBC uses one.
    // Because of this, I need to subtract one from the
    // index to get the tinySQL index.
    //
    if ( current_row == (tsRow)null ) return (String)null;
    tsColumn col = result.columnAtIndex(column-1);

    // return the column's value
    //
    columnValue = current_row.columnAsString(col);
/*
 *  Reformat date columns to YYYY-MM-DD - this is standard default
 *  Java format for getString on Date columns. 
 */
    if ( Utils.isDateColumn(col.type) )
       columnValue = UtilString.toStandardDate(columnValue);
    return columnValue;
  }

  /**
   *
   * Get the value of a column in the current row as a Java byte.
   *
   * @param columnIndex the first column is 1, the second is 2, ...
   * @return the column value
   *
   */
  public byte getByte(int column) throws SQLException {

    // get the column as a string
    //
    String str = getString(column);

    // if it's a blank string, return 0,
    // otherwise, cast the first character 
    // in the string to byte and return it.
    //
    if( str.equals("") ) {
      return 0;
    } else {
      return (byte)str.charAt(0);
    }

  }

  /**
   *
   * Get the value of a column in the current row as boolean
   * @see java.sql.ResultSet#getBoolean
   * @exception SQLException Harum Scarum's coming down fast, Clay...
   * @param column the column index
   * @return false for "", null, or "0"; true otherwise
   */
  public boolean getBoolean(int column) throws SQLException {

    try {

      // get the column as a string
      //
      String str = getString(column);

      // a blank string is false
      //
      if( str.equals("") ) return false;

      // a zero is false
      //
      if( str.equals("0") ) return false;

      // nothing is true... everything is permitted
      //
      return true;

    } catch( Exception e ) {
      throw new SQLException(e.getMessage());
    }
  }

  /**
   *
   * Get the value of a column in the current row as a short.
   * @see java.sql.ResultSet#getShort
   * @exception SQLException D'ohh!
   * @param column the column being retrieved
   * @return the column as a short
   *
   */
  public short getShort(int column)
     throws SQLException
  {

    // get the column as a string
    //
    String str = getString(column);

    // if it's null, return 0
    //
    if( str == null ) return 0;

    // try to convert it to an integer, and cast it to short
    //
    try
    {
      return ( short )( Integer.valueOf( str.trim( )).intValue( ));
    }
    catch( NumberFormatException e )
    {
      throw new SQLException( "tinySQL invalid short Number: " + e.getMessage( ));
    }
  }  

  /**
   *
   * Retrieve a column from the current row as an int
   * @see java.sql.ResultSet#getInt
   * @exception SQLException bad things... the wind began to howl...
   * @param column the column being retrieved
   * @return the column as an integer
   *
   */
  public int getInt(int column)
     throws SQLException
  {
    int dotAt;

    // get the column as a string
    //
    String str = getString(column);

    // if it's null, return Integer.MIN_VALUE
    //
    if( str == null ) return Integer.MIN_VALUE;

    // try to convert this string to integer
    //
    dotAt = str.indexOf(".");
    if ( dotAt > -1 ) str = str.substring(0,dotAt);
    try
    {
      return Integer.valueOf( str.trim( )).intValue( );
    }
    catch( NumberFormatException e )
    {
      return Integer.MIN_VALUE;
    }
  }  

  /**
   * 
   * Get the value of a column in the current row as a long
   * @see java.sql.ResultSet#getLong
   * @exception SQLException in case of an error
   * @param column the column being retrieved
   * @return the column as a long
   *
   */
  public long getLong(int column)
    throws SQLException
  {

    // get the column as a string
    //
    String str = getString(column);

    // it it's null, return 0
    if( str == null ) return 0;

    // try to convert the String to a long
    //
    try
    {
      return Long.valueOf( str.trim( )).longValue( );
    }
    catch( NumberFormatException e )
    {
      throw new SQLException( "tinySQL invalid Long Number: " + e.getMessage( ));
    }
  }  

  /**
   *
   * Return a column as a float.
   * @see java.sql.ResultSet#getFloat
   * @exception SQLException in case of error
   * @param column the column being retrieved
   * @return the column as a float
   *
   */
  public float getFloat(int column)
     throws SQLException
  {

    // get the column as a string
    //
    String str = getString(column);

    // if it's null, assume zero
    //
    if( str == null ) return 0;

    // try to perform the conversion
    //
    try
    {
      return Float.valueOf( str.trim( )).floatValue( );
    }
    catch( NumberFormatException e )
    {
      throw new SQLException( "Invalid Number: " + e.getMessage( ));
    }
  }  

  /**
   *
   * Return a column as a double
   * @see java.sql.ResultSet#getDouble

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲韩国一区二区三区| 精品在线视频一区| 精品午夜一区二区三区在线观看 | 在线观看视频一区二区欧美日韩| 91精品国产综合久久久蜜臀图片 | 国产精品区一区二区三区| 香蕉加勒比综合久久| 丰满少妇在线播放bd日韩电影| 91精品国产入口| 一区二区三区四区在线播放 | 精品国产一区二区三区久久影院 | 成人av网址在线| 日韩女优制服丝袜电影| 亚洲自拍偷拍av| 91亚洲精品久久久蜜桃| 久久久精品黄色| 久久精品国产精品青草| 在线综合+亚洲+欧美中文字幕| 亚洲精品视频在线观看免费| 成人在线视频一区二区| 国产亚洲美州欧州综合国| 精品一二三四区| 日韩西西人体444www| 奇米影视在线99精品| 欧美日韩1234| 日产精品久久久久久久性色| 制服丝袜国产精品| 视频一区欧美精品| 欧美精品在线一区二区三区| 香蕉成人伊视频在线观看| 欧美日韩一区 二区 三区 久久精品| 亚洲欧美aⅴ...| 色哟哟在线观看一区二区三区| 国产精品久久久久久一区二区三区 | 成人精品亚洲人成在线| 国产精品国产a| 99视频精品全部免费在线| 成人免费小视频| 91福利资源站| 欧美亚洲愉拍一区二区| 经典三级视频一区| 精品国产电影一区二区| 精品一区二区三区香蕉蜜桃| 久久夜色精品一区| 粉嫩aⅴ一区二区三区四区| 日本一区二区三区视频视频| 97久久精品人人做人人爽50路| 日韩一区中文字幕| 欧美性猛交xxxx黑人交| 肉丝袜脚交视频一区二区| 欧美大肚乱孕交hd孕妇| 国产精品99久久久久久久女警| 国产精品欧美一区二区三区| 在线观看视频一区二区| 麻豆专区一区二区三区四区五区| 精品久久久久久久人人人人传媒| 国模一区二区三区白浆 | 99久久99久久久精品齐齐| 亚洲人妖av一区二区| 欧美性感一区二区三区| 欧美日韩精品一区二区三区| 日本视频中文字幕一区二区三区| 久久久久九九视频| 91小视频在线免费看| 日韩精品欧美成人高清一区二区| 久久夜色精品国产欧美乱极品| 波多野结衣亚洲| 五月婷婷欧美视频| 久久精品一区二区三区四区| 91浏览器打开| 日韩精品成人一区二区在线| 中文字幕欧美激情| 欧美日韩精品欧美日韩精品| 国产精品小仙女| 亚洲一区二区视频在线观看| 久久综合中文字幕| 91官网在线免费观看| 精品一区二区三区免费| 亚洲黄色片在线观看| 精品国产乱码久久久久久蜜臀 | 日韩视频在线永久播放| 成人在线视频一区| 免费在线成人网| 依依成人精品视频| 久久美女高清视频| 9191精品国产综合久久久久久| 成人高清视频在线| 久久国产婷婷国产香蕉| 亚洲一区免费在线观看| 国产精品区一区二区三区 | 欧美艳星brazzers| 床上的激情91.| 久久精品国产亚洲a| 午夜精品久久久久久久99水蜜桃| 中文在线免费一区三区高中清不卡| 欧美日韩国产综合一区二区 | 91亚洲国产成人精品一区二三| 精品中文字幕一区二区| 亚洲国产一区二区视频| 亚洲免费观看高清| 国产精品视频你懂的| 欧美哺乳videos| 欧美系列亚洲系列| 色婷婷久久久亚洲一区二区三区 | 日韩手机在线导航| 欧美精品久久一区二区三区 | 色综合久久88色综合天天| 成人免费的视频| 国产成人午夜精品影院观看视频| 老司机精品视频导航| 丝瓜av网站精品一区二区| 一区二区三区四区五区视频在线观看| 国产精品天天看| 久久看人人爽人人| 国产欧美一区视频| 久久免费午夜影院| 久久精品欧美日韩| 久久久99久久| 欧美国产精品中文字幕| 欧美高清在线视频| 成人免费一区二区三区在线观看 | 日韩欧美一区中文| 日韩欧美卡一卡二| 精品国产一区二区三区不卡 | 麻豆国产精品视频| 久久精品国产在热久久| 国产一区二区0| 成人动漫精品一区二区| 成人h精品动漫一区二区三区| 成人app在线观看| 色呦呦日韩精品| 欧美二区三区91| 欧美日韩卡一卡二| 日韩一区二区免费视频| 精品999在线播放| 亚洲国产精品传媒在线观看| 国产精品电影院| 午夜影院久久久| 麻豆一区二区在线| 成人免费的视频| 欧美日韩成人在线一区| 2024国产精品| 亚洲欧美日韩国产成人精品影院| 亚洲成人免费视频| 经典三级一区二区| 91蜜桃网址入口| 91精品国产一区二区| 国产亚洲制服色| 亚洲图片有声小说| 国产激情视频一区二区三区欧美 | 五月婷婷久久综合| 国产麻豆一精品一av一免费| 精久久久久久久久久久| 色诱亚洲精品久久久久久| 欧美电视剧免费全集观看| 中文字幕一区三区| 天堂午夜影视日韩欧美一区二区| 国产美女一区二区三区| 在线观看日韩高清av| 久久蜜桃av一区二区天堂| 亚洲一区二区在线免费看| 国产麻豆日韩欧美久久| 欧美日韩国产123区| 久久久99精品久久| 五月激情综合婷婷| 北条麻妃一区二区三区| 日韩欧美色综合网站| 夜夜嗨av一区二区三区| 国产精品18久久久久久久网站| 欧美午夜精品理论片a级按摩| 久久综合精品国产一区二区三区| 亚洲一区二区三区四区的| 国产成人免费在线观看不卡| 欧美日韩国产成人在线91| 国产精品福利av| 国产精品一卡二卡在线观看| 欧美日韩在线电影| 国产精品久久久久久妇女6080 | 水野朝阳av一区二区三区| 91在线观看高清| 国产亚洲一区二区三区在线观看| 午夜不卡av免费| 色猫猫国产区一区二在线视频| 中文字幕av资源一区| 国产成人高清视频| 亚洲成人av电影在线| 成人av资源站| 欧美电影免费观看高清完整版在线 | 成人久久视频在线观看| 欧美大片免费久久精品三p| 亚洲一区二区视频在线观看| 一本高清dvd不卡在线观看| 国产精品乱人伦一区二区| 国产米奇在线777精品观看| 日韩欧美一区在线观看| 奇米精品一区二区三区在线观看 | 不卡av在线免费观看| 国产天堂亚洲国产碰碰| 国产美女在线精品| 久久精品一区二区三区av|