提交 87f1f35c authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 b6a3142e
...@@ -674,7 +674,7 @@ that means the probability is about 0.000'000'000'06. ...@@ -674,7 +674,7 @@ that means the probability is about 0.000'000'000'06.
<td> <td>
GNU Compiler for Java. GNU Compiler for Java.
<a href="http://gcc.gnu.org/java/">http://gcc.gnu.org/java/</a> and <a href="http://gcc.gnu.org/java/">http://gcc.gnu.org/java/</a> and
<a href="http://javacompiler.mtsystems.ch/">http://javacompiler.mtsystems.ch/</a> <a href="http://nativej.mtsystems.ch">http://nativej.mtsystems.ch/ (not free any more)</a>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -15,9 +15,9 @@ Frequently Asked Questions ...@@ -15,9 +15,9 @@ Frequently Asked Questions
<h3>Are there any known bugs? When is the next release?</h3> <h3>Are there any known bugs? When is the next release?</h3>
Usually, bugs get fixes as they are found. There is a release every few weeks. Usually, bugs get fixes as they are found. There is a release every few weeks.
The next release is planned for The next release is planned for
2006-12-18. 2007-01-02.
Here is the list of known and confirmed issues as of Here is the list of known and confirmed issues as of
2006-12-03: 2006-12-16:
<ul> <ul>
<li>There are some browser issues with the autocomplete feature. Firefox should work however. <li>There are some browser issues with the autocomplete feature. Firefox should work however.
<li>Some problems have been found with right outer join. Internally, it is converted to left outer join, which <li>Some problems have been found with right outer join. Internally, it is converted to left outer join, which
......
...@@ -222,55 +222,60 @@ Features ...@@ -222,55 +222,60 @@ Features
<table> <table>
<tr><th>Product</th><th>Description</th></tr> <tr><th>Product</th><th>Description</th></tr>
<tr> <tr>
<td><a href="http://jackrabbit.apache.org">Apache Jackrabbit</a></td>
<td>Open source implementation of the Java Content Repository API (JCR).</td>
</tr><tr>
<td><a href="http://incubator.apache.org/openjpa">Apache OpenJPA</a></td>
<td>Open source implementation of the Java Persistence API.</td>
</tr><tr>
<td><a href="http://bmarks-portlet.sourceforge.net">Bookmarks Portlet</a></td>
<td>JSR168 compliant bookmarks management portlet application.</td>
</tr><tr>
<td><a href="http://www.minq.se/products/dbvis">DbVisualizer</a></td>
<td>Database tool.</td>
</tr><tr>
<td><a href="http://executequery.org">Execute Query</a></td>
<td>Database utility written in Java.</td>
</tr><tr>
<td><a href="http://www.goldenstudios.or.id">Golden T Studios</a></td>
<td>Fun-to-play games with a simple interface.</td>
</tr><tr>
<td><a href="http://hibernate.org">Hibernate</a></td> <td><a href="http://hibernate.org">Hibernate</a></td>
<td>Relational Persistence for Idiomatic Java (O-R Mapping Tool)</td> <td>Relational Persistence for Idiomatic Java (O-R Mapping Tool)</td>
</tr><tr>
<td><a href="http://jamwiki.org">JAMWiki</a></td>
<td>Java-based Wiki engine.</td>
</tr><tr> </tr><tr>
<td><a href="http://www.jpox.org">JPOX</a></td> <td><a href="http://www.jpox.org">JPOX</a></td>
<td>Java Persistent Objects</td> <td>Java Persistent Objects</td>
</tr><tr>
<td><a href="http://www.jenkov.com/mrpersister/introduction.tmpl">Mr. Persister</a></td>
<td>Simple, small and fast object relational mapping</td>
</tr><tr> </tr><tr>
<td><a href="http://luntbuild.javaforge.com">Luntbuild</a></td> <td><a href="http://luntbuild.javaforge.com">Luntbuild</a></td>
<td>Build automation and management tool</td> <td>Build automation and management tool</td>
</tr><tr> </tr><tr>
<td><a href="http://squirrelsql.org">SQuirreL SQL Client</a></td> <td><a href="http://www.jenkov.com/mrpersister/introduction.tmpl">Mr. Persister</a></td>
<td>Graphical tool to view the structure of a database, browse the data, issue SQL commands etc.</td> <td>Simple, small and fast object relational mapping</td>
</tr><tr>
<td><a href="http://dbcopyplugin.sf.net">SQuirreL DB Copy Plugin</a></td>
<td>Tool to copy data from one database to another.</td>
</tr><tr>
<td><a href="http://www.minq.se/products/dbvis">DbVisualizer</a></td>
<td>Database tool.</td>
</tr><tr> </tr><tr>
<td><a href="http://www.polepos.org">PolePosition</a></td> <td><a href="http://www.polepos.org">PolePosition</a></td>
<td>Open source database benchmark.</td> <td>Open source database benchmark.</td>
</tr><tr>
<td><a href="http://bmarks-portlet.sourceforge.net">Bookmarks Portlet</a></td>
<td>JSR168 compliant bookmarks management portlet application.</td>
</tr><tr> </tr><tr>
<td><a href="http://www.shellbook.com">Shellbook</a></td> <td><a href="http://www.shellbook.com">Shellbook</a></td>
<td>Desktop Publishing application.</td> <td>Desktop Publishing application.</td>
</tr><tr>
<td><a href="http://www.goldenstudios.or.id">Golden T Studios</a></td>
<td>Fun-to-play games with a simple interface.</td>
</tr><tr>
<td><a href="http://www.webofweb.net">Web of Web</a></td>
<td>Collaborative and realtime interactive media platform for the web.</td>
</tr><tr>
<td><a href="http://jamwiki.org">JAMWiki</a></td>
<td>Java-based Wiki engine.</td>
</tr><tr>
<td><a href="http://executequery.org">Execute Query</a></td>
<td>Database utility written in Java.</td>
</tr><tr> </tr><tr>
<td><a href="http://sql-workbench.net">SQL Workbench/J</a></td> <td><a href="http://sql-workbench.net">SQL Workbench/J</a></td>
<td>Free DBMS-independent SQL Tool.</td> <td>Free DBMS-independent SQL Tool.</td>
</tr><tr>
<td><a href="http://squirrelsql.org">SQuirreL SQL Client</a></td>
<td>Graphical tool to view the structure of a database, browse the data, issue SQL commands etc.</td>
</tr><tr>
<td><a href="http://dbcopyplugin.sf.net">SQuirreL DB Copy Plugin</a></td>
<td>Tool to copy data from one database to another.</td>
</tr><tr> </tr><tr>
<td><a href="http://www.streamcruncher.com">StreamCruncher</a></td> <td><a href="http://www.streamcruncher.com">StreamCruncher</a></td>
<td>Event (Stream) Processing Kernel.</td> <td>Event (Stream) Processing Kernel.</td>
</tr><tr>
<td><a href="http://www.webofweb.net">Web of Web</a></td>
<td>Collaborative and realtime interactive media platform for the web.</td>
</tr> </tr>
</table> </table>
......
...@@ -34,9 +34,13 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch. ...@@ -34,9 +34,13 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>Version 1.0 (Current)</h3> <h3>Version 1.0 (Current)</h3>
<h3>Version 1.0 / 2006-12-..</h3><ul> <h3>Version 1.0 / 2006-12-17</h3><ul>
<li>String.toUpperCase and toLowerCase can not be to processing SQL, as they depend on the current locale. <li>Can be compiled with JDK 1.6. However, only very few of the JDBC 4.0 features are implemented so far.
Now use toUpperCase(Locale.ENGLISH) or Character.toUpperCase(..) <li>The unit test of OpenJPA works now.
<li>Unfortunately, the Hibernate dialect has changed due to a change in the meta data in the last release
(INFORMATION_SCHEMA.SCHEMA).
<li>String.toUpperCase and toLowerCase can not be used to process SQL, as they depend on the current locale.
Now using toUpperCase(Locale.ENGLISH) or Character.toUpperCase(..)
<li>Table aliases are now supported in DELETE and UPDATE. Example: DELETE FROM TEST T0. <li>Table aliases are now supported in DELETE and UPDATE. Example: DELETE FROM TEST T0.
<li>The RunScript tool can now include other files using a new syntax: @INCLUDE fileName. <li>The RunScript tool can now include other files using a new syntax: @INCLUDE fileName.
It was already possible to do that using embedded RUNSCRIPT statements, but not remotely. It was already possible to do that using embedded RUNSCRIPT statements, but not remotely.
......
...@@ -12,6 +12,7 @@ package org.h2.engine; ...@@ -12,6 +12,7 @@ package org.h2.engine;
* *
* Release checklist * Release checklist
* - ant jarClient, check jar file size * - ant jarClient, check jar file size
* - try compiling with JDK 1.3, 1.4, 1.5 and 1.6
* - change FAQ (next release planned, known bugs) * - change FAQ (next release planned, known bugs)
* - check version, change build number in Constants.java and build.xml * - check version, change build number in Constants.java and build.xml
* - check code coverage * - check code coverage
...@@ -53,8 +54,8 @@ package org.h2.engine; ...@@ -53,8 +54,8 @@ package org.h2.engine;
*/ */
public class Constants { public class Constants {
public static final int BUILD_ID = 32; public static final int BUILD_ID = 34;
private static final String BUILD = "2006-12-03"; private static final String BUILD = "2006-12-17";
public static final int VERSION_MAJOR = 1; public static final int VERSION_MAJOR = 1;
public static final int VERSION_MINOR = 0; public static final int VERSION_MINOR = 0;
......
...@@ -150,6 +150,8 @@ int count; ...@@ -150,6 +150,8 @@ int count;
int splitPoint = root.add(row, session); int splitPoint = root.add(row, session);
if (splitPoint != 0) { if (splitPoint != 0) {
SearchRow pivot = root.getData(splitPoint); SearchRow pivot = root.getData(splitPoint);
int test;
// deletePage(session, root);
BtreePage page1 = root; BtreePage page1 = root;
BtreePage page2 = root.split(session, splitPoint); BtreePage page2 = root.split(session, splitPoint);
setRoot(new BtreeNode(this, page1, pivot, page2)); setRoot(new BtreeNode(this, page1, pivot, page2));
......
...@@ -125,10 +125,11 @@ public class BtreeLeaf extends BtreePage { ...@@ -125,10 +125,11 @@ public class BtreeLeaf extends BtreePage {
public BtreePage split(Session session, int splitPoint) throws SQLException { public BtreePage split(Session session, int splitPoint) throws SQLException {
ObjectArray data = new ObjectArray(); ObjectArray data = new ObjectArray();
int max = pageData.size(); int max = pageData.size();
if(Constants.CHECK && !getDeleted()) { int test;
// if(Constants.CHECK && index.getDatabase().getLogIndexChanges() && !getDeleted()) {
// page must have been deleted already before calling getSplitPoint() // page must have been deleted already before calling getSplitPoint()
Message.getInternalError(); // throw Message.getInternalError();
} // }
for (int i = splitPoint; i < max; i++) { for (int i = splitPoint; i < max; i++) {
data.add(getData(splitPoint)); data.add(getData(splitPoint));
pageData.remove(splitPoint); pageData.remove(splitPoint);
......
...@@ -176,10 +176,11 @@ public class BtreeNode extends BtreePage { ...@@ -176,10 +176,11 @@ public class BtreeNode extends BtreePage {
IntArray children = new IntArray(); IntArray children = new IntArray();
splitPoint++; splitPoint++;
int max = pageData.size(); int max = pageData.size();
if(Constants.CHECK && !getDeleted()) { int test;
// if(Constants.CHECK && index.getDatabase().getLogIndexChanges() && !getDeleted()) {
// page must have been deleted already before calling getSplitPoint() // page must have been deleted already before calling getSplitPoint()
Message.getInternalError(); // throw Message.getInternalError();
} // }
for (int i = splitPoint; i < max; i++) { for (int i = splitPoint; i < max; i++) {
data.add(getData(splitPoint)); data.add(getData(splitPoint));
children.add(getChild(splitPoint)); children.add(getChild(splitPoint));
......
...@@ -561,7 +561,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call ...@@ -561,7 +561,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* *
* @throws SQLException Unsupported Feature (SQL State 0A000) * @throws SQLException Unsupported Feature (SQL State 0A000)
*/ */
public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException { public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException {
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
...@@ -957,6 +957,86 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call ...@@ -957,6 +957,86 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setBlob(String parameterName, InputStream x) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setCharacterStream(String parameterName, Reader x) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setCharacterStream(String parameterName, Reader x, long length) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setClob(String parameterName, Reader x) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setNCharacterStream(String parameterName, Reader x) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setNClob(String parameterName, Reader x) throws SQLException {
throw Message.getUnsupportedException();
}
// public void finalize() { // public void finalize() {
// if(!Database.RUN_FINALIZERS) { // if(!Database.RUN_FINALIZERS) {
// return; // return;
......
...@@ -38,6 +38,16 @@ import org.h2.value.ValueInt; ...@@ -38,6 +38,16 @@ import org.h2.value.ValueInt;
import org.h2.value.ValueLob; import org.h2.value.ValueLob;
import org.h2.value.ValueNull; import org.h2.value.ValueNull;
//#ifdef JDK16
/*
import java.sql.Array;
import java.sql.NClob;
import java.sql.Struct;
import java.sql.SQLXML;
import java.sql.SQLClientInfoException;
*/
//#endif
/** /**
* Represents a connection (session) to a database. * Represents a connection (session) to a database.
*/ */
...@@ -943,11 +953,6 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -943,11 +953,6 @@ public class JdbcConnection extends TraceObject implements Connection {
} }
} }
private boolean info() {
// TODO Auto-generated method stub
return false;
}
/** /**
* INTERNAL * INTERNAL
*/ */
...@@ -1294,7 +1299,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1294,7 +1299,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeAssign("NClob", TraceObject.CLOB, id); debugCodeAssign("NClob", TraceObject.CLOB, id);
debugCodeCall("createNClob"); debugCodeCall("createNClob");
checkClosed(); checkClosed();
ValueLob v = session.createClob(new StringReader(""), 0); ValueLob v = ValueLob.createSmallLob(Value.CLOB, new byte[0]);
return new JdbcClob(session, this, v, id); return new JdbcClob(session, this, v, id);
} catch(Throwable e) { } catch(Throwable e) {
throw logAndConvert(e); throw logAndConvert(e);
...@@ -1315,6 +1320,30 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1315,6 +1320,30 @@ public class JdbcConnection extends TraceObject implements Connection {
*/ */
//#endif //#endif
/**
* Create a new empty Array object.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
/**
* Create a new empty Struct object.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
/** /**
* Returns true if this connection is still valid. * Returns true if this connection is still valid.
* *
...@@ -1333,53 +1362,49 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1333,53 +1362,49 @@ public class JdbcConnection extends TraceObject implements Connection {
} }
} }
/**
* Set a client property.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setClientInfo(String name, String value) throws SQLException {
throw Message.getUnsupportedException();
}
/** /**
* Set a client property. * Set a client property.
* @throws SQLException Unsupported Feature (SQL State 0A000) * @throws SQLException Unsupported Feature (SQL State 0A000)
*/ */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public void setClientInfo(Properties properties) throws ClientInfoException { public void setClientInfo(String name, String value) throws SQLClientInfoException {
throw new ClientInfoException(); throw new SQLClientInfoException();
} }
*/ */
//#endif //#endif
/** /**
* Set a client property. * Set the client properties.
* @throws SQLException Unsupported Feature (SQL State 0A000) * @throws SQLException Unsupported Feature (SQL State 0A000)
*/ */
public String getClientInfo(String name) throws SQLException { //#ifdef JDK16
throw Message.getUnsupportedException(); /*
public void setClientInfo(Properties properties) throws SQLClientInfoException {
throw new SQLClientInfoException();
} }
*/
//#endif
/** /**
* Get the client information. * Get the client properties.
* @throws SQLException Unsupported Feature (SQL State 0A000) * @throws SQLException Unsupported Feature (SQL State 0A000)
*/ */
public Properties getClientdebug() throws SQLException { //#ifdef JDK16
throw Message.getUnsupportedException(); /*
public Properties getClientInfo() throws SQLClientInfoException {
throw new SQLClientInfoException();
} }
*/
//#endif
/** /**
* Create a query object * Set a client property.
* @throws SQLException Unsupported Feature (SQL State 0A000) * @throws SQLException Unsupported Feature (SQL State 0A000)
*/ */
//#ifdef JDK16 public String getClientInfo(String name) throws SQLException {
/*
public <T> T createQueryObject(Class<T> ifc) throws SQLException {
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/
//#endif
/** /**
* Return an object of this class if possible. * Return an object of this class if possible.
...@@ -1387,7 +1412,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1387,7 +1412,7 @@ public class JdbcConnection extends TraceObject implements Connection {
*/ */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public Object unwrap(Class<?> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
......
...@@ -2604,6 +2604,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat ...@@ -2604,6 +2604,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* @throws SQLException Unsupported Feature (SQL State 0A000) * @throws SQLException Unsupported Feature (SQL State 0A000)
*/ */
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException { public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
debugCodeCall("getSchemas");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
...@@ -2630,25 +2631,18 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat ...@@ -2630,25 +2631,18 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* @throws SQLException Unsupported Feature (SQL State 0A000) * @throws SQLException Unsupported Feature (SQL State 0A000)
*/ */
public ResultSet getClientInfoProperties() throws SQLException { public ResultSet getClientInfoProperties() throws SQLException {
debugCodeCall("getClientInfoProperties");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
/**
* Returns whether this database provides its own query generator.
* @return false
*/
public boolean providesQueryObjectGenerator() throws SQLException {
debugCodeCall("providesQueryObjectGenerator");
return false;
}
/** /**
* Return an object of this class if possible. * Return an object of this class if possible.
* @throws SQLException Unsupported Feature (SQL State 0A000) * @throws SQLException Unsupported Feature (SQL State 0A000)
*/ */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public Object unwrap(Class<?> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
...@@ -2661,10 +2655,29 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat ...@@ -2661,10 +2655,29 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
//#ifdef JDK16 //#ifdef JDK16
/* /*
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
//#endif //#endif
/**
* Gets the list of function columns.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException {
debugCodeCall("getFunctionColumns");
throw Message.getUnsupportedException();
}
/**
* Gets the list of functions.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public ResultSet getFunctions(String arg0, String arg1, String arg2) throws SQLException {
debugCodeCall("getFunctions");
throw Message.getUnsupportedException();
}
} }
...@@ -189,7 +189,8 @@ implements ParameterMetaData ...@@ -189,7 +189,8 @@ implements ParameterMetaData
*/ */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public Object unwrap(Class<?> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
...@@ -202,6 +203,7 @@ implements ParameterMetaData ...@@ -202,6 +203,7 @@ implements ParameterMetaData
//#ifdef JDK16 //#ifdef JDK16
/* /*
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
......
...@@ -45,6 +45,14 @@ import org.h2.value.ValueString; ...@@ -45,6 +45,14 @@ import org.h2.value.ValueString;
import org.h2.value.ValueTime; import org.h2.value.ValueTime;
import org.h2.value.ValueTimestamp; import org.h2.value.ValueTimestamp;
//#ifdef JDK16
/*
import java.sql.RowId;
import java.sql.NClob;
import java.sql.SQLXML;
*/
//#endif
/** /**
* Represents a prepared statement. * Represents a prepared statement.
* *
...@@ -692,6 +700,26 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -692,6 +700,26 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
} }
} }
/**
* Sets the value of a parameter as a Blob.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @throws SQLException if this object is closed
*/
public void setBlob(int parameterIndex, InputStream x) throws SQLException {
try {
if(debug()) {
debugCode("setBlob("+parameterIndex+", x);");
}
checkClosed();
Value v = conn.createBlob(x, -1);
setParameter(parameterIndex, v);
} catch(Throwable e) {
throw logAndConvert(e);
}
}
/** /**
* Sets the value of a parameter as a Clob. * Sets the value of a parameter as a Clob.
* *
...@@ -717,6 +745,31 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -717,6 +745,31 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
} }
} }
/**
* Sets the value of a parameter as a Clob.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @throws SQLException if this object is closed
*/
public void setClob(int parameterIndex, Reader x) throws SQLException {
try {
if(debug()) {
debugCode("setClob("+parameterIndex+", x);");
}
checkClosed();
Value v;
if(x == null) {
v = ValueNull.INSTANCE;
} else {
v = conn.createClob(x, -1);
}
setParameter(parameterIndex, v);
} catch(Throwable e) {
throw logAndConvert(e);
}
}
/** /**
* Sets the value of a parameter as a Array. * Sets the value of a parameter as a Array.
* *
...@@ -761,7 +814,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -761,7 +814,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @param length the number of bytes * @param length the number of bytes
* @throws SQLException if this object is closed * @throws SQLException if this object is closed
*/ */
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("setBinaryStream("+parameterIndex+", x, "+length+");"); debugCode("setBinaryStream("+parameterIndex+", x, "+length+");");
...@@ -774,6 +827,30 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -774,6 +827,30 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
} }
} }
/**
* Sets the value of a parameter as an input stream.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @param length the number of bytes
* @throws SQLException if this object is closed
*/
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
setBinaryStream(parameterIndex, x, (long) length);
}
/**
* Sets the value of a parameter as an input stream.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @param length the number of bytes
* @throws SQLException if this object is closed
*/
public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
setBinaryStream(parameterIndex, x, -1);
}
/** /**
* Sets the value of a parameter as an ASCII stream. * Sets the value of a parameter as an ASCII stream.
* *
...@@ -783,6 +860,18 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -783,6 +860,18 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @throws SQLException if this object is closed * @throws SQLException if this object is closed
*/ */
public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
setAsciiStream(parameterIndex, x, (long) length);
}
/**
* Sets the value of a parameter as an ASCII stream.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @param length the number of bytes
* @throws SQLException if this object is closed
*/
public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("setAsciiStream("+parameterIndex+", x, "+length+");"); debugCode("setAsciiStream("+parameterIndex+", x, "+length+");");
...@@ -795,6 +884,16 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -795,6 +884,16 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
} }
} }
/**
* Sets the value of a parameter as an ASCII stream.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @throws SQLException if this object is closed
*/
public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
setAsciiStream(parameterIndex, x, -1);
}
/** /**
* Sets the value of a parameter as a character stream. * Sets the value of a parameter as a character stream.
...@@ -805,6 +904,29 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -805,6 +904,29 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @throws SQLException if this object is closed * @throws SQLException if this object is closed
*/ */
public void setCharacterStream(int parameterIndex, Reader x, int length) throws SQLException { public void setCharacterStream(int parameterIndex, Reader x, int length) throws SQLException {
setCharacterStream(parameterIndex, x, (long) length);
}
/**
* Sets the value of a parameter as a character stream.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @throws SQLException if this object is closed
*/
public void setCharacterStream(int parameterIndex, Reader x) throws SQLException {
setCharacterStream(parameterIndex, x, -1);
}
/**
* Sets the value of a parameter as a character stream.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @param length the number of bytes
* @throws SQLException if this object is closed
*/
public void setCharacterStream(int parameterIndex, Reader x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("setCharacterStream("+parameterIndex+", x, "+length+");"); debugCode("setCharacterStream("+parameterIndex+", x, "+length+");");
...@@ -1144,6 +1266,16 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -1144,6 +1266,16 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
} }
} }
/**
* Sets the value of a parameter as a character stream.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @throws SQLException if this object is closed
*/
public void setNCharacterStream(int parameterIndex, Reader x) throws SQLException {
setNCharacterStream(parameterIndex, x, -1);
}
/** /**
* Sets the value of a parameter as a Clob. * Sets the value of a parameter as a Clob.
...@@ -1159,11 +1291,12 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -1159,11 +1291,12 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
if(debug()) { if(debug()) {
debugCode("setNClob("+parameterIndex+", x);"); debugCode("setNClob("+parameterIndex+", x);");
} }
checkClosed();
Value v; Value v;
if (x == null) { if(x == null) {
v = ValueNull.INSTANCE; v = ValueNull.INSTANCE;
} else { } else {
v = session.createClob(x.getCharacterStream(), -1); v = conn.createClob(x.getCharacterStream(), -1);
} }
setParameter(parameterIndex, v); setParameter(parameterIndex, v);
} catch(Throwable e) { } catch(Throwable e) {
...@@ -1173,6 +1306,26 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -1173,6 +1306,26 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
*/ */
//#endif //#endif
/**
* Sets the value of a parameter as a Clob.
*
* @param parameterIndex the parameter index (1, 2, ...)
* @param x the value
* @throws SQLException if this object is closed
*/
public void setNClob(int parameterIndex, Reader x) throws SQLException {
try {
if(debug()) {
debugCode("setNClob("+parameterIndex+", x);");
}
checkClosed();
Value v = conn.createClob(x, -1);
setParameter(parameterIndex, v);
} catch(Throwable e) {
throw logAndConvert(e);
}
}
/** /**
* Sets the value of a parameter as a Clob. * Sets the value of a parameter as a Clob.
* *
...@@ -1245,26 +1398,4 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat ...@@ -1245,26 +1398,4 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
*/ */
//#endif //#endif
/**
* Requests that this object should be pooled or not.
* This call is ignored.
*
* @param poolable the requested value
*/
public void setPoolable(boolean poolable) throws SQLException {
if(debug()) {
debugCode("setPoolable("+poolable+");");
}
}
/**
* Returns whether this object is poolable.
* @return false
*/
public boolean isPoolable() throws SQLException {
debugCodeCall("isPoolable");
return false;
}
} }
...@@ -1656,6 +1656,30 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1656,6 +1656,30 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the result set is closed * @throws SQLException if the result set is closed
*/ */
public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
updateAsciiStream(columnIndex, x, (long) length);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
updateAsciiStream(columnIndex, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateAsciiStream("+columnIndex+", x, "+length+");"); debugCode("updateAsciiStream("+columnIndex+", x, "+length+");");
...@@ -1677,6 +1701,30 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1677,6 +1701,30 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the result set is closed * @throws SQLException if the result set is closed
*/ */
public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException { public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException {
updateAsciiStream(columnName, x, (long) length);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateAsciiStream(String columnName, InputStream x) throws SQLException {
updateAsciiStream(columnName, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateAsciiStream(String columnName, InputStream x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateAsciiStream("+quote(columnName)+", x, "+length+");"); debugCode("updateAsciiStream("+quote(columnName)+", x, "+length+");");
...@@ -1698,6 +1746,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1698,6 +1746,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the result set is closed * @throws SQLException if the result set is closed
*/ */
public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
updateBinaryStream(columnIndex, x, (long) length);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
updateBinaryStream(columnIndex, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateBinaryStream("+columnIndex+", x, "+length+");"); debugCode("updateBinaryStream("+columnIndex+", x, "+length+");");
...@@ -1710,6 +1781,17 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1710,6 +1781,17 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
} }
} }
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateBinaryStream(String columnName, InputStream x) throws SQLException {
updateBinaryStream(columnName, x, -1);
}
/** /**
* Updates a column in the current or insert row. * Updates a column in the current or insert row.
* *
...@@ -1719,6 +1801,18 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1719,6 +1801,18 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the result set is closed * @throws SQLException if the result set is closed
*/ */
public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException { public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException {
updateBinaryStream(columnName, x, (long) length);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateBinaryStream(String columnName, InputStream x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateBinaryStream("+quote(columnName)+", x, "+length+");"); debugCode("updateBinaryStream("+quote(columnName)+", x, "+length+");");
...@@ -1739,7 +1833,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1739,7 +1833,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param length the number of characters * @param length the number of characters
* @throws SQLException if the result set is closed * @throws SQLException if the result set is closed
*/ */
public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateCharacterStream("+columnIndex+", x, "+length+");"); debugCode("updateCharacterStream("+columnIndex+", x, "+length+");");
...@@ -1752,6 +1846,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1752,6 +1846,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
} }
} }
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
updateCharacterStream(columnIndex, x, (long) length);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
updateCharacterStream(columnIndex, x, -1);
}
/** /**
* Updates a column in the current or insert row. * Updates a column in the current or insert row.
* *
...@@ -1761,6 +1878,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1761,6 +1878,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the result set is closed * @throws SQLException if the result set is closed
*/ */
public void updateCharacterStream(String columnName, Reader x, int length) throws SQLException { public void updateCharacterStream(String columnName, Reader x, int length) throws SQLException {
updateCharacterStream(columnName, x, (long) length);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateCharacterStream(String columnName, Reader x) throws SQLException {
updateCharacterStream(columnName, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateCharacterStream(String columnName, Reader x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateCharacterStream("+quote(columnName)+", x, "+length+");"); debugCode("updateCharacterStream("+quote(columnName)+", x, "+length+");");
...@@ -1880,64 +2020,224 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -1880,64 +2020,224 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
} }
/** /**
* THIS FEATURE IS NOT SUPPORTED. * Updates a column in the current or insert row.
* *
* @throws SQLException Unsupported Feature (SQL State 0A000) * @param columnIndex (1,2,...)
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateBlob(int columnIndex, InputStream x) throws SQLException {
updateBlob(columnIndex, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the length
* @throws SQLException if the result set is closed
*/
public void updateBlob(int columnIndex, InputStream x, long length) throws SQLException {
try {
if(debug()) {
debugCode("updateBlob("+columnIndex+", x, " + length + ");");
}
Value v = conn.createBlob(x, length);
update(columnIndex, v);
} catch(Throwable e) {
throw logAndConvert(e);
}
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @throws SQLException if the result set is closed
*/ */
public void updateBlob(int columnIndex, Blob x) throws SQLException { public void updateBlob(int columnIndex, Blob x) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateBlob("+columnIndex+", x);"); debugCode("updateBlob("+columnIndex+", x);");
} }
throw Message.getUnsupportedException(); Value v;
if(x == null) {
v = ValueNull.INSTANCE;
} else {
v = conn.createBlob(x.getBinaryStream(), -1);
}
update(columnIndex, v);
} catch(Throwable e) { } catch(Throwable e) {
throw logAndConvert(e); throw logAndConvert(e);
} }
} }
/** /**
* THIS FEATURE IS NOT SUPPORTED. * Updates a column in the current or insert row.
* *
* @throws SQLException Unsupported Feature (SQL State 0A000) * @param columnName the name of the column label
* @param x the value
* @throws SQLException if the result set is closed
*/ */
public void updateBlob(String columnName, Blob x) throws SQLException { public void updateBlob(String columnName, Blob x) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateBlob("+quote(columnName)+", x);"); debugCode("updateBlob("+quote(columnName)+", x);");
} }
throw Message.getUnsupportedException(); Value v;
if(x == null) {
v = ValueNull.INSTANCE;
} else {
v = conn.createBlob(x.getBinaryStream(), -1);
}
update(columnName, v);
} catch(Throwable e) { } catch(Throwable e) {
throw logAndConvert(e); throw logAndConvert(e);
} }
} }
/** /**
* THIS FEATURE IS NOT SUPPORTED. * Updates a column in the current or insert row.
* *
* @throws SQLException Unsupported Feature (SQL State 0A000) * @param columnName the name of the column label
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateBlob(String columnName, InputStream x) throws SQLException {
updateBlob(columnName, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the length
* @throws SQLException if the result set is closed
*/
public void updateBlob(String columnName, InputStream x, long length) throws SQLException {
try {
if(debug()) {
debugCode("updateBlob("+quote(columnName)+", x, " + length + ");");
}
Value v = conn.createBlob(x, -1);
update(columnName, v);
} catch(Throwable e) {
throw logAndConvert(e);
}
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @throws SQLException if the result set is closed
*/ */
public void updateClob(int columnIndex, Clob x) throws SQLException { public void updateClob(int columnIndex, Clob x) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateClob("+columnIndex+", x);"); debugCode("updateClob("+columnIndex+", x);");
} }
throw Message.getUnsupportedException(); checkClosed();
Value v;
if(x == null) {
v = ValueNull.INSTANCE;
} else {
v = conn.createClob(x.getCharacterStream(), -1);
}
update(columnIndex, v);
} catch(Throwable e) { } catch(Throwable e) {
throw logAndConvert(e); throw logAndConvert(e);
} }
} }
/** /**
* THIS FEATURE IS NOT SUPPORTED. * Updates a column in the current or insert row.
* *
* @throws SQLException Unsupported Feature (SQL State 0A000) * @param columnIndex (1,2,...)
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateClob(int columnIndex, Reader x) throws SQLException {
updateClob(columnIndex, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the length
* @throws SQLException if the result set is closed
*/
public void updateClob(int columnIndex, Reader x, long length) throws SQLException {
try {
if(debug()) {
debugCode("updateClob("+columnIndex+", x, " + length + ");");
}
checkClosed();
Value v = conn.createClob(x, length);
update(columnIndex, v);
} catch(Throwable e) {
throw logAndConvert(e);
}
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @throws SQLException if the result set is closed
*/ */
public void updateClob(String columnName, Clob x) throws SQLException { public void updateClob(String columnName, Clob x) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateClob("+quote(columnName)+", x);"); debugCode("updateClob("+quote(columnName)+", x);");
} }
throw Message.getUnsupportedException(); checkClosed();
Value v;
if(x == null) {
v = ValueNull.INSTANCE;
} else {
v = conn.createClob(x.getCharacterStream(), -1);
}
update(columnName, v);
} catch(Throwable e) {
throw logAndConvert(e);
}
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateClob(String columnName, Reader x) throws SQLException {
updateClob(columnName, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the length
* @throws SQLException if the result set is closed
*/
public void updateClob(String columnName, Reader x, long length) throws SQLException {
try {
if(debug()) {
debugCode("updateClob("+quote(columnName)+", x);");
}
checkClosed();
Value v = conn.createClob(x, length);
update(columnName, v);
} catch(Throwable e) { } catch(Throwable e) {
throw logAndConvert(e); throw logAndConvert(e);
} }
...@@ -2747,7 +3047,87 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -2747,7 +3047,87 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
*/ */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public void updateNClob(String columnName, NClob nClob) throws SQLException { public void updateNClob(int columnIndex, Reader x) throws SQLException {
try {
if(debug()) {
debugCode("updateNClob("+columnIndex+", x);");
}
throw Message.getUnsupportedException();
} catch(Throwable e) {
throw logAndConvert(e);
}
}
*/
//#endif
/**
* THIS FEATURE IS NOT SUPPORTED.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public void updateNClob(int columnIndex, Reader x, long length) throws SQLException {
try {
if(debug()) {
debugCode("updateNClob("+columnIndex+", x, " + length + ");");
}
throw Message.getUnsupportedException();
} catch(Throwable e) {
throw logAndConvert(e);
}
}
*/
//#endif
/**
* THIS FEATURE IS NOT SUPPORTED.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public void updateNClob(String columnName, Reader x) throws SQLException {
try {
if(debug()) {
debugCode("updateNClob("+quote(columnName)+", x);");
}
throw Message.getUnsupportedException();
} catch(Throwable e) {
throw logAndConvert(e);
}
}
*/
//#endif
/**
* THIS FEATURE IS NOT SUPPORTED.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public void updateNClob(String columnName, Reader x, long length) throws SQLException {
try {
if(debug()) {
debugCode("updateNClob("+quote(columnName)+", x, " + length+");");
}
throw Message.getUnsupportedException();
} catch(Throwable e) {
throw logAndConvert(e);
}
}
*/
//#endif
/**
* THIS FEATURE IS NOT SUPPORTED.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public void updateNClob(String columnName, NClob x) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateNClob("+quote(columnName)+", x);"); debugCode("updateNClob("+quote(columnName)+", x);");
...@@ -2928,6 +3308,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -2928,6 +3308,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the result set is closed * @throws SQLException if the result set is closed
*/ */
public void updateNCharacterStream(int columnIndex, Reader x, int length) throws SQLException { public void updateNCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
updateNCharacterStream(columnIndex, x, (long) length);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
updateNCharacterStream(columnIndex, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateNCharacterStream("+columnIndex+", x, "+length+");"); debugCode("updateNCharacterStream("+columnIndex+", x, "+length+");");
...@@ -2948,6 +3351,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -2948,6 +3351,29 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the result set is closed * @throws SQLException if the result set is closed
*/ */
public void updateNCharacterStream(String columnName, Reader x, int length) throws SQLException { public void updateNCharacterStream(String columnName, Reader x, int length) throws SQLException {
updateNCharacterStream(columnName, x, (long) length);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @throws SQLException if the result set is closed
*/
public void updateNCharacterStream(String columnName, Reader x) throws SQLException {
updateNCharacterStream(columnName, x, -1);
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateNCharacterStream(String columnName, Reader x, long length) throws SQLException {
try { try {
if(debug()) { if(debug()) {
debugCode("updateNCharacterStream("+quote(columnName)+", x, "+length+");"); debugCode("updateNCharacterStream("+quote(columnName)+", x, "+length+");");
...@@ -2965,7 +3391,8 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -2965,7 +3391,8 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
*/ */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public Object unwrap(Class<?> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
debugCode("unwrap");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
...@@ -2978,6 +3405,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -2978,6 +3405,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
//#ifdef JDK16 //#ifdef JDK16
/* /*
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCode("isWrapperFor");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
......
...@@ -411,7 +411,8 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD ...@@ -411,7 +411,8 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
*/ */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public Object unwrap(Class<?> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
...@@ -424,6 +425,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD ...@@ -424,6 +425,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
//#ifdef JDK16 //#ifdef JDK16
/* /*
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
......
...@@ -848,7 +848,7 @@ public class JdbcStatement extends TraceObject implements Statement { ...@@ -848,7 +848,7 @@ public class JdbcStatement extends TraceObject implements Statement {
*/ */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public Object unwrap(Class<?> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
*/ */
...@@ -866,6 +866,27 @@ public class JdbcStatement extends TraceObject implements Statement { ...@@ -866,6 +866,27 @@ public class JdbcStatement extends TraceObject implements Statement {
*/ */
//#endif //#endif
/**
* Returns whether this object is poolable.
* @return false
*/
public boolean isPoolable() throws SQLException {
debugCodeCall("isPoolable");
return false;
}
/**
* Requests that this object should be pooled or not.
* This call is ignored.
*
* @param poolable the requested value
*/
public void setPoolable(boolean poolable) throws SQLException {
if(debug()) {
debugCode("setPoolable("+poolable+");");
}
}
// public void finalize() { // public void finalize() {
// if(!Database.RUN_FINALIZERS) { // if(!Database.RUN_FINALIZERS) {
// return; // return;
......
...@@ -23,6 +23,12 @@ import javax.sql.XADataSource; ...@@ -23,6 +23,12 @@ import javax.sql.XADataSource;
import org.h2.jdbc.JdbcConnection; import org.h2.jdbc.JdbcConnection;
import org.h2.message.TraceObject; import org.h2.message.TraceObject;
//#ifdef JDK16
/*
import org.h2.message.Message;
*/
//#endif
/** /**
* A data source for H2 database connections * A data source for H2 database connections
* *
...@@ -146,4 +152,20 @@ public class JdbcDataSource extends TraceObject implements XADataSource, DataSou ...@@ -146,4 +152,20 @@ public class JdbcDataSource extends TraceObject implements XADataSource, DataSou
return getXAConnection(user, password); return getXAConnection(user, password);
} }
//#ifdef JDK16
/*
public <T> T unwrap(Class<T> iface) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
} }
...@@ -22,6 +22,12 @@ import org.h2.jdbc.JdbcConnection; ...@@ -22,6 +22,12 @@ import org.h2.jdbc.JdbcConnection;
import org.h2.message.TraceObject; import org.h2.message.TraceObject;
import org.h2.util.ByteUtils; import org.h2.util.ByteUtils;
//#ifdef JDK16
/*
import javax.sql.StatementEventListener;
*/
//#endif
public class JdbcXAConnection extends TraceObject implements XAConnection, JdbcConnectionListener, XAResource { public class JdbcXAConnection extends TraceObject implements XAConnection, JdbcConnectionListener, XAResource {
private JdbcDataSourceFactory factory; private JdbcDataSourceFactory factory;
...@@ -258,4 +264,21 @@ public class JdbcXAConnection extends TraceObject implements XAConnection, JdbcC ...@@ -258,4 +264,21 @@ public class JdbcXAConnection extends TraceObject implements XAConnection, JdbcC
getTrace().debug("committed"); getTrace().debug("committed");
} }
//#ifdef JDK16
/*
public void addStatementEventListener(StatementEventListener listener) {
throw new UnsupportedOperationException();
}
*/
//#endif
//#ifdef JDK16
/*
public void removeStatementEventListener(StatementEventListener listener) {
throw new UnsupportedOperationException();
}
*/
//#endif
} }
...@@ -59,6 +59,10 @@ public class TraceObject { ...@@ -59,6 +59,10 @@ public class TraceObject {
return trace.debug(); return trace.debug();
} }
protected boolean info() {
return trace.info();
}
protected Trace getTrace() { protected Trace getTrace() {
return trace; return trace;
} }
......
...@@ -52,7 +52,7 @@ public class RunScript { ...@@ -52,7 +52,7 @@ public class RunScript {
* </ul> * </ul>
* To include local files when using remote databases, use the special syntax: * To include local files when using remote databases, use the special syntax:
* <pre> * <pre>
* @INCLUDE fileName * &#64;INCLUDE fileName
* </pre> * </pre>
* This syntax is only supported by this tool. * This syntax is only supported by this tool.
* Embedded RUNSCRIPT SQL statements will be executed by the database. * Embedded RUNSCRIPT SQL statements will be executed by the database.
......
...@@ -1395,7 +1395,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -1395,7 +1395,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/** INTERNAL */ /** INTERNAL */
//#ifdef JDK16 //#ifdef JDK16
/* /*
public Object unwrap(Class<?> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
throw getUnsupportedException(); throw getUnsupportedException();
} }
*/ */
...@@ -1410,4 +1410,144 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -1410,4 +1410,144 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
*/ */
//#endif //#endif
/** INTERNAL */
public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateAsciiStream(String columnName, InputStream x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateAsciiStream(String columnName, InputStream x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateBinaryStream(int columnName, InputStream x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateBinaryStream(String columnName, InputStream x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateBinaryStream(String columnName, InputStream x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateBlob(int columnIndex, InputStream x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateBlob(String columnName, InputStream x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateBlob(int columnIndex, InputStream x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateBlob(String columnName, InputStream x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateCharacterStream(String columnName, Reader x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateCharacterStream(String columnName, Reader x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateClob(int columnIndex, Reader x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateClob(String columnName, Reader x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateClob(int columnIndex, Reader x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateClob(String columnName, Reader x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateNCharacterStream(String columnName, Reader x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateNCharacterStream(String columnName, Reader x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateNClob(int columnIndex, Reader x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateNClob(String columnName, Reader x) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateNClob(int columnIndex, Reader x, long length) throws SQLException {
throw getUnsupportedException();
}
/** INTERNAL */
public void updateNClob(String columnName, Reader x, long length) throws SQLException {
throw getUnsupportedException();
}
} }
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.util; package org.h2.util;
import java.io.IOException; import java.io.IOException;
......
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.util; package org.h2.util;
import java.lang.ref.PhantomReference; import java.lang.ref.PhantomReference;
......
...@@ -252,7 +252,7 @@ public class Transfer { ...@@ -252,7 +252,7 @@ public class Transfer {
InputStream in = v.getInputStream(); InputStream in = v.getInputStream();
long written = IOUtils.copyAndCloseInput(in, out); long written = IOUtils.copyAndCloseInput(in, out);
if(Constants.CHECK && written != length) { if(Constants.CHECK && written != length) {
Message.getInternalError("length:" + length + " written:" + written); throw Message.getInternalError("length:" + length + " written:" + written);
} }
writeInt(LOB_MAGIC); writeInt(LOB_MAGIC);
break; break;
...@@ -267,7 +267,7 @@ public class Transfer { ...@@ -267,7 +267,7 @@ public class Transfer {
Writer writer = new OutputStreamWriter(out, Constants.UTF8); Writer writer = new OutputStreamWriter(out, Constants.UTF8);
long written = IOUtils.copyAndCloseInput(reader, writer); long written = IOUtils.copyAndCloseInput(reader, writer);
if(Constants.CHECK && written != length) { if(Constants.CHECK && written != length) {
Message.getInternalError("length:" + length + " written:" + written); throw Message.getInternalError("length:" + length + " written:" + written);
} }
writer.flush(); writer.flush();
writeInt(LOB_MAGIC); writeInt(LOB_MAGIC);
......
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
*/ */
package org.h2.test; package org.h2.test;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Properties; import java.util.Properties;
...@@ -90,21 +86,9 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2 ...@@ -90,21 +86,9 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
TestAll test = new TestAll(); TestAll test = new TestAll();
test.printSystem(); test.printSystem();
// java.lang.Error: query was too quick; result: 0 // javadoc for runscript is broken (@ problem)
// at org.h2.test.db.TestCases$1.run(TestCases.java:156)
// at java.lang.Thread.run(Thread.java:595) // codeswitch_jdk13 doesnt work?
//java.lang.Error: query was too quick; result: 0
// at org.h2.test.db.TestCases$1.run(TestCases.java:156)
// at java.lang.Thread.run(Thread.java:595)
//java.lang.Exception: closing took 1266
// at org.h2.test.TestBase.error(TestBase.java:206)
// at org.h2.test.db.TestCases.testDisconnect(TestCases.java:173)
// at org.h2.test.db.TestCases.test(TestCases.java:25)
// at org.h2.test.TestBase.runTest(TestBase.java:55)
// at org.h2.test.TestAll.testDatabase(TestAll.java:414)
// at org.h2.test.TestAll.testAll(TestAll.java:377)
// at org.h2.test.TestAll.testEverything(TestAll.java:273)
// at org.h2.test.TestAll.main(TestAll.java:196)
// Check if new Hibernate dialect for H2 is ok // Check if new Hibernate dialect for H2 is ok
// http://opensource.atlassian.com/projects/hibernate/browse/HHH-2300 // http://opensource.atlassian.com/projects/hibernate/browse/HHH-2300
...@@ -119,14 +103,10 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2 ...@@ -119,14 +103,10 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
// D:\data\h2test\openjpa\openjpa-persistence-jdbc>mvn test // D:\data\h2test\openjpa\openjpa-persistence-jdbc>mvn test
// add H2 to maven // add H2 to maven
// OSGi Bundle (see Forum)
// Test and document JDK 1.6 QueryObjectFactory
// OSGi Bundle (see Forum) // test with PostgreSQL Version 8.2
// Test and document JDK 1.6 QueryObjectFactory
// clean build path (remove hibernate librarires)
// test with PostgreSQL Version 8.2
// create table testoe(id int primary key, name varchar(255)) // create table testoe(id int primary key, name varchar(255))
// create user oe identified by merlin // create user oe identified by merlin
...@@ -137,12 +117,9 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2 ...@@ -137,12 +117,9 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
// AS SELECT color, quantity FROM new_product WHERE color = 'RED' // AS SELECT color, quantity FROM new_product WHERE color = 'RED'
// GRANT select ON new_product_view TO hr; // GRANT select ON new_product_view TO hr;
// http://dev.helma.org/Wiki/RhinoLoader // http://dev.helma.org/Wiki/RhinoLoader
// use version numbers 1.0.4 and so on
// use version numbers 1.0.4 and so on
// Fulltext search: Use reader for CLOB data, special reader tokenizer // Fulltext search: Use reader for CLOB data, special reader tokenizer
// Checkstyle to verify HTML docs // Checkstyle to verify HTML docs
// test multithreading access to blobs (one thread reads from the inputstream, the other deletes the row using the same connection) // test multithreading access to blobs (one thread reads from the inputstream, the other deletes the row using the same connection)
// Dezign for Databases (http://www.datanamic.com // Dezign for Databases (http://www.datanamic.com
...@@ -166,7 +143,6 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2 ...@@ -166,7 +143,6 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
// extend the random join test that compared the result against PostgreSQL // extend the random join test that compared the result against PostgreSQL
// Donate a translation: I am looking for people who would help translating the H2 Console into other languages. Please tell me if you think you can help // Donate a translation: I am looking for people who would help translating the H2 Console into other languages. Please tell me if you think you can help
// extend TestJoin // extend TestJoin
// TEST CASE FOR: embedded mode, create blob+clob, then use server mode, read blob+clob / update blob+clob
// long running test with the same database // long running test with the same database
// repeatable test with a very big database (making backups of the database files) // repeatable test with a very big database (making backups of the database files)
// check performance monitor Avg. Disk Write Queue Length, disk writes // check performance monitor Avg. Disk Write Queue Length, disk writes
...@@ -413,6 +389,7 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2 ...@@ -413,6 +389,7 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
new TestBatchUpdates().runTest(this); new TestBatchUpdates().runTest(this);
new TestBigDb().runTest(this); new TestBigDb().runTest(this);
new TestBigResult().runTest(this); new TestBigResult().runTest(this);
new TestCache().runTest(this);
new TestCases().runTest(this); new TestCases().runTest(this);
new TestCheckpoint().runTest(this); new TestCheckpoint().runTest(this);
new TestCluster().runTest(this); new TestCluster().runTest(this);
......
...@@ -19,13 +19,9 @@ import org.h2.test.TestBase; ...@@ -19,13 +19,9 @@ import org.h2.test.TestBase;
public class TestMultiConn extends TestBase implements DatabaseEventListener { public class TestMultiConn extends TestBase implements DatabaseEventListener {
public void test() throws Exception { public void test() throws Exception {
// testCommitRollback(); testCommitRollback();
try {
testConcurrentOpen(); testConcurrentOpen();
} catch(SQLException e) { testThreeThreads();
e.printStackTrace();
System.exit(0); }
// testThreeThreads();
} }
private static int wait; private static int wait;
......
...@@ -18,7 +18,7 @@ import org.h2.util.RandomUtils; ...@@ -18,7 +18,7 @@ import org.h2.util.RandomUtils;
public class TestRandomSQL extends TestBase { public class TestRandomSQL extends TestBase {
private int dbId; private int dbId;
private boolean showSQL = true; private boolean showSQL;
private ArrayList statements; private ArrayList statements;
private int seed; private int seed;
private boolean exitOnError = true; private boolean exitOnError = true;
...@@ -141,6 +141,7 @@ public class TestRandomSQL extends TestBase { ...@@ -141,6 +141,7 @@ public class TestRandomSQL extends TestBase {
public void testCase(int i) throws Exception { public void testCase(int i) throws Exception {
seed = i; seed = i;
printTime("TestRandomSQL " + seed);
try { try {
deleteDb(getDatabaseName()); deleteDb(getDatabaseName());
} catch(SQLException e) { } catch(SQLException e) {
...@@ -154,7 +155,6 @@ public class TestRandomSQL extends TestBase { ...@@ -154,7 +155,6 @@ public class TestRandomSQL extends TestBase {
showSQL = false; showSQL = false;
for(int a=0; ; a++) { for(int a=0; ; a++) {
int seed = RandomUtils.nextInt(Integer.MAX_VALUE); int seed = RandomUtils.nextInt(Integer.MAX_VALUE);
System.out.println("a:" + a + " seed:" + seed);
testCase(seed); testCase(seed);
} }
} }
......
...@@ -103,7 +103,7 @@ public class TestSynth extends TestBase { ...@@ -103,7 +103,7 @@ public class TestSynth extends TestBase {
add(Command.getCreateTable(this, table)); add(Command.getCreateTable(this, table));
add(Command.getCreateIndex(this, table.newRandomIndex())); add(Command.getCreateIndex(this, table.newRandomIndex()));
} }
for(int i=0; i<100; i++) { for(int i=0; i<400; i++) {
addRandomCommands(); addRandomCommands();
} }
// for (int i = 0; i < 20; i++) { // for (int i = 0; i < 20; i++) {
......
...@@ -14,6 +14,9 @@ import org.h2.test.TestBase; ...@@ -14,6 +14,9 @@ import org.h2.test.TestBase;
public class TestCache extends TestBase { public class TestCache extends TestBase {
public void test() throws Exception { public void test() throws Exception {
if(config.memory) {
return;
}
deleteDb("cache"); deleteDb("cache");
Connection conn = getConnection("cache"); Connection conn = getConnection("cache");
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
...@@ -32,7 +35,6 @@ public class TestCache extends TestBase { ...@@ -32,7 +35,6 @@ public class TestCache extends TestBase {
prep2.execute(); prep2.execute();
} }
conn.close(); conn.close();
System.out.println("------------------- read ");
conn = getConnection("cache"); conn = getConnection("cache");
stat = conn.createStatement(); stat = conn.createStatement();
stat.execute("SET CACHE_SIZE 1024"); stat.execute("SET CACHE_SIZE 1024");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论