提交 ffc2de54 authored 作者: noelgrandin's avatar noelgrandin

Support the JDBC DatabaseMetaData#getClientInfoProperties() method, in the sense…

Support the JDBC DatabaseMetaData#getClientInfoProperties() method, in the sense of returning an empty result, in order to make Websphere happy.
上级 4d39695f
......@@ -66,6 +66,8 @@ Change Log
</li><li>Query Statistics: new feature which stores the newest 100 SQL queries executed and their performance data.
Useful for tracking down badly performing queries.
</li><li>Fix an LOB deadlock between reading and updating LOB columns.
</li><li>Support the JDBC DatabaseMetaData#getClientInfoProperties() method, in the sense of returning an empty result,
in order to make Websphere happy.
</li></ul>
<h2>Version 1.3.173 (2013-07-28)</h2>
......
......@@ -16,6 +16,7 @@ import org.h2.constant.SysProperties;
import org.h2.engine.Constants;
import org.h2.message.Trace;
import org.h2.message.TraceObject;
import org.h2.tools.SimpleResultSet;
import org.h2.util.StatementBuilder;
import org.h2.util.StringUtils;
......@@ -3054,7 +3055,8 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
*/
@Override
public ResultSet getClientInfoProperties() throws SQLException {
throw unsupported("clientInfoProperties");
// we don't have any client properties, so return an empty result set
return new SimpleResultSet();
}
/**
......
......@@ -11,6 +11,7 @@ import java.sql.DatabaseMetaData;
import java.sql.Driver;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLClientInfoException;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
......@@ -50,6 +51,7 @@ public class TestMetaData extends TestBase {
testStatic();
testGeneral();
testAllowLiteralsNone();
testClientInfo();
testSessionsUncommitted();
testQueryStatistics();
}
......@@ -975,6 +977,17 @@ public class TestMetaData extends TestBase {
deleteDb("metaData");
}
private void testClientInfo() throws SQLException {
Connection conn = getConnection("metaData");
assertNull(conn.getClientInfo());
assertThrows(SQLClientInfoException.class, conn).getClientInfo("xxx");
DatabaseMetaData meta = conn.getMetaData();
ResultSet rs = meta.getClientInfoProperties();
assertFalse(rs.next());
conn.close();
deleteDb("metaData");
}
private void testSessionsUncommitted() throws SQLException {
if (config.mvcc || config.memory) {
return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论