SOS !! 高分求解,大侠请进!! 关于:ResultSet 读取数据

liqweijack 2003-09-14 10:31:24
配置:Sql Server 2k 企业版
Tomcat 4.1.24

数据库中表的结构:
=======================================================================
专家类型ID -------------------------- 类型
{E2CEBF90-337B-4C6E-8428-188DBECBCD2F} QQ
{DA538024-ADED-446C-9499-26250E129B0D} 计算机
{16D9254B-96E6-4B8B-B330-FFB4DACDAC4D} 园林

字段名------ 数据类型
专家类型ID uniqueidentifier
类型 varchar

当使用 ResultSet 对象读取“专家类型ID”的值时总是出错:
使用的方法:
rs.getString("专家类型ID")
错误说明:
description:
The server encountered an internal error () that prevented it from fulfilling this request.

exception:
org.apache.jasper.JasperException: [Microsoft][ODBC SQL Server Driver]数值超出范围

但读取“类型”字段的值时不发生错误,

如何正确的读取“专家类型ID”字段("uniqueidentifier"类型)的值 ????

大家快帮帮我!!!!!
...全文
47 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
pzl686 2003-09-14
  • 打赏
  • 举报
回复
可能你的sql语句有问题
Keepers 2003-09-14
  • 打赏
  • 举报
回复
rs.getBinaryStream(); rs.getAsciiStream(); rs.getUnicodeStream();都试以下看行不行
waterinmoon 2003-09-14
  • 打赏
  • 举报
回复
up
cxyPioneer 2003-09-14
  • 打赏
  • 举报
回复
同意上面的观点
zhumao 2003-09-14
  • 打赏
  • 举报
回复
帮你up,因为我没有用过uniqueidentifier这个字段类型
一般情况下:rs.getString(1)
wlaptech 2003-09-14
  • 打赏
  • 举报
回复
getObject(1) 试试看。
flashroom 2003-09-14
  • 打赏
  • 举报
回复
SQL Server Data ===> Type JDBC Data Type
bigint ===> BIGINT
bigint ===> identity BIGINT
binary ===> BINARY
bit ===> BIT
char ===> CHAR
datetime ===> TIMESTAMP
decimal ===> DECIMAL
decimal() identity ===> DECIMAL
float ===> FLOAT
image ===> LONGVARBINARY
int ===> INTEGER
int identity ===> INTEGER
money ===> DECIMAL
nchar ===> CHAR
ntext ===> LONGVARCHAR
numeric ===> NUMERIC
numeric() identity ===> NUMERIC
nvarchar ===> VARCHAR
real ===> REAL
smalldatetime ===> TIMESTAMP
smallint ===> SMALLINT
smallint identity ===> SMALLINT
smallmoney ===> DECIMAL
sql_variant ===> VARCHAR
sysname ===> VARCHAR
text ===> LONGVARCHAR
timestamp ===> BINARY
tinyint ===> TINYINT
tinyint identity ===> TINYINT
uniqueidentifier ===> CHAR
varbinary ===> VARBINARY
varchar ===> VARCHAR


对应关系
AmoyCzc 2003-09-14
  • 打赏
  • 举报
回复
同意楼上说的!
liad 2003-09-14
  • 打赏
  • 举报
回复
rs.getString("专家类型ID")

String getString(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language
都可以

用Microsoft SQL Server 2000 Driver for JDBC,不要用ODBC-JDBC

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧