Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d4362134
提交
d4362134
authored
2月 25, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The database can now be compiled with Java 7.
上级
daa2d409
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
236 行增加
和
10 行删除
+236
-10
changelog.html
h2/src/docsrc/html/changelog.html
+6
-3
Driver.java
h2/src/main/org/h2/Driver.java
+13
-0
JdbcCallableStatement.java
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
+24
-0
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+56
-0
JdbcDatabaseMetaData.java
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
+32
-5
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+24
-0
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+18
-0
JdbcConnectionPool.java
h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java
+14
-0
JdbcDataSource.java
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
+13
-0
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+24
-0
TestMetaData.java
h2/src/test/org/h2/test/jdbc/TestMetaData.java
+1
-1
SwitchSource.java
h2/src/tools/org/h2/build/code/SwitchSource.java
+11
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
d4362134
...
...
@@ -18,14 +18,17 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Issue 289: Railroads (BNF) for "Column Definition" was incorrect.
<ul><li>
The database can now be compiled with Java 7.
Stub methods for the new JDBC 4.1 methods have been implemented,
but the new features can't be used yet.
</li><li>
Issue 289: Railroads (BNF) for "Column Definition" was incorrect.
</li><li>
Issue 287: Railroads (BNF) is not readable for certain web-browser configurations (dark background).
</li><li>
Executing a CSVREAD query multiple times could result in an exception if the data was changed on disk.
</li><li>
SQL railroad diagrams: improved images for people with black background settings.
</li><li>
Build-in documentation search: improved results if searching for multiple words.
</li><li>
DatabaseMetaData.getColumns: there is a typo in the JDBC specification, so that the column #19 is named
SCOPE_CATLOG instead of SCOPE_CATALOG. For compatibility with the specification,
this column is now also
named SCOPE_CATLOG i
n H2. A new column named SCOPE_CATALOG is appended as column #24
.
SCOPE_CATLOG instead of SCOPE_CATALOG. For compatibility with the specification,
a new column #24
named SCOPE_CATLOG i
s added. This typo is fixed in the JDBC 4.1 specification
.
Please note that MySQL only supports SCOPE_CATALOG, while other databases only support SCOPE_CATLOG.
</li><li>
Build: jar files are now downloaded using Maven if possible (and cached in the local Maven repository).
Unfortunately, in many cases this will download more data from the Maven repository.
...
...
h2/src/main/org/h2/Driver.java
浏览文件 @
d4362134
...
...
@@ -17,6 +17,10 @@ import org.h2.message.DbException;
import
org.h2.message.TraceSystem
;
import
org.h2.upgrade.DbUpgrade
;
/*## Java 1.7 begin ##
import java.util.logging.Logger;
## Java 1.7 end ##*/
/**
* 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
...
...
@@ -131,6 +135,15 @@ public class Driver implements java.sql.Driver {
return
true
;
}
/**
* [Not supported]
*/
/*## Java 1.7 begin ##
public Logger getParentLogger() {
return null;
}
## Java 1.7 end ##*/
/**
* INTERNAL
*/
...
...
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
浏览文件 @
d4362134
...
...
@@ -1478,6 +1478,30 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
}
//## Java 1.6 end ##
/**
* [Not supported]
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param type the class of the returned value
*/
/*## Java 1.7 begin ##
public <T> T getObject(int parameterIndex, Class<T> type) {
return null;
}
## Java 1.7 end ##*/
/**
* [Not supported]
*
* @param parameterName the parameter name
* @param type the class of the returned value
*/
/*## Java 1.7 begin ##
public <T> T getObject(String parameterName, Class<T> type) {
return null;
}
## Java 1.7 end ##*/
private
ResultSetMetaData
getCheckedMetaData
()
throws
SQLException
{
ResultSetMetaData
meta
=
getMetaData
();
if
(
meta
==
null
)
{
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
d4362134
...
...
@@ -49,6 +49,10 @@ import java.sql.SQLXML;
import
java.sql.SQLClientInfoException
;
//## Java 1.6 end ##
/*## Java 1.7 begin ##
import java.util.concurrent.Executor;
## Java 1.7 end ##*/
/**
* <p>
* Represents a connection (session) to a database.
...
...
@@ -1667,6 +1671,58 @@ public class JdbcConnection extends TraceObject implements Connection {
return
v
;
}
/**
* [Not supported]
*
* @param schema the schema
*/
/*## Java 1.7 begin ##
public void setSchema(String schema) {
// not supported
}
## Java 1.7 end ##*/
/**
* [Not supported]
*/
/*## Java 1.7 begin ##
public String getSchema() {
return null;
}
## Java 1.7 end ##*/
/**
* [Not supported]
*
* @param executor the executor used by this method
*/
/*## Java 1.7 begin ##
public void abort(Executor executor) {
// not supported
}
## Java 1.7 end ##*/
/**
* [Not supported]
*
* @param executor the executor used by this method
* @param milliseconds the TCP connection timeout
*/
/*## Java 1.7 begin ##
public void setNetworkTimeout(Executor executor, int milliseconds) {
// not supported
}
## Java 1.7 end ##*/
/**
* [Not supported]
*/
/*## Java 1.7 begin ##
public int getNetworkTimeout() {
return 0;
}
## Java 1.7 end ##*/
private
static
void
checkMap
(
Map
<
String
,
Class
<?>>
map
)
{
if
(
map
!=
null
&&
map
.
size
()
>
0
)
{
throw
DbException
.
getUnsupportedException
(
"map.size > 0"
);
...
...
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
浏览文件 @
d4362134
...
...
@@ -197,13 +197,13 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* <li>16 CHAR_OCTET_LENGTH (int) unused </li>
* <li>17 ORDINAL_POSITION (int) the column index (1,2,...) </li>
* <li>18 IS_NULLABLE (String) "NO" or "YES" </li>
* <li>19 SCOPE_CATLOG (String) always null
* (the typo is on purpose, for compatibility with the specification)</li>
* <li>19 SCOPE_CATALOG (String) always null </li>
* <li>20 SCOPE_SCHEMA (String) always null </li>
* <li>21 SCOPE_TABLE (String) always null </li>
* <li>22 SOURCE_DATA_TYPE (short) null </li>
* <li>23 IS_AUTOINCREMENT (String) "NO" or "YES" </li>
* <li>24 SCOPE_CATALOG (String) always null </li>
* <li>24 SCOPE_CATLOG (String) always null
* (the typo is on purpose, for compatibility with the JDBC specification prior to 4.1)</li>
* </ul>
*
* @param catalogPattern null (to get all objects) or the catalog name
...
...
@@ -246,12 +246,12 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
"CHARACTER_OCTET_LENGTH CHAR_OCTET_LENGTH, "
+
"ORDINAL_POSITION, "
+
"IS_NULLABLE IS_NULLABLE, "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG, "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CAT
A
LOG, "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_SCHEMA, "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_TABLE, "
+
"SOURCE_DATA_TYPE, "
+
"CASE WHEN SEQUENCE_NAME IS NULL THEN 'NO' ELSE 'YES' END IS_AUTOINCREMENT, "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CAT
A
LOG "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG "
+
"FROM INFORMATION_SCHEMA.COLUMNS "
+
"WHERE TABLE_CATALOG LIKE ? ESCAPE '\\' "
+
"AND TABLE_SCHEMA LIKE ? ESCAPE '\\' "
...
...
@@ -2848,6 +2848,33 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
}
//## Java 1.6 end ##
/**
* [Not supported]
*/
/*## Java 1.7 begin ##
public boolean generatedKeyAlwaysReturned() {
return true;
}
## Java 1.7 end ##*/
/**
* [Not supported]
*
* @param catalog null (to get all objects) or the catalog name
* @param schemaPattern null (to get all objects) or a schema name
* (uppercase for unquoted names)
* @param tableNamePattern null (to get all objects) or a table name
* (uppercase for unquoted names)
* @param columnNamePattern null (to get all objects) or a column name
* (uppercase for unquoted names)
*/
/*## Java 1.7 begin ##
public ResultSet getPseudoColumns(String catalog, String schemaPattern,
String tableNamePattern, String columnNamePattern) {
return null;
}
## Java 1.7 end ##*/
/**
* INTERNAL
*/
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
d4362134
...
...
@@ -3421,6 +3421,30 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
//## Java 1.6 end ##
/**
* [Not supported]
*
* @param columnIndex the column index (1, 2, ...)
* @param type the class of the returned value
*/
/*## Java 1.7 begin ##
public <T> T getObject(int columnIndex, Class<T> type) {
return null;
}
## Java 1.7 end ##*/
/**
* [Not supported]
*
* @param columnName the column name
* @param type the class of the returned value
*/
/*## Java 1.7 begin ##
public <T> T getObject(String columnName, Class<T> type) {
return null;
}
## Java 1.7 end ##*/
/**
* INTERNAL
*/
...
...
h2/src/main/org/h2/jdbc/JdbcStatement.java
浏览文件 @
d4362134
...
...
@@ -870,6 +870,24 @@ public class JdbcStatement extends TraceObject implements Statement {
}
//## Java 1.4 end ##
/**
* [Not supported]
*/
/*## Java 1.7 begin ##
public void closeOnCompletion() {
// not supported
}
## Java 1.7 end ##*/
/**
* [Not supported]
*/
/*## Java 1.7 begin ##
public boolean isCloseOnCompletion() {
return true;
}
## Java 1.7 end ##*/
// =============================================================
/**
...
...
h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java
浏览文件 @
d4362134
...
...
@@ -35,6 +35,10 @@ import javax.sql.PooledConnection;
import
org.h2.message.DbException
;
//## Java 1.6 end ##
/*## Java 1.7 begin ##
import java.util.logging.Logger;
## Java 1.7 end ##*/
/**
* A simple standalone JDBC connection pool.
* It is based on the
...
...
@@ -318,4 +322,14 @@ public class JdbcConnectionPool implements DataSource, ConnectionEventListener {
}
//## Java 1.6 end ##
/**
* [Not supported]
*/
/*## Java 1.7 begin ##
public Logger getParentLogger() {
return null;
}
## Java 1.7 end ##*/
}
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
浏览文件 @
d4362134
...
...
@@ -26,6 +26,10 @@ import org.h2.jdbc.JdbcConnection;
import
org.h2.message.TraceObject
;
import
org.h2.util.StringUtils
;
/*## Java 1.7 begin ##
import java.util.logging.Logger;
## Java 1.7 end ##*/
/**
* 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
...
...
@@ -387,6 +391,15 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
}
//## Java 1.6 end ##
/**
* [Not supported]
*/
/*## Java 1.7 begin ##
public Logger getParentLogger() {
return null;
}
## Java 1.7 end ##*/
/**
* INTERNAL
*/
...
...
h2/src/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
d4362134
...
...
@@ -2123,6 +2123,30 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
}
//## Java 1.6 end ##
/**
* INTERNAL
*
* @param columnIndex the column index (1, 2, ...)
* @param type the class of the returned value
*/
/*## Java 1.7 begin ##
public <T> T getObject(int columnIndex, Class<T> type) {
return null;
}
## Java 1.7 end ##*/
/**
* INTERNAL
*
* @param columnName the column name
* @param type the class of the returned value
*/
/*## Java 1.7 begin ##
public <T> T getObject(String columnName, Class<T> type) {
return null;
}
## Java 1.7 end ##*/
/**
* 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/jdbc/TestMetaData.java
浏览文件 @
d4362134
...
...
@@ -667,7 +667,7 @@ public class TestMetaData extends TestBase {
assertResultSetMeta
(
rs
,
24
,
new
String
[]
{
"TABLE_CAT"
,
"TABLE_SCHEM"
,
"TABLE_NAME"
,
"COLUMN_NAME"
,
"DATA_TYPE"
,
"TYPE_NAME"
,
"COLUMN_SIZE"
,
"BUFFER_LENGTH"
,
"DECIMAL_DIGITS"
,
"NUM_PREC_RADIX"
,
"NULLABLE"
,
"REMARKS"
,
"COLUMN_DEF"
,
"SQL_DATA_TYPE"
,
"SQL_DATETIME_SUB"
,
"CHAR_OCTET_LENGTH"
,
"ORDINAL_POSITION"
,
"IS_NULLABLE"
,
"SCOPE_CAT
LOG"
,
"SCOPE_SCHEMA"
,
"SCOPE_TABLE"
,
"SOURCE_DATA_TYPE"
,
"IS_AUTOINCREMENT"
,
"SCOPE_CATA
LOG"
},
"IS_NULLABLE"
,
"SCOPE_CAT
ALOG"
,
"SCOPE_SCHEMA"
,
"SCOPE_TABLE"
,
"SOURCE_DATA_TYPE"
,
"IS_AUTOINCREMENT"
,
"SCOPE_CAT
LOG"
},
new
int
[]
{
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
...
...
h2/src/tools/org/h2/build/code/SwitchSource.java
浏览文件 @
d4362134
...
...
@@ -63,21 +63,31 @@ public class SwitchSource {
disable
.
add
(
"Java 1.4"
);
disable
.
add
(
"Java 1.5"
);
disable
.
add
(
"Java 1.6"
);
disable
.
add
(
"Java 1.7"
);
}
else
if
(
"1.4"
.
equals
(
version
))
{
disable
.
add
(
"Java 1.3 only"
);
enable
.
add
(
"Java 1.4"
);
disable
.
add
(
"Java 1.5"
);
disable
.
add
(
"Java 1.6"
);
disable
.
add
(
"Java 1.7"
);
}
else
if
(
"1.5"
.
equals
(
version
))
{
disable
.
add
(
"Java 1.3 only"
);
enable
.
add
(
"Java 1.4"
);
enable
.
add
(
"Java 1.5"
);
disable
.
add
(
"Java 1.6"
);
}
else
if
(
version
.
compareTo
(
"1.6"
)
>=
0
)
{
disable
.
add
(
"Java 1.7"
);
}
else
if
(
"1.6"
.
equals
(
version
))
{
disable
.
add
(
"Java 1.3 only"
);
enable
.
add
(
"Java 1.4"
);
enable
.
add
(
"Java 1.5"
);
enable
.
add
(
"Java 1.6"
);
disable
.
add
(
"Java 1.7"
);
}
else
if
(
version
.
compareTo
(
"1.7"
)
>=
0
)
{
disable
.
add
(
"Java 1.3 only"
);
enable
.
add
(
"Java 1.4"
);
enable
.
add
(
"Java 1.5"
);
enable
.
add
(
"Java 1.6"
);
enable
.
add
(
"Java 1.7"
);
}
else
{
throw
new
IllegalArgumentException
(
"version: "
+
version
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论