Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
874b6e6b
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
874b6e6b
编写于
2月 06, 2013
作者:
L
lancea
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8006505: additional changes for JSR 310 support
Reviewed-by: naoto, ulfzibis
上级
ff12f415
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
104 addition
and
4 deletion
+104
-4
src/share/classes/java/sql/JDBCType.java
src/share/classes/java/sql/JDBCType.java
+11
-1
src/share/classes/java/sql/SQLInput.java
src/share/classes/java/sql/SQLInput.java
+35
-1
src/share/classes/java/sql/SQLOutput.java
src/share/classes/java/sql/SQLOutput.java
+40
-2
src/share/classes/java/sql/Types.java
src/share/classes/java/sql/Types.java
+18
-0
未找到文件。
src/share/classes/java/sql/JDBCType.java
浏览文件 @
874b6e6b
...
...
@@ -190,7 +190,17 @@ public enum JDBCType implements SQLType {
/**
* Identifies the generic SQL type {@code REF_CURSOR}.
*/
REF_CURSOR
(
Types
.
REF_CURSOR
);
REF_CURSOR
(
Types
.
REF_CURSOR
),
/**
* Identifies the generic SQL type {@code TIME_WITH_TIMEZONE}.
*/
TIME_WITH_TIMEZONE
(
Types
.
TIME_WITH_TIMEZONE
),
/**
* Identifies the generic SQL type {@code TIMESTAMP_WITH_TIMEZONE}.
*/
TIMESTAMP_WITH_TIMEZONE
(
Types
.
TIMESTAMP_WITH_TIMEZONE
);
/**
* The Integer value for the JDBCType. It maps to a value in
...
...
src/share/classes/java/sql/SQLInput.java
浏览文件 @
874b6e6b
/*
* Copyright (c) 1998, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 20
13
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -421,4 +421,38 @@ public interface SQLInput {
*/
RowId
readRowId
()
throws
SQLException
;
//--------------------------JDBC 4.2 -----------------------------
/**
* Reads the next attribute in the stream and returns it as an
* {@code Object} in the Java programming language. The
* actual type of the object returned is determined by the specified
* Java data type, and any customizations present in this
* stream's type map.
*
* <P>A type map is registered with the stream by the JDBC driver before the
* stream is passed to the application.
*
* <P>When the attribute at the head of the stream is an SQL {@code NULL}
* the method returns {@code null}. If the attribute is an SQL
* structured or distinct
* type, it determines the SQL type of the attribute at the head of the stream.
* If the stream's type map has an entry for that SQL type, the driver
* constructs an object of the appropriate class and calls the method
* {@code SQLData.readSQL} on that object, which reads additional data from the
* stream, using the protocol described for that method.
*<p>
* The default implementation will throw {@code SQLFeatureNotSupportedException}
*
* @param type Class representing the Java data type to convert the attribute to.
* @return the attribute at the head of the stream as an {@code Object} in the
* Java programming language;{@code null} if the attribute is SQL {@code NULL}
* @exception SQLException if a database access error occurs
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
* @since 1.8
*/
default
<
T
>
T
readObject
(
Class
<
T
>
type
)
throws
SQLException
{
throw
new
SQLFeatureNotSupportedException
();
}
}
src/share/classes/java/sql/SQLOutput.java
浏览文件 @
874b6e6b
/*
* Copyright (c) 1998, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 20
13
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -272,7 +272,7 @@ package java.sql;
* Otherwise, it calls the <code>SQLData.writeSQL</code>
* method of the given object, which
* writes the object's attributes to the stream.
* The implementation of the method <code>SQLData.writeSQ</code>
* The implementation of the method <code>SQLData.writeSQ
L
</code>
* calls the appropriate <code>SQLOutput</code> writer method(s)
* for writing each of the object's attributes in order.
* The attributes must be read from an <code>SQLInput</code>
...
...
@@ -433,5 +433,43 @@ package java.sql;
*/
void
writeSQLXML
(
SQLXML
x
)
throws
SQLException
;
//--------------------------JDBC 4.2 -----------------------------
/**
* Writes to the stream the data contained in the given object. The
* object will be converted to the specified targetSqlType
* before being sent to the stream.
*<p>
* When the {@code object} is {@code null}, this
* method writes an SQL {@code NULL} to the stream.
* <p>
* If the object has a custom mapping (is of a class implementing the
* interface {@code SQLData}),
* the JDBC driver should call the method {@code SQLData.writeSQL} to
* write it to the SQL data stream.
* If, on the other hand, the object is of a class implementing
* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},
* {@code Struct}, {@code java.net.URL},
* or {@code Array}, the driver should pass it to the database as a
* value of the corresponding SQL type.
*<P>
* The default implementation will throw {@code SQLFeatureNotSupportedException}
*
* @param x the object containing the input parameter value
* @param targetSqlType the SQL type to be sent to the database.
* @exception SQLException if a database access error occurs or
* if the Java Object specified by x is an InputStream
* or Reader object and the value of the scale parameter is less
* than zero
* @exception SQLFeatureNotSupportedException if
* the JDBC driver does not support this data type
* @see JDBCType
* @see SQLType
* @since 1.8
*/
default
void
writeObject
(
Object
x
,
SQLType
targetSqlType
)
throws
SQLException
{
throw
new
SQLFeatureNotSupportedException
();
}
}
src/share/classes/java/sql/Types.java
浏览文件 @
874b6e6b
...
...
@@ -319,6 +319,24 @@ public class Types {
*/
public
static
final
int
REF_CURSOR
=
2012
;
/**
* The constant in the Java programming language, sometimes referred to
* as a type code, that identifies the generic SQL type
* {@code TIME WITH TIMEZONE}.
*
* @since 1.8
*/
public
static
final
int
TIME_WITH_TIMEZONE
=
2013
;
/**
* The constant in the Java programming language, sometimes referred to
* as a type code, that identifies the generic SQL type
* {@code TIMESTAMP WITH TIMEZONE}.
*
* @since 1.8
*/
public
static
final
int
TIMESTAMP_WITH_TIMEZONE
=
2014
;
// Prevent instantiation
private
Types
()
{}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录