Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
fc552032
提交
fc552032
authored
1月 11, 2012
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SimpleResultSet: updating a result set is now supported.
上级
b00ebad0
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
930 行增加
和
891 行删除
+930
-891
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+881
-883
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+49
-8
没有找到文件。
h2/src/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
fc552032
...
...
@@ -348,230 +348,240 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
}
/**
* Returns the value as a byte.
* Searches for a specific column in the result set. A case-insensitive
* search is made.
*
* @param columnIndex (1,2,...)
* @return the value
* @param columnLabel the column label
* @return the column index (1,2,...)
* @throws SQLException if the column is not found or if the result set is
* closed
*/
public
byte
getByte
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
o
=
Byte
.
decode
(
o
.
toString
());
public
int
findColumn
(
String
columnLabel
)
throws
SQLException
{
if
(
columnLabel
!=
null
&&
columns
!=
null
)
{
for
(
int
i
=
0
,
size
=
columns
.
size
();
i
<
size
;
i
++)
{
if
(
columnLabel
.
equalsIgnoreCase
(
getColumn
(
i
).
name
))
{
return
i
+
1
;
}
}
return
o
==
null
?
0
:
((
Number
)
o
).
byteValue
();
}
throw
DbException
.
get
(
ErrorCode
.
COLUMN_NOT_FOUND_1
,
columnLabel
).
getSQLException
();
}
/**
* Returns
the value as an double
.
* Returns
a reference to itself
.
*
* @param columnIndex (1,2,...)
* @return the value
* @return this
*/
public
double
getDouble
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
return
Double
.
parseDouble
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
doubleValue
();
public
ResultSetMetaData
getMetaData
()
{
return
this
;
}
/**
* Returns
the value as a float
.
* Returns
null
.
*
* @param columnIndex (1,2,...)
* @return the value
* @return null
*/
public
float
getFloat
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
return
Float
.
parseFloat
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
floatValue
();
public
SQLWarning
getWarnings
()
{
return
null
;
}
/**
* Returns
the value as an int
.
* Returns
null
.
*
* @param columnIndex (1,2,...)
* @return the value
* @return null
*/
public
int
getInt
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
o
=
Integer
.
decode
(
o
.
toString
());
public
Statement
getStatement
()
{
return
null
;
}
return
o
==
null
?
0
:
((
Number
)
o
).
intValue
();
/**
* INTERNAL
*/
public
void
clearWarnings
()
{
// nothing to do
}
// ---- get ---------------------------------------------
/**
* Returns the value as a
long
.
* Returns the value as a
java.sql.Array
.
*
* @param columnIndex (1,2,...)
* @return the value
*/
public
long
getLong
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
o
=
Long
.
decode
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
longValue
();
public
Array
getArray
(
int
columnIndex
)
throws
SQLException
{
Object
[]
o
=
(
Object
[])
get
(
columnIndex
);
return
o
==
null
?
null
:
new
SimpleArray
(
o
);
}
/**
* Returns the value as a
short
.
* Returns the value as a
java.sql.Array
.
*
* @param column
Index (1,2,...)
* @param column
Label the column label
* @return the value
*/
public
short
getShort
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
o
=
Short
.
decode
(
o
.
toString
());
public
Array
getArray
(
String
columnLabel
)
throws
SQLException
{
return
getArray
(
findColumn
(
columnLabel
));
}
return
o
==
null
?
0
:
((
Number
)
o
).
shortValue
();
/**
* INTERNAL
*/
public
InputStream
getAsciiStream
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* Returns the value as a boolean.
* INTERNAL
*/
public
InputStream
getAsciiStream
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* Returns the value as a java.math.BigDecimal.
*
* @param columnIndex (1,2,...)
* @return the value
*/
public
boolean
getBoolean
(
int
columnIndex
)
throws
SQLException
{
public
BigDecimal
getBigDecimal
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
B
oolean
))
{
o
=
Boolean
.
valueOf
(
o
.
toString
());
if
(
o
!=
null
&&
!(
o
instanceof
B
igDecimal
))
{
o
=
new
BigDecimal
(
o
.
toString
());
}
return
o
==
null
?
false
:
((
Boolean
)
o
).
booleanValue
()
;
return
(
BigDecimal
)
o
;
}
/**
* Returns the value as a
byte array
.
* Returns the value as a
java.math.BigDecimal
.
*
* @param column
Index (1,2,...)
* @param column
Label the column label
* @return the value
*/
public
byte
[]
getBytes
(
int
columnIndex
)
throws
SQLException
{
return
(
byte
[])
get
(
columnIndex
);
public
BigDecimal
getBigDecimal
(
String
columnLabel
)
throws
SQLException
{
return
getBigDecimal
(
findColumn
(
columnLabel
)
);
}
/**
* Returns the value as an Object.
*
* @param columnIndex (1,2,...)
* @return the value
* @deprecated INTERNAL
*/
public
Object
getObject
(
int
columnIndex
)
throws
SQLException
{
return
get
(
columnIndex
);
public
BigDecimal
getBigDecimal
(
int
columnIndex
,
int
scale
)
throws
SQLException
{
throw
getUnsupportedException
(
);
}
/**
* Returns the value as a String.
* @deprecated INTERNAL
*/
public
BigDecimal
getBigDecimal
(
String
columnLabel
,
int
scale
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* Returns the value as a java.io.InputStream.
* This is only supported if the
* result set was created using a Blob object.
*
* @param columnIndex (1,2,...)
* @return the value
*/
public
String
getString
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
==
null
)
{
return
null
;
}
switch
(
columns
.
get
(
columnIndex
-
1
).
sqlType
)
{
case
Types
.
CLOB
:
Clob
c
=
(
Clob
)
o
;
return
c
.
getSubString
(
1
,
MathUtils
.
convertLongToInt
(
c
.
length
()));
}
return
o
.
toString
();
public
InputStream
getBinaryStream
(
int
columnIndex
)
throws
SQLException
{
Blob
b
=
(
Blob
)
get
(
columnIndex
);
return
b
==
null
?
null
:
b
.
getBinaryStream
();
}
/**
* Returns the value as a byte.
* Returns the value as a java.io.InputStream.
* This is only supported if the
* result set was created using a Blob object.
*
* @param columnLabel the column label
* @return the value
*/
public
byte
getByte
(
String
columnLabel
)
throws
SQLException
{
return
getB
yte
(
findColumn
(
columnLabel
));
public
InputStream
getBinaryStream
(
String
columnLabel
)
throws
SQLException
{
return
getB
inaryStream
(
findColumn
(
columnLabel
));
}
/**
* Returns the value as a double.
* Returns the value as a java.sql.Blob.
* This is only supported if the
* result set was created using a Blob object.
*
* @param column
Label the column label
* @param column
Index (1,2,...)
* @return the value
*/
public
double
getDouble
(
String
columnLabel
)
throws
SQLException
{
return
getDouble
(
findColumn
(
columnLabel
));
public
Blob
getBlob
(
int
columnIndex
)
throws
SQLException
{
Blob
b
=
(
Blob
)
get
(
columnIndex
);
return
b
==
null
?
null
:
b
;
}
/**
* Returns the value as a float.
* Returns the value as a java.sql.Blob.
* This is only supported if the
* result set was created using a Blob object.
*
* @param columnLabel the column label
* @return the value
*/
public
float
getFloat
(
String
columnLabel
)
throws
SQLException
{
return
get
Float
(
findColumn
(
columnLabel
));
public
Blob
getBlob
(
String
columnLabel
)
throws
SQLException
{
return
get
Blob
(
findColumn
(
columnLabel
));
}
/**
* Searches for a specific column in the result set. A case-insensitive
* search is made.
* Returns the value as a boolean.
*
* @param columnLabel the column label
* @return the column index (1,2,...)
* @throws SQLException if the column is not found or if the result set is
* closed
* @param columnIndex (1,2,...)
* @return the value
*/
public
int
findColumn
(
String
columnLabel
)
throws
SQLException
{
if
(
columnLabel
!=
null
&&
columns
!=
null
)
{
for
(
int
i
=
0
,
size
=
columns
.
size
();
i
<
size
;
i
++)
{
if
(
columnLabel
.
equalsIgnoreCase
(
getColumn
(
i
).
name
))
{
return
i
+
1
;
}
}
public
boolean
getBoolean
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Boolean
))
{
o
=
Boolean
.
valueOf
(
o
.
toString
());
}
throw
DbException
.
get
(
ErrorCode
.
COLUMN_NOT_FOUND_1
,
columnLabel
).
getSQLException
();
return
o
==
null
?
false
:
((
Boolean
)
o
).
booleanValue
();
}
/**
* Returns the value as a
n int
.
* Returns the value as a
boolean
.
*
* @param columnLabel the column label
* @return the value
*/
public
int
getInt
(
String
columnLabel
)
throws
SQLException
{
return
get
Int
(
findColumn
(
columnLabel
));
public
boolean
getBoolean
(
String
columnLabel
)
throws
SQLException
{
return
get
Boolean
(
findColumn
(
columnLabel
));
}
/**
* Returns the value as a
long
.
* Returns the value as a
byte
.
*
* @param column
Label the column label
* @param column
Index (1,2,...)
* @return the value
*/
public
long
getLong
(
String
columnLabel
)
throws
SQLException
{
return
getLong
(
findColumn
(
columnLabel
));
public
byte
getByte
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
o
=
Byte
.
decode
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
byteValue
();
}
/**
* Returns the value as a
short
.
* Returns the value as a
byte
.
*
* @param columnLabel the column label
* @return the value
*/
public
short
getShort
(
String
columnLabel
)
throws
SQLException
{
return
get
Short
(
findColumn
(
columnLabel
));
public
byte
getByte
(
String
columnLabel
)
throws
SQLException
{
return
get
Byte
(
findColumn
(
columnLabel
));
}
/**
* Returns the value as a b
oolean
.
* Returns the value as a b
yte array
.
*
* @param column
Label the column label
* @param column
Index (1,2,...)
* @return the value
*/
public
b
oolean
getBoolean
(
String
columnLabel
)
throws
SQLException
{
return
getBoolean
(
findColumn
(
columnLabel
)
);
public
b
yte
[]
getBytes
(
int
columnIndex
)
throws
SQLException
{
return
(
byte
[])
get
(
columnIndex
);
}
/**
...
...
@@ -585,494 +595,616 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
}
/**
* Returns the value as a java.math.BigDecimal.
* Returns the value as a java.io.Reader.
* This is only supported for CLOB data.
*
* @param columnIndex (1,2,...)
* @return the value
*/
public
BigDecimal
getBigDecimal
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
BigDecimal
))
{
o
=
new
BigDecimal
(
o
.
toString
());
}
return
(
BigDecimal
)
o
;
public
Reader
getCharacterStream
(
int
columnIndex
)
throws
SQLException
{
Clob
c
=
(
Clob
)
get
(
columnIndex
);
return
c
==
null
?
null
:
c
.
getCharacterStream
();
}
/**
* Returns the value as an java.sql.Date.
* Returns the value as a java.io.Reader.
* This is only supported if the
* result set was created using a Clob object.
*
* @param column
Index (1,2,...)
* @param column
Label the column label
* @return the value
*/
public
Date
getDate
(
int
columnIndex
)
throws
SQLException
{
return
(
Date
)
get
(
columnIndex
);
public
Reader
getCharacterStream
(
String
columnLabel
)
throws
SQLException
{
return
getCharacterStream
(
findColumn
(
columnLabel
)
);
}
/**
* Returns a reference to itself.
*
* @return this
*/
public
ResultSetMetaData
getMetaData
()
{
return
this
;
}
/**
* Returns null.
* Returns the value as a java.sql.Clob.
* This is only supported if the
* result set was created using a Clob object.
*
* @return null
* @param columnIndex (1,2,...)
* @return the value
*/
public
SQLWarning
getWarnings
()
{
return
null
;
public
Clob
getClob
(
int
columnIndex
)
throws
SQLException
{
Clob
c
=
(
Clob
)
get
(
columnIndex
);
return
c
==
null
?
null
:
c
;
}
/**
* Returns null.
* Returns the value as a java.sql.Clob.
* This is only supported if the
* result set was created using a Clob object.
*
* @return null
* @param columnLabel the column label
* @return the value
*/
public
Statement
getStatement
()
{
return
null
;
public
Clob
getClob
(
String
columnLabel
)
throws
SQLException
{
return
getClob
(
findColumn
(
columnLabel
))
;
}
/**
* Returns the value as an java.sql.
Tim
e.
* Returns the value as an java.sql.
Dat
e.
*
* @param columnIndex (1,2,...)
* @return the value
*/
public
Time
getTim
e
(
int
columnIndex
)
throws
SQLException
{
return
(
Tim
e
)
get
(
columnIndex
);
public
Date
getDat
e
(
int
columnIndex
)
throws
SQLException
{
return
(
Dat
e
)
get
(
columnIndex
);
}
/**
* Returns the value as a
n java.sql.Timestamp
.
* Returns the value as a
java.sql.Date
.
*
* @param column
Index (1,2,...)
* @param column
Label the column label
* @return the value
*/
public
Timestamp
getTimestamp
(
int
columnIndex
)
throws
SQLException
{
return
(
Timestamp
)
get
(
columnIndex
);
public
Date
getDate
(
String
columnLabel
)
throws
SQLException
{
return
getDate
(
findColumn
(
columnLabel
)
);
}
/**
* Returns the value as a java.sql.Array.
*
* @param columnIndex (1,2,...)
* @return the value
* INTERNAL
*/
public
Array
getArray
(
int
columnIndex
)
throws
SQLException
{
Object
[]
o
=
(
Object
[])
get
(
columnIndex
);
return
o
==
null
?
null
:
new
SimpleArray
(
o
);
public
Date
getDate
(
int
columnIndex
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* Returns the value as a java.io.Reader.
* This is only supported for CLOB data.
*
* @param columnIndex (1,2,...)
* @return the value
* INTERNAL
*/
public
Reader
getCharacterStream
(
int
columnIndex
)
throws
SQLException
{
Clob
c
=
(
Clob
)
get
(
columnIndex
);
return
c
==
null
?
null
:
c
.
getCharacterStream
();
public
Date
getDate
(
String
columnLabel
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* Returns the value as a java.sql.Clob.
* This is only supported if the
* result set was created using a Clob object.
* Returns the value as an double.
*
* @param columnIndex (1,2,...)
* @return the value
*/
public
Clob
getClob
(
int
columnIndex
)
throws
SQLException
{
Clob
c
=
(
Clob
)
get
(
columnIndex
);
return
c
==
null
?
null
:
c
;
public
double
getDouble
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
return
Double
.
parseDouble
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
doubleValue
();
}
/**
* Returns the value as a java.sql.Blob.
* This is only supported if the
* result set was created using a Blob object.
* Returns the value as a double.
*
* @param column
Index (1,2,...)
* @param column
Label the column label
* @return the value
*/
public
Blob
getBlob
(
int
columnIndex
)
throws
SQLException
{
Blob
b
=
(
Blob
)
get
(
columnIndex
);
return
b
==
null
?
null
:
b
;
public
double
getDouble
(
String
columnLabel
)
throws
SQLException
{
return
getDouble
(
findColumn
(
columnLabel
));
}
/**
* Returns the value as a java.io.InputStream.
* This is only supported if the
* result set was created using a Blob object.
* Returns the value as a float.
*
* @param columnIndex (1,2,...)
* @return the value
*/
public
InputStream
getBinaryStream
(
int
columnIndex
)
throws
SQLException
{
Blob
b
=
(
Blob
)
get
(
columnIndex
);
return
b
==
null
?
null
:
b
.
getBinaryStream
();
public
float
getFloat
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
return
Float
.
parseFloat
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
floatValue
();
}
/**
* Returns the value as a
n Objec
t.
* Returns the value as a
floa
t.
*
* @param columnLabel the column label
* @return the value
*/
public
Object
getObjec
t
(
String
columnLabel
)
throws
SQLException
{
return
get
Objec
t
(
findColumn
(
columnLabel
));
public
float
getFloa
t
(
String
columnLabel
)
throws
SQLException
{
return
get
Floa
t
(
findColumn
(
columnLabel
));
}
/**
* Returns the value as a
String
.
* Returns the value as a
n int
.
*
* @param column
Label the column label
* @param column
Index (1,2,...)
* @return the value
*/
public
String
getString
(
String
columnLabel
)
throws
SQLException
{
return
getString
(
findColumn
(
columnLabel
));
public
int
getInt
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
o
=
Integer
.
decode
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
intValue
();
}
/**
* Returns the value as a
java.math.BigDecimal
.
* Returns the value as a
n int
.
*
* @param columnLabel the column label
* @return the value
*/
public
BigDecimal
getBigDecimal
(
String
columnLabel
)
throws
SQLException
{
return
get
BigDecimal
(
findColumn
(
columnLabel
));
public
int
getInt
(
String
columnLabel
)
throws
SQLException
{
return
get
Int
(
findColumn
(
columnLabel
));
}
/**
* Returns the value as a
java.sql.Date
.
* Returns the value as a
long
.
*
* @param column
Label the column label
* @param column
Index (1,2,...)
* @return the value
*/
public
Date
getDate
(
String
columnLabel
)
throws
SQLException
{
return
getDate
(
findColumn
(
columnLabel
));
public
long
getLong
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
o
=
Long
.
decode
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
longValue
();
}
/**
* Returns the value as a
java.sql.Time
.
* Returns the value as a
long
.
*
* @param columnLabel the column label
* @return the value
*/
public
Time
getTime
(
String
columnLabel
)
throws
SQLException
{
return
get
Time
(
findColumn
(
columnLabel
));
public
long
getLong
(
String
columnLabel
)
throws
SQLException
{
return
get
Long
(
findColumn
(
columnLabel
));
}
/**
* Returns the value as a java.sql.Timestamp.
*
* @param columnLabel the column label
* @return the value
* INTERNAL
*/
public
Timestamp
getTimestamp
(
String
columnLabel
)
throws
SQLException
{
return
getTimestamp
(
findColumn
(
columnLabel
));
//## Java 1.6 ##
public
Reader
getNCharacterStream
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* Returns the value as a java.io.Reader.
* This is only supported if the
* result set was created using a Clob object.
*
* @param columnLabel the column label
* @return the value
* INTERNAL
*/
public
Reader
getCharacterStream
(
String
columnLabel
)
throws
SQLException
{
return
getCharacterStream
(
findColumn
(
columnLabel
));
//## Java 1.6 ##
public
Reader
getNCharacterStream
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* Returns the value as a java.sql.Clob.
* This is only supported if the
* result set was created using a Clob object.
*
* @param columnLabel the column label
* @return the value
* INTERNAL
*/
public
Clob
getClob
(
String
columnLabel
)
throws
SQLException
{
return
getClob
(
findColumn
(
columnLabel
));
//## Java 1.6 ##
public
NClob
getNClob
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* Returns the value as a java.sql.Blob.
* This is only supported if the
* result set was created using a Blob object.
*
* @param columnLabel the column label
* @return the value
* INTERNAL
*/
public
Blob
getBlob
(
String
columnLabel
)
throws
SQLException
{
return
getBlob
(
findColumn
(
columnLabel
));
//## Java 1.6 ##
public
NClob
getNClob
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* Returns the value as a java.io.InputStream.
* This is only supported if the
* result set was created using a Blob object.
*
* @param columnLabel the column label
* @return the value
* INTERNAL
*/
public
InputStream
getBinaryStream
(
String
columnLabel
)
throws
SQLException
{
return
getBinaryStream
(
findColumn
(
columnLabel
));
//## Java 1.6 ##
public
String
getNString
(
int
columnIndex
)
throws
SQLException
{
return
getString
(
columnIndex
);
}
// ---- result set meta data ---------------------------------------------
//*/
/**
* Returns the column count.
*
* @return the column count
* INTERNAL
*/
public
int
getColumnCount
()
{
return
columns
.
size
();
//## Java 1.6 ##
public
String
getNString
(
String
columnLabel
)
throws
SQLException
{
return
getString
(
columnLabel
);
}
//*/
/**
* Returns
15
.
* Returns
the value as an Object
.
*
* @param columnIndex (1,2,...)
* @return
15
* @return
the value
*/
public
int
getColumnDisplaySize
(
int
columnIndex
)
{
return
15
;
public
Object
getObject
(
int
columnIndex
)
throws
SQLException
{
return
get
(
columnIndex
)
;
}
/**
* Returns the
SQL type
.
* Returns the
value as an Object
.
*
* @param column
Index (1,2,...)
* @return the
SQL typ
e
* @param column
Label the column label
* @return the
valu
e
*/
public
int
getColumnType
(
int
columnIndex
)
throws
SQLException
{
return
get
Column
(
columnIndex
-
1
).
sqlType
;
public
Object
getObject
(
String
columnLabel
)
throws
SQLException
{
return
get
Object
(
findColumn
(
columnLabel
))
;
}
/**
*
Returns the precision.
*
INTERNAL
*
* @param columnIndex
(1,2,
...)
* @
return the precision
* @param columnIndex
the column index (1, 2,
...)
* @
param type the class of the returned value
*/
public
int
getPrecision
(
int
columnIndex
)
throws
SQLException
{
return
getColumn
(
columnIndex
-
1
).
precision
;
/*## Java 1.7 ##
public <T> T getObject(int columnIndex, Class<T> type) {
return null;
}
//*/
/**
*
Returns the scale.
*
INTERNAL
*
* @param column
Index (1,2,...)
* @
return the scal
e
* @param column
Name the column name
* @
param type the class of the returned valu
e
*/
public
int
getScale
(
int
columnIndex
)
throws
SQLException
{
return
getColumn
(
columnIndex
-
1
).
scale
;
/*## Java 1.7 ##
public <T> T getObject(String columnName, Class<T> type) {
return null;
}
//*/
/**
* Returns ResultSetMetaData.columnNullableUnknown.
*
* @param columnIndex (1,2,...)
* @return columnNullableUnknown
* INTERNAL
*/
public
int
isNullable
(
int
columnIndex
)
{
return
ResultSetMetaData
.
columnNullableUnknown
;
public
Object
getObject
(
int
columnIndex
,
Map
<
String
,
Class
<?>>
map
)
throws
SQLException
{
throw
getUnsupportedException
()
;
}
/**
* Returns false.
*
* @param columnIndex (1,2,...)
* @return false
* INTERNAL
*/
public
boolean
isAutoIncrement
(
int
columnIndex
)
{
return
false
;
public
Object
getObject
(
String
columnLabel
,
Map
<
String
,
Class
<?>>
map
)
throws
SQLException
{
throw
getUnsupportedException
()
;
}
/**
* Returns true.
*
* @param columnIndex (1,2,...)
* @return true
* INTERNAL
*/
public
boolean
isCaseSensitive
(
int
columnIndex
)
{
return
true
;
public
Ref
getRef
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
()
;
}
/**
* Returns false.
*
* @param columnIndex (1,2,...)
* @return false
* INTERNAL
*/
public
boolean
isCurrency
(
int
columnIndex
)
{
return
false
;
public
Ref
getRef
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
()
;
}
/**
* Returns false.
*
* @param columnIndex (1,2,...)
* @return false
* INTERNAL
*/
public
boolean
isDefinitelyWritable
(
int
columnIndex
)
{
return
false
;
//## Java 1.6 ##
public
RowId
getRowId
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* Returns true.
* INTERNAL
*/
//## Java 1.6 ##
public
RowId
getRowId
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* Returns the value as a short.
*
* @param columnIndex (1,2,...)
* @return t
r
ue
* @return t
he val
ue
*/
public
boolean
isReadOnly
(
int
columnIndex
)
{
return
true
;
public
short
getShort
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
!=
null
&&
!(
o
instanceof
Number
))
{
o
=
Short
.
decode
(
o
.
toString
());
}
return
o
==
null
?
0
:
((
Number
)
o
).
shortValue
();
}
/**
* Returns t
rue
.
* Returns t
he value as a short
.
*
* @param column
Index (1,2,...)
* @return t
r
ue
* @param column
Label the column label
* @return t
he val
ue
*/
public
boolean
isSearchable
(
int
columnIndex
)
{
return
true
;
public
short
getShort
(
String
columnLabel
)
throws
SQLException
{
return
getShort
(
findColumn
(
columnLabel
))
;
}
/**
* Returns true.
* INTERNAL
*/
//## Java 1.6 ##
public
SQLXML
getSQLXML
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
SQLXML
getSQLXML
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* Returns the value as a String.
*
* @param columnIndex (1,2,...)
* @return t
r
ue
* @return t
he val
ue
*/
public
boolean
isSigned
(
int
columnIndex
)
{
return
true
;
public
String
getString
(
int
columnIndex
)
throws
SQLException
{
Object
o
=
get
(
columnIndex
);
if
(
o
==
null
)
{
return
null
;
}
switch
(
columns
.
get
(
columnIndex
-
1
).
sqlType
)
{
case
Types
.
CLOB
:
Clob
c
=
(
Clob
)
o
;
return
c
.
getSubString
(
1
,
MathUtils
.
convertLongToInt
(
c
.
length
()));
}
return
o
.
toString
();
}
/**
* Returns
false
.
* Returns
the value as a String
.
*
* @param column
Index (1,2,...)
* @return
fals
e
* @param column
Label the column label
* @return
the valu
e
*/
public
boolean
isWritable
(
int
columnIndex
)
{
return
false
;
public
String
getString
(
String
columnLabel
)
throws
SQLException
{
return
getString
(
findColumn
(
columnLabel
))
;
}
/**
* Returns
null
.
* Returns
the value as an java.sql.Time
.
*
* @param columnIndex (1,2,...)
* @return
null
* @return
the value
*/
public
String
getCatalogName
(
int
columnIndex
)
{
return
null
;
public
Time
getTime
(
int
columnIndex
)
throws
SQLException
{
return
(
Time
)
get
(
columnIndex
)
;
}
/**
* Returns the
Java class name if this column
.
* Returns the
value as a java.sql.Time
.
*
* @param column
Index (1,2,...)
* @return the
class nam
e
* @param column
Label the column label
* @return the
valu
e
*/
public
String
getColumnClassName
(
int
columnIndex
)
throws
SQLException
{
int
sqlType
=
getColumn
(
columnIndex
-
1
).
sqlType
;
int
type
=
DataType
.
convertSQLTypeToValueType
(
sqlType
);
return
DataType
.
getTypeClassName
(
type
);
public
Time
getTime
(
String
columnLabel
)
throws
SQLException
{
return
getTime
(
findColumn
(
columnLabel
));
}
/**
* Returns the column label.
* INTERNAL
*/
public
Time
getTime
(
int
columnIndex
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Time
getTime
(
String
columnLabel
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* Returns the value as an java.sql.Timestamp.
*
* @param columnIndex (1,2,...)
* @return the
column label
* @return the
value
*/
public
String
getColumnLabel
(
int
columnIndex
)
throws
SQLException
{
return
getColumn
(
columnIndex
-
1
).
name
;
public
Timestamp
getTimestamp
(
int
columnIndex
)
throws
SQLException
{
return
(
Timestamp
)
get
(
columnIndex
)
;
}
/**
* Returns the
column name
.
* Returns the
value as a java.sql.Timestamp
.
*
* @param column
Index (1,2,...)
* @return the
column nam
e
* @param column
Label the column label
* @return the
valu
e
*/
public
String
getColumnName
(
int
columnIndex
)
throws
SQLException
{
return
getColumnLabel
(
columnIndex
);
public
Timestamp
getTimestamp
(
String
columnLabel
)
throws
SQLException
{
return
getTimestamp
(
findColumn
(
columnLabel
));
}
/**
* INTERNAL
*/
public
Timestamp
getTimestamp
(
int
columnIndex
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Timestamp
getTimestamp
(
String
columnLabel
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* @deprecated INTERNAL
*/
public
InputStream
getUnicodeStream
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* @deprecated INTERNAL
*/
public
InputStream
getUnicodeStream
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
URL
getURL
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
URL
getURL
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
// ---- update ---------------------------------------------
/**
* INTERNAL
*/
public
void
updateArray
(
int
columnIndex
,
Array
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
updateArray
(
String
columnLabel
,
Array
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateAsciiStream
(
int
columnIndex
,
InputStream
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateAsciiStream
(
String
columnLabel
,
InputStream
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateAsciiStream
(
int
columnIndex
,
InputStream
x
,
int
length
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
updateAsciiStream
(
String
columnLabel
,
InputStream
x
,
int
length
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateAsciiStream
(
int
columnIndex
,
InputStream
x
,
long
length
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateAsciiStream
(
String
columnLabel
,
InputStream
x
,
long
length
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* Returns the data type name of a column.
*
* @param columnIndex (1,2,...)
* @return the type name
* INTERNAL
*/
public
String
getColumnTypeName
(
int
columnIndex
)
throws
SQLException
{
int
sqlType
=
getColumn
(
columnIndex
-
1
).
sqlType
;
int
type
=
DataType
.
convertSQLTypeToValueType
(
sqlType
);
return
DataType
.
getDataType
(
type
).
name
;
public
void
updateBigDecimal
(
int
columnIndex
,
BigDecimal
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* Returns null.
*
* @param columnIndex (1,2,...)
* @return null
* INTERNAL
*/
public
String
getSchemaName
(
int
columnIndex
)
{
return
null
;
public
void
updateBigDecimal
(
String
columnLabel
,
BigDecimal
x
)
throws
SQLException
{
update
(
columnLabel
,
x
)
;
}
/**
* Returns null.
*
* @param columnIndex (1,2,...)
* @return null
* INTERNAL
*/
public
String
getTableName
(
int
columnIndex
)
{
return
null
;
//## Java 1.6 ##
public
void
updateBinaryStream
(
int
columnIndex
,
InputStream
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
clearWarnings
()
{
// nothing to do
//## Java 1.6 ##
public
void
updateBinaryStream
(
String
columnLabel
,
InputStream
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
// ---- unsupported / result set ---------------------------------------------
//*/
/**
* INTERNAL
*/
public
void
update
Array
(
int
columnIndex
,
Array
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
BinaryStream
(
int
columnIndex
,
InputStream
x
,
int
length
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* Returns the value as a java.sql.Array.
*
* @param columnLabel the column label
* @return the value
* INTERNAL
*/
public
Array
getArray
(
String
columnLabel
)
throws
SQLException
{
return
getArray
(
findColumn
(
columnLabel
)
);
public
void
updateBinaryStream
(
String
columnLabel
,
InputStream
x
,
int
length
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
update
AsciiStream
(
int
columnIndex
,
InputStream
x
)
public
void
update
BinaryStream
(
int
columnIndex
,
InputStream
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
update
(
columnIndex
,
x
);
}
//*/
...
...
@@ -1080,33 +1212,51 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
* INTERNAL
*/
//## Java 1.6 ##
public
void
update
AsciiStream
(
String
columnLabel
,
InputStream
x
)
public
void
update
BinaryStream
(
String
columnLabel
,
InputStream
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
update
AsciiStream
(
int
columnIndex
,
InputStream
x
,
int
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Blob
(
int
columnIndex
,
Blob
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
AsciiStream
(
String
columnLabel
,
InputStream
x
,
int
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Blob
(
String
columnLabel
,
Blob
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateAsciiStream
(
int
columnIndex
,
InputStream
x
,
long
length
)
public
void
updateBlob
(
int
columnIndex
,
InputStream
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBlob
(
String
columnLabel
,
InputStream
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBlob
(
int
columnIndex
,
InputStream
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
update
(
columnIndex
,
x
);
}
//*/
...
...
@@ -1114,67 +1264,60 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
* INTERNAL
*/
//## Java 1.6 ##
public
void
update
AsciiStream
(
String
columnLabel
,
InputStream
x
,
long
length
)
public
void
update
Blob
(
String
columnLabel
,
InputStream
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateB
igDecimal
(
int
columnIndex
,
BigDecimal
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
updateB
oolean
(
int
columnIndex
,
boolean
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
updateB
igDecimal
(
String
columnLabel
,
BigDecimal
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
updateB
oolean
(
String
columnLabel
,
boolean
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBinaryStream
(
int
columnLabel
,
InputStream
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateByte
(
int
columnIndex
,
byte
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBinaryStream
(
String
columnLabel
,
InputStream
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateByte
(
String
columnLabel
,
byte
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateB
inaryStream
(
int
columnIndex
,
InputStream
x
,
int
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
updateB
ytes
(
int
columnIndex
,
byte
[]
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
updateB
inaryStream
(
String
columnLabel
,
InputStream
x
,
int
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
updateB
ytes
(
String
columnLabel
,
byte
[]
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBinaryStream
(
int
columnIndex
,
InputStream
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateCharacterStream
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
...
...
@@ -1182,290 +1325,333 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBinaryStream
(
String
columnLabel
,
InputStream
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateCharacterStream
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
update
Blob
(
int
columnIndex
,
Blob
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
CharacterStream
(
int
columnIndex
,
Reader
x
,
int
length
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Blob
(
String
columnLabel
,
Blob
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
CharacterStream
(
String
columnLabel
,
Reader
x
,
int
length
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
updateBoolean
(
int
columnIndex
,
boolean
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateCharacterStream
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateBoolean
(
String
columnLabel
,
boolean
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateCharacterStream
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
update
Null
(
int
columnInde
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Clob
(
int
columnIndex
,
Clob
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Null
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Clob
(
String
columnLabel
,
Clob
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
updateByte
(
int
columnIndex
,
byte
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateClob
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateByte
(
String
columnLabel
,
byte
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateClob
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateShort
(
int
columnIndex
,
short
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateClob
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateShort
(
String
columnLabel
,
short
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateClob
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
update
Int
(
int
columnIndex
,
int
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Date
(
int
columnIndex
,
Date
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Int
(
String
columnLabel
,
int
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Date
(
String
columnLabel
,
Date
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Long
(
int
columnIndex
,
long
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Double
(
int
columnIndex
,
double
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Long
(
String
columnLabel
,
long
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Double
(
String
columnLabel
,
double
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
updateFloat
(
int
columnIndex
,
float
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
updateFloat
(
String
columnLabel
,
float
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Double
(
int
columnIndex
,
double
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Int
(
int
columnIndex
,
int
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Double
(
String
columnLabel
,
double
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Int
(
String
columnLabel
,
int
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
update
String
(
int
columnIndex
,
Stri
ng
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Long
(
int
columnIndex
,
lo
ng
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
String
(
String
columnLabel
,
Stri
ng
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Long
(
String
columnLabel
,
lo
ng
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
updateDate
(
int
columnIndex
,
Date
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNCharacterStream
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateDate
(
String
columnLabel
,
Date
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNCharacterStream
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateTime
(
int
columnIndex
,
Time
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNCharacterStream
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateTime
(
String
columnLabel
,
Time
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNCharacterStream
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateTimestamp
(
int
columnIndex
,
Timestamp
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNClob
(
int
columnIndex
,
NClob
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateTimestamp
(
String
columnLabel
,
Timestamp
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNClob
(
String
columnLabel
,
NClob
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateObject
(
int
columnIndex
,
Object
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNClob
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateObject
(
String
columnLabel
,
Object
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNClob
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateObject
(
int
columnIndex
,
Object
x
,
int
scale
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNClob
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateObject
(
String
columnLabel
,
Object
x
,
int
scale
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNClob
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateBytes
(
int
columnIndex
,
byte
[]
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNString
(
int
columnIndex
,
String
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
updateBytes
(
String
columnLabel
,
byte
[]
x
)
throws
SQLException
{
throw
getUnsupportedException
();
//## Java 1.6 ##
public
void
updateNString
(
String
columnLabel
,
String
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
public
void
update
CharacterStream
(
int
columnIndex
,
Reader
x
,
int
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Null
(
int
columnIndex
)
throws
SQLException
{
update
(
columnIndex
,
null
);
}
/**
* INTERNAL
*/
public
URL
getURL
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
updateNull
(
String
columnLabel
)
throws
SQLException
{
update
(
columnLabel
,
null
);
}
/**
* INTERNAL
*/
public
void
update
Clob
(
int
columnIndex
,
Clob
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Object
(
int
columnIndex
,
Object
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Ref
(
int
columnIndex
,
Ref
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Object
(
String
columnLabel
,
Object
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Ref
(
String
columnLabel
,
Ref
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Object
(
int
columnIndex
,
Object
x
,
int
scale
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
CharacterStream
(
String
columnLabel
,
Reader
reader
,
int
length
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Object
(
String
columnLabel
,
Object
x
,
int
scale
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Array
(
String
columnLabel
,
Array
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Ref
(
int
columnIndex
,
Ref
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
/**
* INTERNAL
*/
public
void
update
Clob
(
String
columnLabel
,
Clob
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
public
void
update
Ref
(
String
columnLabel
,
Ref
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
/**
...
...
@@ -1473,7 +1659,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
*/
//## Java 1.6 ##
public
void
updateRowId
(
int
columnIndex
,
RowId
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
update
(
columnIndex
,
x
);
}
//*/
...
...
@@ -1482,37 +1668,30 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
*/
//## Java 1.6 ##
public
void
updateRowId
(
String
columnLabel
,
RowId
x
)
throws
SQLException
{
throw
getUnsupportedException
(
);
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateNString
(
int
columnIndex
,
String
nString
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateShort
(
int
columnIndex
,
short
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateNString
(
String
columnLabel
,
String
nString
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateShort
(
String
columnLabel
,
short
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateNClob
(
int
columnIndex
,
NClob
nClob
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateSQLXML
(
int
columnIndex
,
SQLXML
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
...
...
@@ -1520,233 +1699,270 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateNClob
(
String
columnLabel
,
NClob
nClob
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateSQLXML
(
String
columnLabel
,
SQLXML
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateSQLXML
(
int
columnIndex
,
SQLXML
xmlObject
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateString
(
int
columnIndex
,
String
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateSQLXML
(
String
columnLabel
,
SQLXML
xmlObject
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateString
(
String
columnLabel
,
String
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBlob
(
int
columnIndex
,
InputStream
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateTime
(
int
columnIndex
,
Time
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBlob
(
String
columnLabel
,
InputStream
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateTime
(
String
columnLabel
,
Time
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBlob
(
int
columnIndex
,
InputStream
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateTimestamp
(
int
columnIndex
,
Timestamp
x
)
throws
SQLException
{
update
(
columnIndex
,
x
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
void
updateBlob
(
String
columnLabel
,
InputStream
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
void
updateTimestamp
(
String
columnLabel
,
Timestamp
x
)
throws
SQLException
{
update
(
columnLabel
,
x
);
}
//*/
// ---- result set meta data ---------------------------------------------
/**
* INTERNAL
* Returns the column count.
*
* @return the column count
*/
//## Java 1.6 ##
public
void
updateCharacterStream
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
int
getColumnCount
()
{
return
columns
.
size
();
}
//*/
/**
* INTERNAL
* Returns 15.
*
* @param columnIndex (1,2,...)
* @return 15
*/
//## Java 1.6 ##
public
void
updateCharacterStream
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
int
getColumnDisplaySize
(
int
columnIndex
)
{
return
15
;
}
//*/
/**
* INTERNAL
* Returns the SQL type.
*
* @param columnIndex (1,2,...)
* @return the SQL type
*/
//## Java 1.6 ##
public
void
updateCharacterStream
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
int
getColumnType
(
int
columnIndex
)
throws
SQLException
{
return
getColumn
(
columnIndex
-
1
).
sqlType
;
}
//*/
/**
* INTERNAL
* Returns the precision.
*
* @param columnIndex (1,2,...)
* @return the precision
*/
//## Java 1.6 ##
public
void
updateCharacterStream
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
int
getPrecision
(
int
columnIndex
)
throws
SQLException
{
return
getColumn
(
columnIndex
-
1
).
precision
;
}
//*/
/**
* INTERNAL
* Returns the scale.
*
* @param columnIndex (1,2,...)
* @return the scale
*/
//## Java 1.6 ##
public
void
updateClob
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
int
getScale
(
int
columnIndex
)
throws
SQLException
{
return
getColumn
(
columnIndex
-
1
).
scale
;
}
//*/
/**
* INTERNAL
* Returns ResultSetMetaData.columnNullableUnknown.
*
* @param columnIndex (1,2,...)
* @return columnNullableUnknown
*/
//## Java 1.6 ##
public
void
updateClob
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
int
isNullable
(
int
columnIndex
)
{
return
ResultSetMetaData
.
columnNullableUnknown
;
}
//*/
/**
* INTERNAL
* Returns false.
*
* @param columnIndex (1,2,...)
* @return false
*/
//## Java 1.6 ##
public
void
updateClob
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
boolean
isAutoIncrement
(
int
columnIndex
)
{
return
false
;
}
//*/
/**
* INTERNAL
* Returns true.
*
* @param columnIndex (1,2,...)
* @return true
*/
//## Java 1.6 ##
public
void
updateClob
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
boolean
isCaseSensitive
(
int
columnIndex
)
{
return
true
;
}
//*/
/**
* INTERNAL
* Returns false.
*
* @param columnIndex (1,2,...)
* @return false
*/
//## Java 1.6 ##
public
void
updateNCharacterStream
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
boolean
isCurrency
(
int
columnIndex
)
{
return
false
;
}
//*/
/**
* INTERNAL
* Returns false.
*
* @param columnIndex (1,2,...)
* @return false
*/
//## Java 1.6 ##
public
void
updateNCharacterStream
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
boolean
isDefinitelyWritable
(
int
columnIndex
)
{
return
false
;
}
//*/
/**
* INTERNAL
* Returns true.
*
* @param columnIndex (1,2,...)
* @return true
*/
//## Java 1.6 ##
public
void
updateNCharacterStream
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
boolean
isReadOnly
(
int
columnIndex
)
{
return
true
;
}
//*/
/**
* INTERNAL
* Returns true.
*
* @param columnIndex (1,2,...)
* @return true
*/
//## Java 1.6 ##
public
void
updateNCharacterStream
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
boolean
isSearchable
(
int
columnIndex
)
{
return
true
;
}
//*/
/**
* INTERNAL
* Returns true.
*
* @param columnIndex (1,2,...)
* @return true
*/
//## Java 1.6 ##
public
void
updateNClob
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
boolean
isSigned
(
int
columnIndex
)
{
return
true
;
}
//*/
/**
* INTERNAL
* Returns false.
*
* @param columnIndex (1,2,...)
* @return false
*/
//## Java 1.6 ##
public
void
updateNClob
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
throw
getUnsupportedException
();
public
boolean
isWritable
(
int
columnIndex
)
{
return
false
;
}
//*/
/**
* INTERNAL
* Returns null.
*
* @param columnIndex (1,2,...)
* @return null
*/
public
String
getCatalogName
(
int
columnIndex
)
{
return
null
;
}
/**
* Returns the Java class name if this column.
*
* @param columnIndex (1,2,...)
* @return the class name
*/
public
String
getColumnClassName
(
int
columnIndex
)
throws
SQLException
{
int
sqlType
=
getColumn
(
columnIndex
-
1
).
sqlType
;
int
type
=
DataType
.
convertSQLTypeToValueType
(
sqlType
);
return
DataType
.
getTypeClassName
(
type
);
}
/**
* Returns the column label.
*
* @param columnIndex (1,2,...)
* @return the column label
*/
public
String
getColumnLabel
(
int
columnIndex
)
throws
SQLException
{
return
getColumn
(
columnIndex
-
1
).
name
;
}
/**
* Returns the column name.
*
* @param columnIndex (1,2,...)
* @return the column name
*/
public
String
getColumnName
(
int
columnIndex
)
throws
SQLException
{
return
getColumnLabel
(
columnIndex
);
}
/**
* Returns the data type name of a column.
*
* @param columnIndex (1,2,...)
* @return the type name
*/
//## Java 1.6 ##
public
void
updateNClob
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
()
;
public
String
getColumnTypeName
(
int
columnIndex
)
throws
SQLException
{
int
sqlType
=
getColumn
(
columnIndex
-
1
).
sqlType
;
int
type
=
DataType
.
convertSQLTypeToValueType
(
sqlType
);
return
DataType
.
getDataType
(
type
).
name
;
}
//*/
/**
* INTERNAL
* Returns null.
*
* @param columnIndex (1,2,...)
* @return null
*/
//## Java 1.6 ##
public
void
updateNClob
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
getUnsupportedException
();
public
String
getSchemaName
(
int
columnIndex
)
{
return
null
;
}
//*/
/**
* INTERNAL
* Returns null.
*
* @param columnIndex (1,2,...)
* @return null
*/
public
Time
getTime
(
int
columnIndex
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
()
;
public
String
getTableName
(
int
columnIndex
)
{
return
null
;
}
// ---- unsupported / result set ---------------------------------------------
/**
* INTERNAL
*/
...
...
@@ -1901,20 +2117,6 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
InputStream
getAsciiStream
(
int
columnIndex
)
{
return
null
;
}
/**
* @deprecated INTERNAL
*/
public
InputStream
getUnicodeStream
(
int
columnIndex
)
{
return
null
;
}
/**
* INTERNAL
*/
...
...
@@ -1922,106 +2124,17 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
throw
getUnsupportedException
();
}
/**
* @deprecated INTERNAL
*/
public
BigDecimal
getBigDecimal
(
int
columnIndex
,
int
scale
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Ref
getRef
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
InputStream
getAsciiStream
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* @deprecated INTERNAL
*/
public
InputStream
getUnicodeStream
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Object
getObject
(
int
columnIndex
,
Map
<
String
,
Class
<?>>
map
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* @deprecated INTERNAL
*/
public
BigDecimal
getBigDecimal
(
String
columnLabel
,
int
scale
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
URL
getURL
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Date
getDate
(
int
columnIndex
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Ref
getRef
(
String
colName
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Timestamp
getTimestamp
(
int
columnIndex
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Object
getObject
(
String
colName
,
Map
<
String
,
Class
<?>>
map
)
throws
SQLException
{
throw
getUnsupportedException
();
}
/**
* INTERNAL
*/
public
Date
getDate
(
String
columnLabel
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
}
// --- private -----------------------------
/**
* INTERNAL
*/
public
Time
getTime
(
String
columnLabel
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
private
void
update
(
int
columnIndex
,
Object
obj
)
throws
SQLException
{
checkColumnIndex
(
columnIndex
);
this
.
currentRow
[
columnIndex
-
1
]
=
obj
;
}
/**
* INTERNAL
*/
public
Timestamp
getTimestamp
(
String
columnLabel
,
Calendar
cal
)
throws
SQLException
{
throw
getUnsupportedException
();
private
void
update
(
String
columnLabel
,
Object
obj
)
throws
SQLException
{
this
.
currentRow
[
findColumn
(
columnLabel
)
-
1
]
=
obj
;
}
// --- private -----------------------------
/**
* INTERNAL
*/
...
...
@@ -2030,8 +2143,8 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
}
private
void
checkColumnIndex
(
int
columnIndex
)
throws
SQLException
{
if
(
columnIndex
<
0
||
columnIndex
>=
columns
.
size
())
{
throw
DbException
.
getInvalidValueException
(
"columnIndex"
,
columnIndex
+
1
).
getSQLException
();
if
(
columnIndex
<
1
||
columnIndex
>
columns
.
size
())
{
throw
DbException
.
getInvalidValueException
(
"columnIndex"
,
columnIndex
).
getSQLException
();
}
}
...
...
@@ -2039,36 +2152,18 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
if
(
currentRow
==
null
)
{
throw
DbException
.
get
(
ErrorCode
.
NO_DATA_AVAILABLE
).
getSQLException
();
}
columnIndex
--;
checkColumnIndex
(
columnIndex
);
columnIndex
--;
Object
o
=
columnIndex
<
currentRow
.
length
?
currentRow
[
columnIndex
]
:
null
;
wasNull
=
o
==
null
;
return
o
;
}
private
Column
getColumn
(
int
i
)
throws
SQLException
{
checkColumnIndex
(
i
);
checkColumnIndex
(
i
+
1
);
return
columns
.
get
(
i
);
}
/**
* INTERNAL
*/
//## Java 1.6 ##
public
RowId
getRowId
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
RowId
getRowId
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* Returns the current result set holdability.
*
...
...
@@ -2087,79 +2182,6 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
return
rows
==
null
;
}
/**
* INTERNAL
*/
//## Java 1.6 ##
public
NClob
getNClob
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
NClob
getNClob
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
SQLXML
getSQLXML
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
SQLXML
getSQLXML
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
String
getNString
(
int
columnIndex
)
throws
SQLException
{
return
getString
(
columnIndex
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
String
getNString
(
String
columnLabel
)
throws
SQLException
{
return
getString
(
columnLabel
);
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
Reader
getNCharacterStream
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* INTERNAL
*/
//## Java 1.6 ##
public
Reader
getNCharacterStream
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
}
//*/
/**
* INTERNAL
*/
...
...
@@ -2178,30 +2200,6 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
}
//*/
/**
* INTERNAL
*
* @param columnIndex the column index (1, 2, ...)
* @param type the class of the returned value
*/
/*## Java 1.7 ##
public <T> T getObject(int columnIndex, Class<T> type) {
return null;
}
//*/
/**
* INTERNAL
*
* @param columnName the column name
* @param type the class of the returned value
*/
/*## Java 1.7 ##
public <T> T getObject(String columnName, Class<T> type) {
return null;
}
//*/
/**
* Set the auto-close behavior. If enabled (the default), the result set is
* closed after reading the last row.
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
fc552032
...
...
@@ -339,37 +339,78 @@ public class TestTools extends TestBase {
assertNull
(
rs
.
getBinaryStream
(
12
));
assertTrue
(
rs
.
wasNull
());
// all
'updateX' methods are not supported
// all
updateX methods
for
(
Method
m:
rs
.
getClass
().
getMethods
())
{
if
(
m
.
getName
().
startsWith
(
"update"
))
{
if
(
m
.
getName
().
equals
(
"updateRow"
))
{
continue
;
}
int
len
=
m
.
getParameterTypes
().
length
;
Object
[]
params
=
new
Object
[
len
];
int
i
=
0
;
String
expectedValue
=
null
;
for
(
Class
<?>
type
:
m
.
getParameterTypes
())
{
Object
o
=
null
;
Object
o
;
String
e
=
null
;
if
(
type
==
int
.
class
)
{
o
=
1
;
e
=
"1"
;
}
else
if
(
type
==
byte
.
class
)
{
o
=
(
byte
)
1
;
o
=
(
byte
)
2
;
e
=
"2"
;
}
else
if
(
type
==
double
.
class
)
{
o
=
(
double
)
1
;
o
=
(
double
)
3
;
e
=
"3.0"
;
}
else
if
(
type
==
float
.
class
)
{
o
=
(
float
)
1
;
o
=
(
float
)
4
;
e
=
"4.0"
;
}
else
if
(
type
==
long
.
class
)
{
o
=
(
long
)
1
;
o
=
(
long
)
5
;
e
=
"5"
;
}
else
if
(
type
==
short
.
class
)
{
o
=
(
short
)
1
;
o
=
(
short
)
6
;
e
=
"6"
;
}
else
if
(
type
==
boolean
.
class
)
{
o
=
false
;
e
=
"false"
;
}
else
if
(
type
==
String
.
class
)
{
// columnName or value
o
=
"a"
;
e
=
"a"
;
}
else
{
o
=
null
;
}
if
(
i
==
1
)
{
expectedValue
=
e
;
}
params
[
i
]
=
o
;
i
++;
}
m
.
invoke
(
rs
,
params
);
if
(
params
.
length
==
1
)
{
// updateNull
assertEquals
(
null
,
rs
.
getString
(
1
));
}
else
{
assertEquals
(
expectedValue
,
rs
.
getString
(
1
));
}
// invalid column name / index
Object
invalidColumn
;
if
(
m
.
getParameterTypes
()[
0
]
==
String
.
class
)
{
invalidColumn
=
"x"
;
}
else
{
invalidColumn
=
0
;
}
params
[
0
]
=
invalidColumn
;
try
{
m
.
invoke
(
rs
,
params
);
fail
();
}
catch
(
InvocationTargetException
e
)
{
SQLException
e2
=
(
SQLException
)
e
.
getTargetException
();
assertEquals
(
ErrorCode
.
FEATURE_NOT_SUPPORTED_1
,
e2
.
getErrorCode
());
if
(
invalidColumn
instanceof
String
)
{
assertEquals
(
ErrorCode
.
COLUMN_NOT_FOUND_1
,
e2
.
getErrorCode
());
}
else
{
assertEquals
(
ErrorCode
.
INVALID_VALUE_2
,
e2
.
getErrorCode
());
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论