提交 7430fb79 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 5a766521
......@@ -37,7 +37,12 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>Version 1.0 (Current)</h3>
<h3>Version 1.0 / TODO (Build TODO)</h3><ul>
<li>PreparedStatement.getMetaData is now implemented.
<li>If large result sets (backed by a temporary file) where not closed, the file was not deleted.
Now, the default result set type is FETCH_FORWARD. This means temp files are deleted
automatically (without having to close the result set explicitly). But it also means
ResultSet.beforeFirst can only be called for scrollable result sets. To create a scrollable resut set,
use Statement stat = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY).
</li><li>PreparedStatement.getMetaData is now implemented.
</li><li>Now PreparedStatement.setBigDecimal(..) can be called with an object of a derived class
if the system property h2.allowBigDecimalExtensions is set to true.
</li><li>The default database name in the documentation is now jdbc:h2:~/test. Like this, the database
......
......@@ -117,8 +117,7 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
to get informed about new releases.
Your email address is only used in this context.<br />
If you don't want a Google account, there is a manually maintained list as well: <br />
Email: <input type="email" name="email" size="30" onKeyDown="newsletter.spam.value='false';"/>
<input type="hidden" name="spam" value="true" size="30"/>
Email: <input type="email" name="email" size="30"/>
<input type="hidden" name="text" value="subscribe"/>
<input type="submit" value="Submit"/>
</form>
......
......@@ -3,15 +3,14 @@ Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http:/
Initial Developer: H2 Group
-->
<?
$spam2 = ("false" == $spam) ? "" : "SPAM";
$now = date('Y-m-d H:i:s');
$body = "Email: $email
Message:
$text
";
$headers = 'From: newsletter@h2database.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail("dbsupport@h2database.com", "[H2 Newsletter] $now $spam2", $body, $headers);
'X-Mailer: PHP/' . phpversion();S
mail("dbsupport@h2database.com", "[H2 Newsletter] $now", $body, $headers);
?>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
H2 Database
......
......@@ -3,7 +3,6 @@ Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http:/
Initial Developer: H2 Group
-->
<?
$spam2 = ("false" == $spam) ? "" : "SPAM";
$now = date('Y-m-d H:i:s');
$body = "Email: $email
Message:
......@@ -12,7 +11,7 @@ $text
$headers = 'From: feedback@h2database.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$headers =
mail("dbsupport@h2database.com", "[H2 Feedback] $now $spam2", $body, $headers);
mail("dbsupport@h2database.com", "[H2 Feedback] $now", $body, $headers);
?>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
H2 Database
......
......@@ -103,10 +103,6 @@ public class Constants {
public static final int IO_BUFFER_SIZE = 4 * 1024;
public static final int IO_BUFFER_SIZE_COMPRESS = 128 * 1024;
public static final int DEFAULT_CACHE_SIZE = 1 << 16;
public static final int CACHE_SIZE_INDEX_SHIFT = 3;
public static final int DEFAULT_CACHE_SIZE_INDEX = DEFAULT_CACHE_SIZE >> CACHE_SIZE_INDEX_SHIFT;
public static final int DEFAULT_CACHE_SIZE_LINEAR_INDEX = 1 << 8;
public static final String SUFFIX_DB_FILE = ".db";
......@@ -252,6 +248,9 @@ public class Constants {
public static final boolean INDEX_LOOKUP_NEW = getBooleanSetting("h2.indexLookupNew", true);
public static final boolean TRACE_IO = getBooleanSetting("h2.traceIO", false);
public static final int DATASOURCE_TRACE_LEVEL = getIntSetting("h2.dataSourceTraceLevel", TraceSystem.ERROR);
public static final int CACHE_SIZE_DEFAULT = getIntSetting("h2.cacheSizeDefault", (1 << 16));
public static final int CACHE_SIZE_INDEX_SHIFT = getIntSetting("h2.cacheSizeIndexShift", 3);
public static final int CACHE_SIZE_INDEX_DEFAULT = CACHE_SIZE_DEFAULT >> CACHE_SIZE_INDEX_SHIFT;
public static boolean getBooleanSetting(String name, boolean defaultValue) {
String s = System.getProperty(name);
......
......@@ -312,11 +312,11 @@ public class Database implements DataHandler {
}
private void openFileData() throws SQLException {
fileData = new DiskFile(this, databaseName+Constants.SUFFIX_DATA_FILE, accessModeData, true, true, Constants.DEFAULT_CACHE_SIZE);
fileData = new DiskFile(this, databaseName+Constants.SUFFIX_DATA_FILE, accessModeData, true, true, Constants.CACHE_SIZE_DEFAULT);
}
private void openFileIndex() throws SQLException {
fileIndex = new DiskFile(this, databaseName+Constants.SUFFIX_INDEX_FILE, accessModeData, false, logIndexChanges, Constants.DEFAULT_CACHE_SIZE_INDEX);
fileIndex = new DiskFile(this, databaseName+Constants.SUFFIX_INDEX_FILE, accessModeData, false, logIndexChanges, Constants.CACHE_SIZE_INDEX_DEFAULT);
}
public DataPage getDataPage() {
......@@ -519,7 +519,7 @@ public class Database implements DataHandler {
addDefaultSetting(SetTypes.DEFAULT_TABLE_TYPE, null, Constants.DEFAULT_TABLE_TYPE);
addDefaultSetting(SetTypes.TRACE_LEVEL_FILE, null, traceSystem.getLevelFile());
addDefaultSetting(SetTypes.TRACE_LEVEL_SYSTEM_OUT, null, traceSystem.getLevelSystemOut());
addDefaultSetting(SetTypes.CACHE_SIZE, null, Constants.DEFAULT_CACHE_SIZE);
addDefaultSetting(SetTypes.CACHE_SIZE, null, Constants.CACHE_SIZE_DEFAULT);
addDefaultSetting(SetTypes.CLUSTER, Constants.CLUSTERING_DISABLED, 0);
addDefaultSetting(SetTypes.WRITE_DELAY, null, Constants.DEFAULT_WRITE_DELAY);
removeUnusedStorages();
......
......@@ -1233,7 +1233,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id);
debugCodeCall("executeQuery", "CALL IDENTITY()");
}
ResultSet rs = new JdbcResultSet(session, this, statement, result, id, false);
ResultSet rs = new JdbcResultSet(session, this, statement, result, id, false, true);
return rs;
}
......
......@@ -82,16 +82,16 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed();
closeOld();
ResultInterface result;
boolean scrollable = resultSetType != ResultSet.TYPE_FORWARD_ONLY;
synchronized(session) {
try {
setExecutingStatement(command);
boolean scrollable = resultSetType != ResultSet.TYPE_FORWARD_ONLY;
result = command.executeQuery(maxRows, scrollable);
} finally {
setExecutingStatement(null);
}
}
resultSet = new JdbcResultSet(session, conn, this, result, id, closedByResultSet);
resultSet = new JdbcResultSet(session, conn, this, result, id, closedByResultSet, scrollable);
return resultSet;
} catch(Throwable e) {
throw logAndConvert(e);
......@@ -155,7 +155,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
returnsResultSet = true;
boolean scrollable = resultSetType != ResultSet.TYPE_FORWARD_ONLY;
ResultInterface result = command.executeQuery(maxRows, scrollable);
resultSet = new JdbcResultSet(session, conn, this, result, id, closedByResultSet);
resultSet = new JdbcResultSet(session, conn, this, result, id, closedByResultSet, scrollable);
} else {
returnsResultSet = false;
updateCount = command.executeUpdate();
......
......@@ -46,7 +46,9 @@ import org.h2.value.ValueTimestamp;
* and if it contains all columns of a unique index (primary key or other) of this table.
*/
public class JdbcResultSet extends TraceObject implements ResultSet {
private SessionInterface session;
private final SessionInterface session;
private final boolean closeStatement;
private final boolean scrollable;
private ResultInterface result;
private JdbcConnection conn;
private JdbcStatement stat;
......@@ -54,7 +56,17 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
private boolean wasNull;
private Value[] insertRow;
private Value[] updateRow;
private boolean closeStatement;
JdbcResultSet(SessionInterface session, JdbcConnection conn, JdbcStatement stat, ResultInterface result, int id, boolean closeStatement, boolean scrollable) {
setTrace(session.getTrace(), TraceObject.RESULT_SET, id);
this.session = session;
this.conn = conn;
this.stat = stat;
this.result = result;
columnCount = result.getVisibleColumnCount();
this.closeStatement = closeStatement;
this.scrollable = scrollable;
}
/**
* Moves the cursor to the next row of the result set.
......@@ -65,7 +77,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try {
debugCodeCall("next");
checkClosed();
return result.next();
return nextRow();
} catch(Throwable e) {
throw logAndConvert(e);
}
......@@ -2481,7 +2493,9 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try {
debugCodeCall("beforeFirst");
checkClosed();
result.reset();
if(result.getRowId() >= 0) {
resetResult();
}
} catch(Throwable e) {
throw logAndConvert(e);
}
......@@ -2496,7 +2510,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try {
debugCodeCall("afterLast");
checkClosed();
while (result.next()) {
while (nextRow()) {
// nothing
}
} catch(Throwable e) {
......@@ -2514,8 +2528,12 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try {
debugCodeCall("first");
checkClosed();
result.reset();
return result.next();
if(result.getRowId() < 0) {
return nextRow();
} else {
resetResult();
return nextRow();
}
} catch(Throwable e) {
throw logAndConvert(e);
}
......@@ -2555,14 +2573,11 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
} else if (rowNumber > result.getRowCount() + 1) {
rowNumber = result.getRowCount() + 1;
}
// if (rowNumber == 0) {
// throw Message.getInvalidValueException("" + rowNumber, "rowNumber");
// } else
if (rowNumber <= result.getRowId()) {
result.reset();
resetResult();
}
while (result.getRowId() + 1 < rowNumber) {
result.next();
nextRow();
}
int row = result.getRowId();
return row >= 0 && row < result.getRowCount();
......@@ -2786,16 +2801,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
// =============================================================
JdbcResultSet(SessionInterface session, JdbcConnection conn, JdbcStatement stat, ResultInterface result, int id, boolean closeStatement) {
setTrace(session.getTrace(), TraceObject.RESULT_SET, id);
this.session = session;
this.conn = conn;
this.stat = stat;
this.result = result;
columnCount = result.getVisibleColumnCount();
this.closeStatement = closeStatement;
}
private UpdatableRow getUpdatableRow() throws SQLException {
UpdatableRow row = new UpdatableRow(conn, result, session);
if(!row.isUpdatable()) {
......@@ -2893,6 +2898,21 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
JdbcConnection getConnection() {
return conn;
}
private boolean nextRow() throws SQLException {
boolean next = result.next();
if(!next && !scrollable) {
result.close();
}
return next;
}
private void resetResult() throws SQLException {
if(!scrollable) {
throw Message.getSQLException(Message.RESULT_SET_NOT_SCROLLABLE);
}
result.reset();
}
/**
* [Not supported] Returns the value of the specified column as a row id.
......
......@@ -60,17 +60,17 @@ public class JdbcStatement extends TraceObject implements Statement {
}
CommandInterface command=conn.prepareCommand(sql);
ResultInterface result;
boolean scrollable = resultSetType != ResultSet.TYPE_FORWARD_ONLY;
synchronized(session) {
setExecutingStatement(command);
try {
boolean scrollable = resultSetType != ResultSet.TYPE_FORWARD_ONLY;
result = command.executeQuery(maxRows, scrollable);
} finally {
setExecutingStatement(null);
}
}
command.close();
resultSet = new JdbcResultSet(session, conn, this, result, id, closedByResultSet);
resultSet = new JdbcResultSet(session, conn, this, result, id, closedByResultSet, scrollable);
return resultSet;
} catch(Throwable e) {
throw logAndConvert(e);
......@@ -149,7 +149,7 @@ public class JdbcStatement extends TraceObject implements Statement {
returnsResultSet = true;
boolean scrollable = resultSetType != ResultSet.TYPE_FORWARD_ONLY;
ResultInterface result = command.executeQuery(maxRows, scrollable);
resultSet = new JdbcResultSet(session, conn, this, result, id, closedByResultSet);
resultSet = new JdbcResultSet(session, conn, this, result, id, closedByResultSet, scrollable);
} else {
returnsResultSet = false;
updateCount = command.executeUpdate();
......
......@@ -330,6 +330,7 @@ public class Message {
public static final int INVALID_CLASS_2 = 90125;
public static final int DATABASE_IS_NOT_PERSISTENT = 90126;
public static final int RESULT_SET_NOT_UPDATABLE = 90127;
public static final int RESULT_SET_NOT_SCROLLABLE = 90128;
public static SQLException addSQL(SQLException e, String sql) {
if(e instanceof JdbcSQLException) {
......
......@@ -150,6 +150,7 @@
90125=Invalid class, expected {0} but got {1}
90126=Database is not persistent
90127=The result set is not updatable. The query must select all columns from a unique key. Only one table may be selected.
90128=The result set is not scrollable and can not be reset. You may need to use conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY).
HY000=General error: {0}
HY004=Unknown data type: {0}
......
......@@ -16,10 +16,10 @@ import org.h2.message.Message;
public class Cache2Q implements Cache {
public static final String TYPE_NAME = "TQ";
private static final int MAIN = 1, IN = 2, OUT = 3;
private final CacheWriter writer;
private int maxSize;
private CacheWriter writer;
private int percentIn = 20, percentOut = 50;
private int maxMain, maxIn, maxOut;
private CacheObject headMain = new CacheHead();
......@@ -32,10 +32,14 @@ public class Cache2Q implements Cache {
public Cache2Q(CacheWriter writer, int maxSize) {
this.writer = writer;
this.maxSize = maxSize;
this.len = maxSize / 2;
MathUtils.checkPowerOf2(len);
resize(maxSize);
}
private void resize(int maxSize) {
this.maxSize = maxSize;
this.len = MathUtils.nextPowerOf2(maxSize / 2);
this.mask = len - 1;
MathUtils.checkPowerOf2(len);
clear();
}
......@@ -306,6 +310,7 @@ public class Cache2Q implements Cache {
public void setMaxSize(int newSize) throws SQLException {
maxSize = newSize < 0 ? 0 : newSize;
recalculateMax();
// resize(maxSize);
removeOld();
}
......
......@@ -19,21 +19,25 @@ public class CacheLRU implements Cache {
public static final String TYPE_NAME = "LRU";
private final CacheWriter writer;
private int len;
private int maxSize;
private CacheObject[] values;
private int mask;
private CacheWriter writer;
private int sizeRecords;
private int sizeBlocks;
private CacheObject head = new CacheHead();
public CacheLRU(CacheWriter writer, int maxSize) {
this.writer = writer;
this.len = maxSize / 2;
resize(maxSize);
}
private void resize(int maxSize) {
this.maxSize = maxSize;
this.len = MathUtils.nextPowerOf2(maxSize / 2);
this.mask = len - 1;
MathUtils.checkPowerOf2(len);
this.maxSize = maxSize;
clear();
}
......@@ -242,7 +246,9 @@ public class CacheLRU implements Cache {
}
public void setMaxSize(int newSize) throws SQLException {
maxSize = newSize < 0 ? 0 : newSize;
newSize = newSize < 0 ? 0 : newSize;
// can not resize, otherwise
// resize(maxSize);
removeOld();
}
......
......@@ -243,7 +243,7 @@ public class FileUtils {
for(int i=0; i<Constants.MAX_FILE_RETRY; i++) {
trace("delete", fileName, null);
if(fileName.indexOf("1459.146") >= 0) {
new Error(fileName).printStackTrace();
new Error(fileName).printStackTrace();
}
boolean ok = file.delete();
if(ok) {
......
......@@ -26,6 +26,14 @@ public class MathUtils {
}
}
public static int nextPowerOf2(int x) {
int i = 1;
while(i < x && i < (Integer.MAX_VALUE/2)) {
i += i;
}
return (int) i;
}
public static long scaleUp50Percent(long start, long min, long blockSize) {
while(start < min) {
start += start / 2;
......
......@@ -48,15 +48,15 @@ public class ObjectArray {
}
public void add(Object value) {
if(size >= data.length) {
ensureCapacity(size);
}
if(size >= data.length) {
ensureCapacity(size);
}
data[size++] = value;
}
public Object get(int i) {
if (Constants.CHECK && i >= size) {
throwException(i);
throwException(i);
}
return data[i];
}
......@@ -64,7 +64,7 @@ public class ObjectArray {
public Object remove(int i) {
// TODO performance: the app should (where possible) remove from end to start, to avoid O(n^2)
if (Constants.CHECK && i >= size) {
throwException(i);
throwException(i);
}
Object value = data[i];
System.arraycopy(data, i + 1, data, i, size - i - 1);
......@@ -100,7 +100,7 @@ public class ObjectArray {
public void add(int i, Object value) {
if (Constants.CHECK && i > size) {
throwException(i);
throwException(i);
}
ensureCapacity(size);
if (i == size) {
......@@ -114,7 +114,7 @@ public class ObjectArray {
public void set(int i, Object value) {
if (Constants.CHECK && i >= size) {
throwException(i);
throwException(i);
}
data[i] = value;
}
......
......@@ -18,7 +18,7 @@ public class TempFileDeleter {
private static HashMap refMap = new HashMap();
public static synchronized Reference addFile(String fileName, Object file) {
FileUtils.trace("TempFileDeleter.addFile", fileName, file);
FileUtils.trace("TempFileDeleter.addFile", fileName, file);
PhantomReference ref = new PhantomReference(file, queue);
refMap.put(ref, fileName);
deleteUnused();
......@@ -34,7 +34,7 @@ public class TempFileDeleter {
}
if(fileName != null && FileUtils.exists(fileName)) {
try {
FileUtils.trace("TempFileDeleter.deleteFile", fileName, null);
FileUtils.trace("TempFileDeleter.deleteFile", fileName, null);
FileUtils.delete(fileName);
} catch(Exception e) {
// TODO log such errors?
......@@ -54,7 +54,7 @@ public class TempFileDeleter {
}
public static void stopAutoDelete(Reference ref, String fileName) {
FileUtils.trace("TempFileDeleter.stopAutoDelete", fileName, ref);
FileUtils.trace("TempFileDeleter.stopAutoDelete", fileName, ref);
if(ref != null) {
String f2 = (String) refMap.remove(ref);
if(Constants.CHECK && (f2 == null || !f2.equals(fileName))) {
......
......@@ -14,20 +14,22 @@ import org.h2.tools.SimpleResultSet;
public class ValueResultSet extends Value {
private ResultSet result;
private final ResultSet result;
private ValueResultSet(ResultSet rs) {
this.result = rs;
}
public static ValueResultSet get(ResultSet rs) throws SQLException {
ValueResultSet val = new ValueResultSet();
val.result = rs;
ValueResultSet val = new ValueResultSet(rs);
return val;
}
public static ValueResultSet getCopy(ResultSet rs, int maxrows) throws SQLException {
ValueResultSet val = new ValueResultSet();
ResultSetMetaData meta = rs.getMetaData();
int columnCount = meta.getColumnCount();
SimpleResultSet simple = new SimpleResultSet();
val.result = simple;
ValueResultSet val = new ValueResultSet(simple);
for(int i=0; i<columnCount; i++) {
String name = meta.getColumnLabel(i+1);
int sqlType = meta.getColumnType(i+1);
......
......@@ -94,12 +94,11 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
/*
ResultSet.close() required for large query (before the database can be deleted, even if conn.close is called)?
make sure INDEX_LOOKUP_NEW = is true by default.
Test Console (batch, javaw, different platforms)
test with openoffice (metadata changes)
set read-committed as the default
testHalt
......@@ -111,8 +110,6 @@ timer test
backup.sql / lob file problem
Change documentation and default database for H2 Console: jdbc:h2:~/test
Mail http://sf.net/projects/samooha
java.lang.Exception: query was too quick; result: 0 time:968
......@@ -173,6 +170,8 @@ CREATE TABLE TEST( ID BIGINT PRIMARY KEY, CREATED TIMESTAMP);
INSERT INTO TEST VALUES(1, '2007-01-01 00:00:00');
SELECT * FROM TEST;
Cache size in KB
*/
/*
......
......@@ -5,7 +5,9 @@
package org.h2.test.db;
import java.sql.*;
import java.util.ArrayList;
import org.h2.store.FileLister;
import org.h2.test.TestBase;
public class TestBigResult extends TestBase {
......@@ -13,11 +15,30 @@ public class TestBigResult extends TestBase {
if(config.memory) {
return;
}
testCloseConnectionDelete();
testOrderGroup();
testLimitBufferedResult();
}
private void testLimitBufferedResult() throws Exception {
private void testCloseConnectionDelete() throws Exception {
deleteDb("bigResult");
Connection conn = getConnection("bigResult");
Statement stat = conn.createStatement();
stat.execute("SET MAX_MEMORY_ROWS 2");
ResultSet rs = stat.executeQuery("SELECT * FROM SYSTEM_RANGE(1, 100)");
while(rs.next()) {
// ignore
}
// rs.close();
conn.close();
deleteDb("bigResult");
ArrayList files = FileLister.getDatabaseFiles(BASE_DIR, "bigResult", true);
if(files.size() > 0) {
error("file not deleted: " + files.get(0));
}
}
private void testLimitBufferedResult() throws Exception {
deleteDb("bigResult");
Connection conn = getConnection("bigResult");
Statement stat = conn.createStatement();
......
......@@ -188,7 +188,8 @@ public class TestFunctions extends TestBase {
}
public static ResultSet select(Connection conn, String sql) throws SQLException {
return conn.createStatement().executeQuery(sql);
Statement stat = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
return stat.executeQuery(sql);
}
public static ResultSet selectMaxId(Connection conn) throws SQLException {
......
......@@ -35,23 +35,23 @@ public class TestLob extends TestBase {
if(config.memory) {
return;
}
// testLobNoClose();
// testLobTransactions(10);
testLobNoClose();
testLobTransactions(10);
testLobTransactions(10000);
// testLobRollbackStop();
// testLobCopy();
// testLobHibernate();
// testLobCopy(false);
// testLobCopy(true);
// testLobCompression(false);
// testLobCompression(true);
// testManyLobs();
// testClob();
// testUpdateLob();
// testLobReconnect();
// testLob(false);
// testLob(true);
// testJavaObject();
testLobRollbackStop();
testLobCopy();
testLobHibernate();
testLobCopy(false);
testLobCopy(true);
testLobCompression(false);
testLobCompression(true);
testManyLobs();
testClob();
testUpdateLob();
testLobReconnect();
testLob(false);
testLob(true);
testJavaObject();
}
private void testLobNoClose() throws Exception {
......@@ -90,8 +90,7 @@ public class TestLob extends TestBase {
if(config.logMode == 0) {
return;
}
int testing;
Constants.LOB_CLOSE_BETWEEN_READS = true;
// Constants.LOB_CLOSE_BETWEEN_READS = true;
deleteDb("lob");
Connection conn = reconnect(null);
......
......@@ -22,7 +22,7 @@ public class TestUpdatableResultSet extends TestBase {
private void testScroll() throws Exception {
deleteDb("updatableResultSet");
Connection conn = getConnection("updatableResultSet");
Statement stat = conn.createStatement();
Statement stat = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
stat.execute("CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR)");
stat.execute("INSERT INTO TEST VALUES(1, 'Hello'), (2, 'World'), (3, 'Test')");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论