Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
7102cc38
提交
7102cc38
authored
10月 05, 2016
作者:
Noel Grandin
提交者:
GitHub
10月 05, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #371 from marschall/remove-java6-backwards-compat
Remove Java 6 backwards compatibility
上级
8c4e7771
7cc659a5
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
22 行增加
和
67 行删除
+22
-67
JdbcDriverBackwardsCompat.java
h2/src/main/org/h2/JdbcDriverBackwardsCompat.java
+0
-3
JdbcCallableStatementBackwardsCompat.java
...ain/org/h2/jdbc/JdbcCallableStatementBackwardsCompat.java
+0
-5
JdbcConnectionBackwardsCompat.java
h2/src/main/org/h2/jdbc/JdbcConnectionBackwardsCompat.java
+0
-12
JdbcDatabaseMetaDataBackwardsCompat.java
...main/org/h2/jdbc/JdbcDatabaseMetaDataBackwardsCompat.java
+0
-7
JdbcResultSetBackwardsCompat.java
h2/src/main/org/h2/jdbc/JdbcResultSetBackwardsCompat.java
+0
-5
JdbcStatementBackwardsCompat.java
h2/src/main/org/h2/jdbc/JdbcStatementBackwardsCompat.java
+0
-3
JdbcConnectionPoolBackwardsCompat.java
.../main/org/h2/jdbcx/JdbcConnectionPoolBackwardsCompat.java
+0
-3
JdbcDataSourceBackwardsCompat.java
h2/src/main/org/h2/jdbcx/JdbcDataSourceBackwardsCompat.java
+0
-3
TestCallableStatement.java
h2/src/test/org/h2/test/jdbc/TestCallableStatement.java
+1
-2
TestConnection.java
h2/src/test/org/h2/test/jdbc/TestConnection.java
+8
-10
TestResultSet.java
h2/src/test/org/h2/test/jdbc/TestResultSet.java
+13
-14
没有找到文件。
h2/src/main/org/h2/JdbcDriverBackwardsCompat.java
浏览文件 @
7102cc38
...
...
@@ -5,12 +5,9 @@
*/
package
org
.
h2
;
import
java.util.logging.Logger
;
/**
* Allows us to compile on older platforms, while still implementing the methods from the newer JDBC API.
*/
public
interface
JdbcDriverBackwardsCompat
{
Logger
getParentLogger
();
}
h2/src/main/org/h2/jdbc/JdbcCallableStatementBackwardsCompat.java
浏览文件 @
7102cc38
...
...
@@ -5,14 +5,9 @@
*/
package
org
.
h2
.
jdbc
;
import
java.sql.SQLException
;
/**
* Allows us to compile on older platforms, while still implementing the methods from the newer JDBC API.
*/
public
interface
JdbcCallableStatementBackwardsCompat
{
<
T
>
T
getObject
(
int
parameterIndex
,
Class
<
T
>
type
)
throws
SQLException
;
<
T
>
T
getObject
(
String
parameterName
,
Class
<
T
>
type
)
throws
SQLException
;
}
h2/src/main/org/h2/jdbc/JdbcConnectionBackwardsCompat.java
浏览文件 @
7102cc38
...
...
@@ -5,21 +5,9 @@
*/
package
org
.
h2
.
jdbc
;
import
java.sql.SQLException
;
import
java.util.concurrent.Executor
;
/**
* Allows us to compile on older platforms, while still implementing the methods from the newer JDBC API.
*/
public
interface
JdbcConnectionBackwardsCompat
{
void
setSchema
(
String
schema
)
throws
SQLException
;
String
getSchema
()
throws
SQLException
;
void
abort
(
Executor
executor
)
throws
SQLException
;
void
setNetworkTimeout
(
Executor
executor
,
int
milliseconds
)
throws
SQLException
;
int
getNetworkTimeout
()
throws
SQLException
;
}
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaDataBackwardsCompat.java
浏览文件 @
7102cc38
...
...
@@ -5,17 +5,10 @@
*/
package
org
.
h2
.
jdbc
;
import
java.sql.ResultSet
;
/**
* Allows us to compile on older platforms, while still implementing the methods
* from the newer JDBC API.
*/
public
interface
JdbcDatabaseMetaDataBackwardsCompat
{
boolean
generatedKeyAlwaysReturned
();
ResultSet
getPseudoColumns
(
String
catalog
,
String
schemaPattern
,
String
tableNamePattern
,
String
columnNamePattern
);
}
h2/src/main/org/h2/jdbc/JdbcResultSetBackwardsCompat.java
浏览文件 @
7102cc38
...
...
@@ -5,14 +5,9 @@
*/
package
org
.
h2
.
jdbc
;
import
java.sql.SQLException
;
/**
* Allows us to compile on older platforms, while still implementing the methods from the newer JDBC API.
*/
public
interface
JdbcResultSetBackwardsCompat
{
public
abstract
<
T
>
T
getObject
(
int
columnIndex
,
Class
<
T
>
type
)
throws
SQLException
;
public
abstract
<
T
>
T
getObject
(
String
columnName
,
Class
<
T
>
type
)
throws
SQLException
;
}
h2/src/main/org/h2/jdbc/JdbcStatementBackwardsCompat.java
浏览文件 @
7102cc38
...
...
@@ -10,7 +10,4 @@ package org.h2.jdbc;
*/
public
interface
JdbcStatementBackwardsCompat
{
void
closeOnCompletion
();
boolean
isCloseOnCompletion
();
}
h2/src/main/org/h2/jdbcx/JdbcConnectionPoolBackwardsCompat.java
浏览文件 @
7102cc38
...
...
@@ -5,12 +5,9 @@
*/
package
org
.
h2
.
jdbcx
;
import
java.util.logging.Logger
;
/**
* Allows us to compile on older platforms, while still implementing the methods from the newer JDBC API.
*/
public
interface
JdbcConnectionPoolBackwardsCompat
{
Logger
getParentLogger
();
}
h2/src/main/org/h2/jdbcx/JdbcDataSourceBackwardsCompat.java
浏览文件 @
7102cc38
...
...
@@ -5,12 +5,9 @@
*/
package
org
.
h2
.
jdbcx
;
import
java.util.logging.Logger
;
/**
* Allows us to compile on older platforms, while still implementing the methods from the newer JDBC API.
*/
public
interface
JdbcDataSourceBackwardsCompat
{
Logger
getParentLogger
();
}
h2/src/test/org/h2/test/jdbc/TestCallableStatement.java
浏览文件 @
7102cc38
...
...
@@ -23,7 +23,6 @@ import java.sql.Types;
import
java.util.Collections
;
import
org.h2.api.ErrorCode
;
import
org.h2.jdbc.JdbcCallableStatementBackwardsCompat
;
import
org.h2.test.TestBase
;
import
org.h2.tools.SimpleResultSet
;
import
org.h2.util.IOUtils
;
...
...
@@ -148,7 +147,7 @@ public class TestCallableStatement extends TestBase {
assertEquals
(
1
,
call
.
getLong
(
1
));
assertEquals
(
1
,
call
.
getByte
(
1
));
assertEquals
(
1
,
((
Long
)
call
.
getObject
(
1
)).
longValue
());
assertEquals
(
1
,
((
JdbcCallableStatementBackwardsCompat
)
call
)
.
getObject
(
1
,
Long
.
class
).
longValue
());
assertEquals
(
1
,
call
.
getObject
(
1
,
Long
.
class
).
longValue
());
assertFalse
(
call
.
wasNull
());
call
.
setFloat
(
2
,
1.1f
);
...
...
h2/src/test/org/h2/test/jdbc/TestConnection.java
浏览文件 @
7102cc38
...
...
@@ -6,7 +6,6 @@
package
org
.
h2
.
test
.
jdbc
;
import
org.h2.api.ErrorCode
;
import
org.h2.jdbc.JdbcConnectionBackwardsCompat
;
import
org.h2.test.TestBase
;
import
java.sql.Connection
;
import
java.sql.SQLClientInfoException
;
...
...
@@ -97,18 +96,17 @@ public class TestConnection extends TestBase {
Statement
s
=
conn
.
createStatement
();
s
.
executeUpdate
(
"create schema my_test_schema"
);
s
.
executeUpdate
(
"create table my_test_schema.my_test_table(id uuid, nave varchar)"
);
JdbcConnectionBackwardsCompat
connx
=
(
JdbcConnectionBackwardsCompat
)
conn
;
assertEquals
(
"PUBLIC"
,
connx
.
getSchema
());
assertEquals
(
"PUBLIC"
,
conn
.
getSchema
());
assertThrows
(
ErrorCode
.
TABLE_OR_VIEW_NOT_FOUND_1
,
s
,
"select * from my_test_table"
);
assertThrows
(
ErrorCode
.
SCHEMA_NOT_FOUND_1
,
conn
x
).
setSchema
(
"my_test_table"
);
conn
x
.
setSchema
(
"MY_TEST_SCHEMA"
);
assertEquals
(
"MY_TEST_SCHEMA"
,
conn
x
.
getSchema
());
assertThrows
(
ErrorCode
.
SCHEMA_NOT_FOUND_1
,
conn
).
setSchema
(
"my_test_table"
);
conn
.
setSchema
(
"MY_TEST_SCHEMA"
);
assertEquals
(
"MY_TEST_SCHEMA"
,
conn
.
getSchema
());
s
.
executeQuery
(
"select * from my_test_table"
);
assertThrows
(
ErrorCode
.
SCHEMA_NOT_FOUND_1
,
conn
x
).
setSchema
(
"NON_EXISTING_SCHEMA"
);
assertEquals
(
"MY_TEST_SCHEMA"
,
conn
x
.
getSchema
());
assertThrows
(
ErrorCode
.
SCHEMA_NOT_FOUND_1
,
conn
).
setSchema
(
"NON_EXISTING_SCHEMA"
);
assertEquals
(
"MY_TEST_SCHEMA"
,
conn
.
getSchema
());
s
.
executeUpdate
(
"create schema \"otheR_schEma\""
);
conn
x
.
setSchema
(
"otheR_schEma"
);
assertEquals
(
"otheR_schEma"
,
conn
x
.
getSchema
());
conn
.
setSchema
(
"otheR_schEma"
);
assertEquals
(
"otheR_schEma"
,
conn
.
getSchema
());
s
.
close
();
conn
.
close
();
}
...
...
h2/src/test/org/h2/test/jdbc/TestResultSet.java
浏览文件 @
7102cc38
...
...
@@ -35,7 +35,6 @@ import java.util.Collections;
import
java.util.TimeZone
;
import
org.h2.api.ErrorCode
;
import
org.h2.jdbc.JdbcResultSetBackwardsCompat
;
import
org.h2.test.TestBase
;
import
org.h2.util.IOUtils
;
...
...
@@ -671,7 +670,7 @@ public class TestResultSet extends TestBase {
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Integer
);
assertTrue
(((
Integer
)
o
).
intValue
()
==
-
1
);
o
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
"value"
,
Integer
.
class
);
o
=
rs
.
getObject
(
"value"
,
Integer
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Integer
);
assertTrue
(((
Integer
)
o
).
intValue
()
==
-
1
);
...
...
@@ -679,7 +678,7 @@ public class TestResultSet extends TestBase {
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Integer
);
assertTrue
(((
Integer
)
o
).
intValue
()
==
-
1
);
o
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
2
,
Integer
.
class
);
o
=
rs
.
getObject
(
2
,
Integer
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Integer
);
assertTrue
(((
Integer
)
o
).
intValue
()
==
-
1
);
...
...
@@ -730,7 +729,7 @@ public class TestResultSet extends TestBase {
o
=
rs
.
getObject
(
2
);
assertTrue
(
o
==
null
);
assertTrue
(
rs
.
wasNull
());
o
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
2
,
Integer
.
class
);
o
=
rs
.
getObject
(
2
,
Integer
.
class
);
assertTrue
(
o
==
null
);
assertTrue
(
rs
.
wasNull
());
assertFalse
(
rs
.
next
());
...
...
@@ -792,7 +791,7 @@ public class TestResultSet extends TestBase {
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
String
);
assertTrue
(
o
.
toString
().
equals
(
"Hi"
));
o
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
"value"
,
String
.
class
);
o
=
rs
.
getObject
(
"value"
,
String
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
String
);
assertTrue
(
o
.
equals
(
"Hi"
));
...
...
@@ -861,7 +860,7 @@ public class TestResultSet extends TestBase {
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
BigDecimal
);
assertTrue
(((
BigDecimal
)
o
).
compareTo
(
new
BigDecimal
(
"-1.00"
))
==
0
);
o
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
2
,
BigDecimal
.
class
);
o
=
rs
.
getObject
(
2
,
BigDecimal
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
BigDecimal
);
assertTrue
(((
BigDecimal
)
o
).
compareTo
(
new
BigDecimal
(
"-1.00"
))
==
0
);
...
...
@@ -925,7 +924,7 @@ public class TestResultSet extends TestBase {
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Double
);
assertTrue
(((
Double
)
o
).
compareTo
(
new
Double
(
"-1.00"
))
==
0
);
o
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
2
,
Double
.
class
);
o
=
rs
.
getObject
(
2
,
Double
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Double
);
assertTrue
(((
Double
)
o
).
compareTo
(
new
Double
(
"-1.00"
))
==
0
);
...
...
@@ -933,7 +932,7 @@ public class TestResultSet extends TestBase {
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Float
);
assertTrue
(((
Float
)
o
).
compareTo
(
new
Float
(
"-1.00"
))
==
0
);
o
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
3
,
Float
.
class
);
o
=
rs
.
getObject
(
3
,
Float
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Float
);
assertTrue
(((
Float
)
o
).
compareTo
(
new
Float
(
"-1.00"
))
==
0
);
...
...
@@ -1037,7 +1036,7 @@ public class TestResultSet extends TestBase {
assertTrue
(((
java
.
sql
.
Timestamp
)
o
).
equals
(
java
.
sql
.
Timestamp
.
valueOf
(
"2011-11-11 00:00:00.0"
)));
assertFalse
(
rs
.
wasNull
());
o
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
2
,
java
.
sql
.
Timestamp
.
class
);
o
=
rs
.
getObject
(
2
,
java
.
sql
.
Timestamp
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
java
.
sql
.
Timestamp
);
assertTrue
(((
java
.
sql
.
Timestamp
)
o
).
equals
(
...
...
@@ -1082,9 +1081,9 @@ public class TestResultSet extends TestBase {
assertEquals
(
"2001-02-03"
,
date
.
toString
());
assertEquals
(
"14:15:16"
,
time
.
toString
());
assertEquals
(
"2007-08-09 10:11:12.141516171"
,
ts
.
toString
());
date
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
1
,
Date
.
class
);
time
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
2
,
Time
.
class
);
ts
=
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
3
,
Timestamp
.
class
);
date
=
rs
.
getObject
(
1
,
Date
.
class
);
time
=
rs
.
getObject
(
2
,
Time
.
class
);
ts
=
rs
.
getObject
(
3
,
Timestamp
.
class
);
assertEquals
(
"2001-02-03"
,
date
.
toString
());
assertEquals
(
"14:15:16"
,
time
.
toString
());
assertEquals
(
"2007-08-09 10:11:12.141516171"
,
ts
.
toString
());
...
...
@@ -1229,7 +1228,7 @@ public class TestResultSet extends TestBase {
assertTrue
(!
rs
.
wasNull
());
assertEqualsWithNull
(
new
byte
[]
{
(
byte
)
0x01
,
(
byte
)
0x01
,
(
byte
)
0x01
,
(
byte
)
0x01
},
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
2
,
byte
[].
class
));
rs
.
getObject
(
2
,
byte
[].
class
));
assertTrue
(!
rs
.
wasNull
());
rs
.
next
();
assertEqualsWithNull
(
new
byte
[]
{
(
byte
)
0x02
,
(
byte
)
0x02
,
...
...
@@ -1238,7 +1237,7 @@ public class TestResultSet extends TestBase {
assertTrue
(!
rs
.
wasNull
());
assertEqualsWithNull
(
new
byte
[]
{
(
byte
)
0x02
,
(
byte
)
0x02
,
(
byte
)
0x02
,
(
byte
)
0x02
},
((
JdbcResultSetBackwardsCompat
)
rs
)
.
getObject
(
"value"
,
byte
[].
class
));
rs
.
getObject
(
"value"
,
byte
[].
class
));
assertTrue
(!
rs
.
wasNull
());
rs
.
next
();
assertEqualsWithNull
(
new
byte
[]
{
(
byte
)
0x00
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论