Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
b76d9b20
提交
b76d9b20
authored
6月 08, 2016
作者:
Thomas Mueller Graf
浏览文件
操作
浏览文件
下载
差异文件
Merged
上级
545bf467
177d5bdc
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
181 行增加
和
78 行删除
+181
-78
changelog.html
h2/src/docsrc/html/changelog.html
+4
-0
Driver.java
h2/src/main/org/h2/Driver.java
+2
-7
JdbcDriverBackwardsCompat.java
h2/src/main/org/h2/JdbcDriverBackwardsCompat.java
+16
-0
JdbcCallableStatement.java
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
+6
-10
JdbcCallableStatementBackwardsCompat.java
...ain/org/h2/jdbc/JdbcCallableStatementBackwardsCompat.java
+18
-0
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+2
-16
JdbcConnectionBackwardsCompat.java
h2/src/main/org/h2/jdbc/JdbcConnectionBackwardsCompat.java
+24
-0
JdbcDatabaseMetaData.java
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
+1
-5
JdbcDatabaseMetaDataBackwardsCompat.java
...main/org/h2/jdbc/JdbcDatabaseMetaDataBackwardsCompat.java
+21
-0
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+5
-10
JdbcResultSetBackwardsCompat.java
h2/src/main/org/h2/jdbc/JdbcResultSetBackwardsCompat.java
+18
-0
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+1
-5
JdbcStatementBackwardsCompat.java
h2/src/main/org/h2/jdbc/JdbcStatementBackwardsCompat.java
+16
-0
JdbcConnectionPool.java
h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java
+3
-8
JdbcConnectionPoolBackwardsCompat.java
.../main/org/h2/jdbcx/JdbcConnectionPoolBackwardsCompat.java
+16
-0
JdbcDataSource.java
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
+2
-7
JdbcDataSourceBackwardsCompat.java
h2/src/main/org/h2/jdbcx/JdbcDataSourceBackwardsCompat.java
+16
-0
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+10
-10
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
b76d9b20
...
@@ -23,6 +23,10 @@ Change Log
...
@@ -23,6 +23,10 @@ Change Log
<ul>
<ul>
<li>
Issue #299: Nested derrived tables did not always work as expected.
<li>
Issue #299: Nested derrived tables did not always work as expected.
</li>
</li>
<li>
Use interfaces to replace the java version templating, idea from Lukas Eder.
</li>
<li>
Issue #295: JdbcResultSet.getObject(int, Class) returns null instead of throwing.
</li>
</ul>
</ul>
<h2>
Version 1.4.192 Beta (2016-05-26)
</h2>
<h2>
Version 1.4.192 Beta (2016-05-26)
</h2>
...
...
h2/src/main/org/h2/Driver.java
浏览文件 @
b76d9b20
...
@@ -10,15 +10,12 @@ import java.sql.DriverManager;
...
@@ -10,15 +10,12 @@ import java.sql.DriverManager;
import
java.sql.DriverPropertyInfo
;
import
java.sql.DriverPropertyInfo
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.logging.Logger
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Constants
;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.upgrade.DbUpgrade
;
import
org.h2.upgrade.DbUpgrade
;
/*## Java 1.7 ##
import java.util.logging.Logger;
//*/
/**
/**
* The database driver. An application should not use this class directly. The
* The database driver. An application should not use this class directly. The
* only thing the application needs to do is load the driver. This can be done
* only thing the application needs to do is load the driver. This can be done
...
@@ -31,7 +28,7 @@ import java.util.logging.Logger;
...
@@ -31,7 +28,7 @@ import java.util.logging.Logger;
* "jdbc:h2:˜/test", "sa", "sa");
* "jdbc:h2:˜/test", "sa", "sa");
* </pre>
* </pre>
*/
*/
public
class
Driver
implements
java
.
sql
.
Driver
{
public
class
Driver
implements
java
.
sql
.
Driver
,
JdbcDriverBackwardsCompat
{
private
static
final
Driver
INSTANCE
=
new
Driver
();
private
static
final
Driver
INSTANCE
=
new
Driver
();
private
static
final
String
DEFAULT_URL
=
"jdbc:default:connection"
;
private
static
final
String
DEFAULT_URL
=
"jdbc:default:connection"
;
...
@@ -143,12 +140,10 @@ public class Driver implements java.sql.Driver {
...
@@ -143,12 +140,10 @@ public class Driver implements java.sql.Driver {
/**
/**
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
Logger
getParentLogger
()
{
public
Logger
getParentLogger
()
{
return
null
;
return
null
;
}
}
//*/
/**
/**
* INTERNAL
* INTERNAL
...
...
h2/src/main/org/h2/JdbcDriverBackwardsCompat.java
0 → 100644
浏览文件 @
b76d9b20
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
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/JdbcCallableStatement.java
浏览文件 @
b76d9b20
...
@@ -25,7 +25,6 @@ import java.sql.Timestamp;
...
@@ -25,7 +25,6 @@ import java.sql.Timestamp;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.h2.api.ErrorCode
;
import
org.h2.api.ErrorCode
;
import
org.h2.expression.ParameterInterface
;
import
org.h2.expression.ParameterInterface
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
...
@@ -41,7 +40,7 @@ import org.h2.value.ValueNull;
...
@@ -41,7 +40,7 @@ import org.h2.value.ValueNull;
* @author Thomas Mueller
* @author Thomas Mueller
*/
*/
public
class
JdbcCallableStatement
extends
JdbcPreparedStatement
implements
public
class
JdbcCallableStatement
extends
JdbcPreparedStatement
implements
CallableStatement
{
CallableStatement
,
JdbcCallableStatementBackwardsCompat
{
private
BitField
outParameters
;
private
BitField
outParameters
;
private
int
maxOutParameters
;
private
int
maxOutParameters
;
...
@@ -300,6 +299,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements
...
@@ -300,6 +299,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements
* @throws SQLException if the column is not found or if this object is
* @throws SQLException if the column is not found or if this object is
* closed
* closed
*/
*/
@Deprecated
@Override
@Override
public
BigDecimal
getBigDecimal
(
int
parameterIndex
,
int
scale
)
public
BigDecimal
getBigDecimal
(
int
parameterIndex
,
int
scale
)
throws
SQLException
{
throws
SQLException
{
...
@@ -1569,12 +1569,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements
...
@@ -1569,12 +1569,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements
* @param parameterIndex the parameter index (1, 2, ...)
* @param parameterIndex the parameter index (1, 2, ...)
* @param type the class of the returned value
* @param type the class of the returned value
*/
*/
/*## Java 1.7 ##
@Override
@Override
public <T> T getObject(int parameterIndex, Class<T> type) {
public
<
T
>
T
getObject
(
int
parameterIndex
,
Class
<
T
>
type
)
throws
SQLException
{
return null
;
throw
unsupported
(
"getObject"
)
;
}
}
//*/
/**
/**
* [Not supported]
* [Not supported]
...
@@ -1582,12 +1580,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements
...
@@ -1582,12 +1580,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements
* @param parameterName the parameter name
* @param parameterName the parameter name
* @param type the class of the returned value
* @param type the class of the returned value
*/
*/
/*## Java 1.7 ##
@Override
@Override
public <T> T getObject(String parameterName, Class<T> type) {
public
<
T
>
T
getObject
(
String
parameterName
,
Class
<
T
>
type
)
throws
SQLException
{
return null
;
throw
unsupported
(
"getObject"
)
;
}
}
//*/
private
ResultSetMetaData
getCheckedMetaData
()
throws
SQLException
{
private
ResultSetMetaData
getCheckedMetaData
()
throws
SQLException
{
ResultSetMetaData
meta
=
getMetaData
();
ResultSetMetaData
meta
=
getMetaData
();
...
...
h2/src/main/org/h2/jdbc/JdbcCallableStatementBackwardsCompat.java
0 → 100644
浏览文件 @
b76d9b20
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
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/JdbcConnection.java
浏览文件 @
b76d9b20
...
@@ -26,16 +26,12 @@ import java.sql.SQLXML;
...
@@ -26,16 +26,12 @@ import java.sql.SQLXML;
import
java.sql.Savepoint
;
import
java.sql.Savepoint
;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.sql.Struct
;
import
java.sql.Struct
;
/*## Java 1.7 ##
import java.util.concurrent.Executor;
//*/
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.concurrent.Executor
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
org.h2.api.ErrorCode
;
import
org.h2.api.ErrorCode
;
import
org.h2.command.CommandInterface
;
import
org.h2.command.CommandInterface
;
...
@@ -67,7 +63,7 @@ import org.h2.value.ValueString;
...
@@ -67,7 +63,7 @@ import org.h2.value.ValueString;
* connection should only be used in one thread at any time.
* connection should only be used in one thread at any time.
* </p>
* </p>
*/
*/
public
class
JdbcConnection
extends
TraceObject
implements
Connection
{
public
class
JdbcConnection
extends
TraceObject
implements
Connection
,
JdbcConnectionBackwardsCompat
{
private
static
final
String
NUM_SERVERS
=
"numServers"
;
private
static
final
String
NUM_SERVERS
=
"numServers"
;
private
static
final
String
PREFIX_SERVER
=
"server"
;
private
static
final
String
PREFIX_SERVER
=
"server"
;
...
@@ -1896,34 +1892,28 @@ public class JdbcConnection extends TraceObject implements Connection {
...
@@ -1896,34 +1892,28 @@ public class JdbcConnection extends TraceObject implements Connection {
*
*
* @param schema the schema
* @param schema the schema
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
void
setSchema
(
String
schema
)
{
public
void
setSchema
(
String
schema
)
{
// not supported
// not supported
}
}
//*/
/**
/**
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
String
getSchema
()
{
public
String
getSchema
()
{
return
null
;
return
null
;
}
}
//*/
/**
/**
* [Not supported]
* [Not supported]
*
*
* @param executor the executor used by this method
* @param executor the executor used by this method
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
void
abort
(
Executor
executor
)
{
public
void
abort
(
Executor
executor
)
{
// not supported
// not supported
}
}
//*/
/**
/**
* [Not supported]
* [Not supported]
...
@@ -1931,22 +1921,18 @@ public class JdbcConnection extends TraceObject implements Connection {
...
@@ -1931,22 +1921,18 @@ public class JdbcConnection extends TraceObject implements Connection {
* @param executor the executor used by this method
* @param executor the executor used by this method
* @param milliseconds the TCP connection timeout
* @param milliseconds the TCP connection timeout
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
void
setNetworkTimeout
(
Executor
executor
,
int
milliseconds
)
{
public
void
setNetworkTimeout
(
Executor
executor
,
int
milliseconds
)
{
// not supported
// not supported
}
}
//*/
/**
/**
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
int
getNetworkTimeout
()
{
public
int
getNetworkTimeout
()
{
return
0
;
return
0
;
}
}
//*/
/**
/**
* Check that the given type map is either null or empty.
* Check that the given type map is either null or empty.
...
...
h2/src/main/org/h2/jdbc/JdbcConnectionBackwardsCompat.java
0 → 100644
浏览文件 @
b76d9b20
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
jdbc
;
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
);
String
getSchema
();
void
abort
(
Executor
executor
);
void
setNetworkTimeout
(
Executor
executor
,
int
milliseconds
);
int
getNetworkTimeout
();
}
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
浏览文件 @
b76d9b20
...
@@ -26,7 +26,7 @@ import org.h2.util.StringUtils;
...
@@ -26,7 +26,7 @@ import org.h2.util.StringUtils;
* Represents the meta data for a database.
* Represents the meta data for a database.
*/
*/
public
class
JdbcDatabaseMetaData
extends
TraceObject
implements
public
class
JdbcDatabaseMetaData
extends
TraceObject
implements
DatabaseMetaData
{
DatabaseMetaData
,
JdbcDatabaseMetaDataBackwardsCompat
{
private
final
JdbcConnection
conn
;
private
final
JdbcConnection
conn
;
...
@@ -3133,12 +3133,10 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -3133,12 +3133,10 @@ public class JdbcDatabaseMetaData extends TraceObject implements
/**
/**
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
boolean
generatedKeyAlwaysReturned
()
{
public
boolean
generatedKeyAlwaysReturned
()
{
return
true
;
return
true
;
}
}
//*/
/**
/**
* [Not supported]
* [Not supported]
...
@@ -3151,13 +3149,11 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -3151,13 +3149,11 @@ public class JdbcDatabaseMetaData extends TraceObject implements
* @param columnNamePattern null (to get all objects) or a column name
* @param columnNamePattern null (to get all objects) or a column name
* (uppercase for unquoted names)
* (uppercase for unquoted names)
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
ResultSet
getPseudoColumns
(
String
catalog
,
String
schemaPattern
,
public
ResultSet
getPseudoColumns
(
String
catalog
,
String
schemaPattern
,
String
tableNamePattern
,
String
columnNamePattern
)
{
String
tableNamePattern
,
String
columnNamePattern
)
{
return
null
;
return
null
;
}
}
//*/
/**
/**
* INTERNAL
* INTERNAL
...
...
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaDataBackwardsCompat.java
0 → 100644
浏览文件 @
b76d9b20
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0, and the
* EPL 1.0 (http://h2database.com/html/license.html). Initial Developer: H2
* Group
*/
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/JdbcResultSet.java
浏览文件 @
b76d9b20
...
@@ -27,7 +27,6 @@ import java.sql.Timestamp;
...
@@ -27,7 +27,6 @@ import java.sql.Timestamp;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.h2.api.ErrorCode
;
import
org.h2.api.ErrorCode
;
import
org.h2.engine.SysProperties
;
import
org.h2.engine.SysProperties
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
...
@@ -72,7 +71,7 @@ import org.h2.value.ValueTimestamp;
...
@@ -72,7 +71,7 @@ import org.h2.value.ValueTimestamp;
* changes are visible, but not own inserts and deletes.
* changes are visible, but not own inserts and deletes.
* </p>
* </p>
*/
*/
public
class
JdbcResultSet
extends
TraceObject
implements
ResultSet
{
public
class
JdbcResultSet
extends
TraceObject
implements
ResultSet
,
JdbcResultSetBackwardsCompat
{
private
final
boolean
closeStatement
;
private
final
boolean
closeStatement
;
private
final
boolean
scrollable
;
private
final
boolean
scrollable
;
private
final
boolean
updatable
;
private
final
boolean
updatable
;
...
@@ -3685,12 +3684,10 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -3685,12 +3684,10 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param columnIndex the column index (1, 2, ...)
* @param columnIndex the column index (1, 2, ...)
* @param type the class of the returned value
* @param type the class of the returned value
*/
*/
/*## Java 1.7 ##
@Override
@Override
public <T> T getObject(int columnIndex, Class<T> type) {
public
<
T
>
T
getObject
(
int
columnIndex
,
Class
<
T
>
type
)
throws
SQLException
{
return null
;
throw
unsupported
(
"getObject"
)
;
}
}
//*/
/**
/**
* [Not supported]
* [Not supported]
...
@@ -3698,12 +3695,10 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -3698,12 +3695,10 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param columnName the column name
* @param columnName the column name
* @param type the class of the returned value
* @param type the class of the returned value
*/
*/
/*## Java 1.7 ##
@Override
@Override
public <T> T getObject(String columnName, Class<T> type) {
public
<
T
>
T
getObject
(
String
columnName
,
Class
<
T
>
type
)
throws
SQLException
{
return null
;
throw
unsupported
(
"getObject"
)
;
}
}
//*/
/**
/**
* INTERNAL
* INTERNAL
...
...
h2/src/main/org/h2/jdbc/JdbcResultSetBackwardsCompat.java
0 → 100644
浏览文件 @
b76d9b20
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
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/JdbcStatement.java
浏览文件 @
b76d9b20
...
@@ -23,7 +23,7 @@ import org.h2.util.New;
...
@@ -23,7 +23,7 @@ import org.h2.util.New;
/**
/**
* Represents a statement.
* Represents a statement.
*/
*/
public
class
JdbcStatement
extends
TraceObject
implements
Statement
{
public
class
JdbcStatement
extends
TraceObject
implements
Statement
,
JdbcStatementBackwardsCompat
{
protected
JdbcConnection
conn
;
protected
JdbcConnection
conn
;
protected
SessionInterface
session
;
protected
SessionInterface
session
;
...
@@ -929,22 +929,18 @@ public class JdbcStatement extends TraceObject implements Statement {
...
@@ -929,22 +929,18 @@ public class JdbcStatement extends TraceObject implements Statement {
/**
/**
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
void
closeOnCompletion
()
{
public
void
closeOnCompletion
()
{
// not supported
// not supported
}
}
//*/
/**
/**
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
boolean
isCloseOnCompletion
()
{
public
boolean
isCloseOnCompletion
()
{
return
true
;
return
true
;
}
}
//*/
// =============================================================
// =============================================================
...
...
h2/src/main/org/h2/jdbc/JdbcStatementBackwardsCompat.java
0 → 100644
浏览文件 @
b76d9b20
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
jdbc
;
/**
* Allows us to compile on older platforms, while still implementing the methods from the newer JDBC API.
*/
public
interface
JdbcStatementBackwardsCompat
{
void
closeOnCompletion
();
boolean
isCloseOnCompletion
();
}
h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java
浏览文件 @
b76d9b20
...
@@ -23,17 +23,14 @@ import java.io.PrintWriter;
...
@@ -23,17 +23,14 @@ import java.io.PrintWriter;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.logging.Logger
;
import
javax.sql.ConnectionEvent
;
import
javax.sql.ConnectionEvent
;
import
javax.sql.ConnectionEventListener
;
import
javax.sql.ConnectionEventListener
;
import
javax.sql.ConnectionPoolDataSource
;
import
javax.sql.ConnectionPoolDataSource
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
import
javax.sql.PooledConnection
;
import
javax.sql.PooledConnection
;
import
org.h2.util.New
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.util.New
;
/*## Java 1.7 ##
import java.util.logging.Logger;
//*/
/**
/**
* A simple standalone JDBC connection pool.
* A simple standalone JDBC connection pool.
...
@@ -62,7 +59,7 @@ import java.util.logging.Logger;
...
@@ -62,7 +59,7 @@ import java.util.logging.Logger;
* (<a href="http://www.source-code.biz">www.source-code.biz</a>)
* (<a href="http://www.source-code.biz">www.source-code.biz</a>)
* @author Thomas Mueller
* @author Thomas Mueller
*/
*/
public
class
JdbcConnectionPool
implements
DataSource
,
ConnectionEventListener
{
public
class
JdbcConnectionPool
implements
DataSource
,
ConnectionEventListener
,
JdbcConnectionPoolBackwardsCompat
{
private
static
final
int
DEFAULT_TIMEOUT
=
30
;
private
static
final
int
DEFAULT_TIMEOUT
=
30
;
private
static
final
int
DEFAULT_MAX_CONNECTIONS
=
10
;
private
static
final
int
DEFAULT_MAX_CONNECTIONS
=
10
;
...
@@ -333,12 +330,10 @@ public class JdbcConnectionPool implements DataSource, ConnectionEventListener {
...
@@ -333,12 +330,10 @@ public class JdbcConnectionPool implements DataSource, ConnectionEventListener {
/**
/**
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
Logger
getParentLogger
()
{
public
Logger
getParentLogger
()
{
return
null
;
return
null
;
}
}
//*/
}
}
h2/src/main/org/h2/jdbcx/JdbcConnectionPoolBackwardsCompat.java
0 → 100644
浏览文件 @
b76d9b20
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
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/JdbcDataSource.java
浏览文件 @
b76d9b20
...
@@ -12,6 +12,7 @@ import java.io.Serializable;
...
@@ -12,6 +12,7 @@ import java.io.Serializable;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.logging.Logger
;
import
javax.naming.Reference
;
import
javax.naming.Reference
;
import
javax.naming.Referenceable
;
import
javax.naming.Referenceable
;
import
javax.naming.StringRefAddr
;
import
javax.naming.StringRefAddr
;
...
@@ -25,10 +26,6 @@ import org.h2.jdbc.JdbcConnection;
...
@@ -25,10 +26,6 @@ import org.h2.jdbc.JdbcConnection;
import
org.h2.message.TraceObject
;
import
org.h2.message.TraceObject
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
/*## Java 1.7 ##
import java.util.logging.Logger;
//*/
/**
/**
* A data source for H2 database connections. It is a factory for XAConnection
* A data source for H2 database connections. It is a factory for XAConnection
* and Connection objects. This class is usually registered in a JNDI naming
* and Connection objects. This class is usually registered in a JNDI naming
...
@@ -63,7 +60,7 @@ import java.util.logging.Logger;
...
@@ -63,7 +60,7 @@ import java.util.logging.Logger;
* well; this may be a security problem in some cases.
* well; this may be a security problem in some cases.
*/
*/
public
class
JdbcDataSource
extends
TraceObject
implements
XADataSource
,
public
class
JdbcDataSource
extends
TraceObject
implements
XADataSource
,
DataSource
,
ConnectionPoolDataSource
,
Serializable
,
Referenceable
{
DataSource
,
ConnectionPoolDataSource
,
Serializable
,
Referenceable
,
JdbcDataSourceBackwardsCompat
{
private
static
final
long
serialVersionUID
=
1288136338451857771L
;
private
static
final
long
serialVersionUID
=
1288136338451857771L
;
...
@@ -425,12 +422,10 @@ public class JdbcDataSource extends TraceObject implements XADataSource,
...
@@ -425,12 +422,10 @@ public class JdbcDataSource extends TraceObject implements XADataSource,
/**
/**
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
@Override
@Override
public
Logger
getParentLogger
()
{
public
Logger
getParentLogger
()
{
return
null
;
return
null
;
}
}
//*/
/**
/**
* INTERNAL
* INTERNAL
...
...
h2/src/main/org/h2/jdbcx/JdbcDataSourceBackwardsCompat.java
0 → 100644
浏览文件 @
b76d9b20
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
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/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
b76d9b20
...
@@ -28,8 +28,8 @@ import java.sql.Types;
...
@@ -28,8 +28,8 @@ import java.sql.Types;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Map
;
import
java.util.Map
;
import
org.h2.api.ErrorCode
;
import
org.h2.api.ErrorCode
;
import
org.h2.jdbc.JdbcResultSetBackwardsCompat
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.MathUtils
;
import
org.h2.util.MathUtils
;
...
@@ -54,7 +54,7 @@ import org.h2.value.DataType;
...
@@ -54,7 +54,7 @@ import org.h2.value.DataType;
* </pre>
* </pre>
*
*
*/
*/
public
class
SimpleResultSet
implements
ResultSet
,
ResultSetMetaData
{
public
class
SimpleResultSet
implements
ResultSet
,
ResultSetMetaData
,
JdbcResultSetBackwardsCompat
{
private
ArrayList
<
Object
[]>
rows
;
private
ArrayList
<
Object
[]>
rows
;
private
Object
[]
currentRow
;
private
Object
[]
currentRow
;
...
@@ -391,6 +391,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -391,6 +391,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/**
/**
* @deprecated INTERNAL
* @deprecated INTERNAL
*/
*/
@Deprecated
@Override
@Override
public
BigDecimal
getBigDecimal
(
int
columnIndex
,
int
scale
)
public
BigDecimal
getBigDecimal
(
int
columnIndex
,
int
scale
)
throws
SQLException
{
throws
SQLException
{
...
@@ -400,6 +401,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -400,6 +401,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/**
/**
* @deprecated INTERNAL
* @deprecated INTERNAL
*/
*/
@Deprecated
@Override
@Override
public
BigDecimal
getBigDecimal
(
String
columnLabel
,
int
scale
)
public
BigDecimal
getBigDecimal
(
String
columnLabel
,
int
scale
)
throws
SQLException
{
throws
SQLException
{
...
@@ -821,12 +823,10 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -821,12 +823,10 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
* @param columnIndex the column index (1, 2, ...)
* @param columnIndex the column index (1, 2, ...)
* @param type the class of the returned value
* @param type the class of the returned value
*/
*/
/*## Java 1.7 ##
@Override
@Override
public <T> T getObject(int columnIndex, Class<T> type) {
public
<
T
>
T
getObject
(
int
columnIndex
,
Class
<
T
>
type
)
throws
SQLException
{
return null
;
throw
getUnsupportedException
()
;
}
}
//*/
/**
/**
* INTERNAL
* INTERNAL
...
@@ -834,12 +834,10 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -834,12 +834,10 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
* @param columnName the column name
* @param columnName the column name
* @param type the class of the returned value
* @param type the class of the returned value
*/
*/
/*## Java 1.7 ##
@Override
@Override
public <T> T getObject(String columnName, Class<T> type) {
public
<
T
>
T
getObject
(
String
columnName
,
Class
<
T
>
type
)
throws
SQLException
{
return null
;
throw
getUnsupportedException
()
;
}
}
//*/
/**
/**
* INTERNAL
* INTERNAL
...
@@ -1045,6 +1043,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -1045,6 +1043,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/**
/**
* @deprecated INTERNAL
* @deprecated INTERNAL
*/
*/
@Deprecated
@Override
@Override
public
InputStream
getUnicodeStream
(
int
columnIndex
)
throws
SQLException
{
public
InputStream
getUnicodeStream
(
int
columnIndex
)
throws
SQLException
{
throw
getUnsupportedException
();
throw
getUnsupportedException
();
...
@@ -1053,6 +1052,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -1053,6 +1052,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/**
/**
* @deprecated INTERNAL
* @deprecated INTERNAL
*/
*/
@Deprecated
@Override
@Override
public
InputStream
getUnicodeStream
(
String
columnLabel
)
throws
SQLException
{
public
InputStream
getUnicodeStream
(
String
columnLabel
)
throws
SQLException
{
throw
getUnsupportedException
();
throw
getUnsupportedException
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论