`
YOUNG918
  • 浏览: 188810 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

How to read each JDBC type

    博客分类:
  • java
阅读更多
This section lists the ResultSet.getXXX methods recommended and allowed for retrieving data of each JDBC type.
TINYINT: getByte (recommended)
Can also be read using getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getString, getObject
SMALLINT: getShort (recommended)
Can also be read using getByte, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getString, getObject
INTEGER: getInt (recommended)
Can also be read using getByte, getShort, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getString, getObject
BIGINT: getLong (recommended)
Can also be read using getByte, getShort, getInt, getFloat, getDouble, getBigDecimal, getBoolean, getString, getObject
REAL: getFloat (recommended)
Can also be read using getByte, getShort, getInt, getLong, getDouble, getBigDecimal, getBoolean, getString, getObject
FLOAT: getDouble (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getBigDecimal, getBoolean, getString, getObject
DOUBLE: getDouble (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getBigDecimal, getBoolean, getString, getObject
DECIMAL: getBigDecimal (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBoolean, getString, getObject
NUMERIC: getBigDecimal (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBoolean, getString, getObject
BIT: getBoolean (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getString, getObject
CHAR: getString (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getDate, getTime, getTimestamp, getAsciiStream, getUnicodeStream, getObject
VARCHAR: getString (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getDate, getTime, getTimestamp, getAsciiStream, getUnicodeStream, getObject
LONGVARCHAR: getAsciiStream, getUnicodeStream (both recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getString, getDate, getTime, getTimestamp, getObject
BINARY: getBytes (recommended)
Can also be read using getString, getAsciiStream, getUnicodeStream, getBinaryStream, getObject
VARBINARY: getBytes (recommended)
Can also be read using getString, getAsciiStream, getUnicodeStream, getBinaryStream, getObject
LONGVARBINARY: getBinaryStream (recommended)
Can also be read using getString, getBytes, getAsciiStream, getUnicodeStream, getObject
DATE: getDate (recommended)
Can also be read using getString, getTimestamp, getObject
TIME: getTime (recommended)
Can also be read using getString, getTimestamp, getObject
TIMESTAMP: getTimestamp (recommended)
Can also be read using getString, getDate, getTime, getObject

Version 2: Which types each ResultSet.getXXX method can read

This section lists the JDBC types that each ResultSet.getXXX method supports.


getByte: TINYINT (recommended)
Can also read SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getShort: SMALLINT (recommended)
Can also read TINYINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getInt: INTEGER (recommended)
Can also read TINYINT, SMALLINT, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getLong: BIGINT (recommended)
Can also read TINYINT, SMALLINT, INTEGER, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getFloat: REAL (recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getDouble: FLOAT, DOUBLE (both recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getBigDecimal: DECIMAL, NUMERIC (both recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, BIT, CHAR, VARCHAR, LONGVARCHAR
getBoolean: BIT (recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, VARCHAR, LONGVARCHAR
getString: CHAR, VARCHAR (both recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, LONGVARCHAR, BINARY, VARBINARY, LONGVARBINARY, DATE, TIME, TIMESTAMP
getBytes: BINARY, VARBINARY (both recommended)
Can also read LONGVARBINARY
getDate: DATE (recommended)
Can also read CHAR, VARCHAR, LONGVARCHAR, TIMESTAMP
getTime: TIME (recommended)
Can also read CHAR, VARCHAR, LONGVARCHAR, TIMESTAMP
getTimestamp: TIMESTAMP (recommended)
Can also read CHAR, VARCHAR, LONGVARCHAR, DATE, TIME
getAsciiStream: LONGVARCHAR (recommended)
Can also read CHAR, VARCHAR, BINARY, VARBINARY, LONGVARBINARY
getUnicodeStream: LONGVARCHAR (recommended)
Can also read CHAR, VARCHAR, BINARY, VARBINARY, LONGVARBINARY
getBinaryStream: LONGVARBINARY (recommended)
Can also read BINARY, VARBINARY
getObject: (no recommended type)
Can read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR, BINARY, VARBINARY, LONGVARBINARY, DATE, TIME, TIMESTAMP

Mapping of JDBC Types to Java Types


JDBC TypeJava Type
CHAR String
VARCHAR String
LONGVARCHAR String
NUMERIC java.math.BigDecimal
DECIMAL java.math.BigDecimal
BIT boolean
BOOLEAN boolean
TINYINT byte
SMALLINT short
INTEGER int
BIGINT long
REAL float
FLOAT double
DOUBLE double
BINARY byte[]
VARBINARY byte[]
LONGVARBINARY byte[]
DATE java.sql.Date
TIME java.sql.Time
TIMESTAMP java.sql.Timestamp
CLOB Clob
BLOB Blob
ARRAY Array
DISTINCT mapping of underlying type
STRUCT Struct
REF Ref
DATALINK java.net.URL
JAVA_OBJECT underlying Java class


分享到:
评论

相关推荐

    How To Read A Book.pdf

    How to read a book efficiently. Part one The dimensions of reading Part two The third level of reading Part three Approaches to different kinds of reading Part four The ultimate goals of reading

    How to read an AWR report

    How to read an AWR report

    How to Read a Book epub

    How to Read a Book,学习如何快速读书 科学读书,第一版出版于1940年

    How TO Read Scientific Paper.pdf

    How to read scientific paper原文 大佬详细讲解了如何读论文,主要分为三遍,每次都要更加深入,最后一遍更是直接到了复现的程度,是工科生读论文的非常好的指南。

    how to read a book

    how to read a book ,it teach you reading skills

    How to read datasheet(含原版和翻译版)

    "How to read datasheet"这个主题旨在帮助读者掌握如何有效地阅读和理解数据手册,从而更好地应用这些信息于实际的设计和开发工作中。 数据手册通常由半导体制造商提供,涵盖的内容包括元器件的电气特性、机械尺寸...

    how to read a paper_Keshav_orginal.pdf

    Researchers spend a great deal of time reading research papers. However, this skill is rarely taught, leading to much wasted effort.... I also describe how to use this method to do a literature survey.

    译-How to read MTF curves 修改.pdf

    《如何阅读MTF曲线》,这是蔡司公司介绍 MTF曲线解读的资料,已翻译。读完本文,你将能够从制造商或测试机构发布的MTF数据中判断镜头的特性。另外,我们还将介绍MTF的局限性,以便你可以批判地认识镜头评论

    如何阅读论文 How to read a paper【滑铁卢大学S. Keshav】.zip

    读论文是从事科学研究与工程等必不可少环节,但是如何高效读论文却有一番讲究。... Keshav 撰写了《How to Read a Paper》有十多年之久,奉为经典,讲解了三轮阅读法,很实受用,可为给研究初学者的论文阅读简明教程。

    how-to-read-a-paper

    how-to-read-a-paper教你怎样有效地阅读一篇科技文献

    linux howto中文合集

    HOWTO-html<br>News-HOWTO-html<br>News-Leafsite-html<br>Oracle-HOWTO-html<br>Plug-and-Play-HOWTO-html<br>PPP-HOWTO-html<br>Printing-HOWTO-html<br>QT 3.3 中文白皮书.pdf Quota RCS-...

    最基础的听力训练和测试——哈曼How to listen

    《哈曼How to listen:开启你的听力训练之旅》 听力的敏锐度并非与生俱来,而是需要通过后天不断的训练和提升。对于音乐爱好者和音频工作者而言,对声音细节的感知力至关重要,它关乎于对音乐的理解,对音频作品的...

    How To Listen (Public) 2.0.4 Setup.zip

    "How To Listen"是一款专为提升用户听力敏感度和音质辨识能力设计的训练软件,尤其适用于音乐制作人、音频工程师以及任何对声音有高要求的人群。这个名为"How To Listen (Public) 2.0.4 Setup.zip"的压缩包包含了该...

    HowTo2152.zip_howto2152

    包含了将近100张图表,这些图表能用来根据载流能力和温度限制条件来精确估计导线的宽度,这个Excel工具允许设计者根据不同的叠层结构和设计条件填入不同的数值来计算导线宽度。很简单的在绿色单元格内输入项目的设计...

    How to Read Images with Pidinet - chinese

    How to Read Images with Pidinet - chinese

    how-to-read-and-understand-a-scientific-article.pdf

    本文的完整版本最初出现在作者的个人博客(www.violentmetaphors.com)上。 她非常感谢José Bonner教授(印第安纳大学)和Bill Saxton教授(加州大学圣克鲁兹分校)教她如何使用这种方法阅读科学论文。

    C++ How to Program, 10th Edition

    C++ How to Program (10th Edition) By 作者: Harvey M. Deitel Paul Deitel ISBN-10 书号: 9332585733 ISBN-13 书号: 9789332585737 Edition 版本: 10th 出版日期: 2017 Format: Paperback C++ How to Program ...

    Linux Howto 中文文档

    Linux HOWTO(中文版) BootPrompt-HOWTO (28KB) 启动提示说明 CDROM-HOWTO (27KB) 如何安装, 设定及使用光驱,同时列出支援的硬体. Chinese-HOWTO (39KB) 如何在 Linux 的系统上使用中文?/TD> Config-...

Global site tag (gtag.js) - Google Analytics