提交 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.
<td>
GNU Compiler for Java.
<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>
</tr>
<tr>
......
......@@ -15,9 +15,9 @@ Frequently Asked Questions
<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.
The next release is planned for
2006-12-18.
2007-01-02.
Here is the list of known and confirmed issues as of
2006-12-03:
2006-12-16:
<ul>
<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
......
......@@ -222,55 +222,60 @@ Features
<table>
<tr><th>Product</th><th>Description</th></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>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>
<td><a href="http://www.jpox.org">JPOX</a></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>
<td><a href="http://luntbuild.javaforge.com">Luntbuild</a></td>
<td>Build automation and management 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>
<td><a href="http://www.minq.se/products/dbvis">DbVisualizer</a></td>
<td>Database tool.</td>
<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>
<td><a href="http://www.polepos.org">PolePosition</a></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>
<td><a href="http://www.shellbook.com">Shellbook</a></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>
<td><a href="http://sql-workbench.net">SQL Workbench/J</a></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>
<td><a href="http://www.streamcruncher.com">StreamCruncher</a></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>
</table>
......
......@@ -34,9 +34,13 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>Version 1.0 (Current)</h3>
<h3>Version 1.0 / 2006-12-..</h3><ul>
<li>String.toUpperCase and toLowerCase can not be to processing SQL, as they depend on the current locale.
Now use toUpperCase(Locale.ENGLISH) or Character.toUpperCase(..)
<h3>Version 1.0 / 2006-12-17</h3><ul>
<li>Can be compiled with JDK 1.6. However, only very few of the JDBC 4.0 features are implemented so far.
<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>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.
......
......@@ -12,6 +12,7 @@ package org.h2.engine;
*
* Release checklist
* - 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)
* - check version, change build number in Constants.java and build.xml
* - check code coverage
......@@ -53,8 +54,8 @@ package org.h2.engine;
*/
public class Constants {
public static final int BUILD_ID = 32;
private static final String BUILD = "2006-12-03";
public static final int BUILD_ID = 34;
private static final String BUILD = "2006-12-17";
public static final int VERSION_MAJOR = 1;
public static final int VERSION_MINOR = 0;
......
......@@ -150,6 +150,8 @@ int count;
int splitPoint = root.add(row, session);
if (splitPoint != 0) {
SearchRow pivot = root.getData(splitPoint);
int test;
// deletePage(session, root);
BtreePage page1 = root;
BtreePage page2 = root.split(session, splitPoint);
setRoot(new BtreeNode(this, page1, pivot, page2));
......
......@@ -125,10 +125,11 @@ public class BtreeLeaf extends BtreePage {
public BtreePage split(Session session, int splitPoint) throws SQLException {
ObjectArray data = new ObjectArray();
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()
Message.getInternalError();
}
// throw Message.getInternalError();
// }
for (int i = splitPoint; i < max; i++) {
data.add(getData(splitPoint));
pageData.remove(splitPoint);
......
......@@ -176,10 +176,11 @@ public class BtreeNode extends BtreePage {
IntArray children = new IntArray();
splitPoint++;
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()
Message.getInternalError();
}
// throw Message.getInternalError();
// }
for (int i = splitPoint; i < max; i++) {
data.add(getData(splitPoint));
children.add(getChild(splitPoint));
......
......@@ -561,7 +561,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
*
* @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();
}
......@@ -957,6 +957,86 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
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() {
// if(!Database.RUN_FINALIZERS) {
// return;
......
......@@ -38,6 +38,16 @@ import org.h2.value.ValueInt;
import org.h2.value.ValueLob;
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.
*/
......@@ -943,11 +953,6 @@ public class JdbcConnection extends TraceObject implements Connection {
}
}
private boolean info() {
// TODO Auto-generated method stub
return false;
}
/**
* INTERNAL
*/
......@@ -1294,7 +1299,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeAssign("NClob", TraceObject.CLOB, id);
debugCodeCall("createNClob");
checkClosed();
ValueLob v = session.createClob(new StringReader(""), 0);
ValueLob v = ValueLob.createSmallLob(Value.CLOB, new byte[0]);
return new JdbcClob(session, this, v, id);
} catch(Throwable e) {
throw logAndConvert(e);
......@@ -1315,6 +1320,30 @@ public class JdbcConnection extends TraceObject implements Connection {
*/
//#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.
*
......@@ -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.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public void setClientInfo(Properties properties) throws ClientInfoException {
throw new ClientInfoException();
public void setClientInfo(String name, String value) throws SQLClientInfoException {
throw new SQLClientInfoException();
}
*/
//#endif
/**
* Set a client property.
* Set the client properties.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public String getClientInfo(String name) throws SQLException {
throw Message.getUnsupportedException();
//#ifdef JDK16
/*
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)
*/
public Properties getClientdebug() throws SQLException {
throw Message.getUnsupportedException();
//#ifdef JDK16
/*
public Properties getClientInfo() throws SQLClientInfoException {
throw new SQLClientInfoException();
}
*/
//#endif
/**
* Create a query object
* Set a client property.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public <T> T createQueryObject(Class<T> ifc) throws SQLException {
public String getClientInfo(String name) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
/**
* Return an object of this class if possible.
......@@ -1387,7 +1412,7 @@ public class JdbcConnection extends TraceObject implements Connection {
*/
//#ifdef JDK16
/*
public Object unwrap(Class<?> iface) throws SQLException {
public <T> T unwrap(Class<T> iface) throws SQLException {
throw Message.getUnsupportedException();
}
*/
......
......@@ -2604,6 +2604,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
debugCodeCall("getSchemas");
throw Message.getUnsupportedException();
}
......@@ -2630,25 +2631,18 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public ResultSet getClientInfoProperties() throws SQLException {
debugCodeCall("getClientInfoProperties");
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.
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
//#ifdef JDK16
/*
public Object unwrap(Class<?> iface) throws SQLException {
public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException();
}
*/
......@@ -2661,10 +2655,29 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException();
}
*/
//#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
*/
//#ifdef JDK16
/*
public Object unwrap(Class<?> iface) throws SQLException {
public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException();
}
*/
......@@ -202,6 +203,7 @@ implements ParameterMetaData
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException();
}
*/
......
......@@ -45,6 +45,14 @@ import org.h2.value.ValueString;
import org.h2.value.ValueTime;
import org.h2.value.ValueTimestamp;
//#ifdef JDK16
/*
import java.sql.RowId;
import java.sql.NClob;
import java.sql.SQLXML;
*/
//#endif
/**
* Represents a prepared statement.
*
......@@ -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.
*
......@@ -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.
*
......@@ -761,7 +814,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @param length the number of bytes
* @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 {
if(debug()) {
debugCode("setBinaryStream("+parameterIndex+", x, "+length+");");
......@@ -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.
*
......@@ -783,6 +860,18 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @throws SQLException if this object is closed
*/
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 {
if(debug()) {
debugCode("setAsciiStream("+parameterIndex+", x, "+length+");");
......@@ -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.
......@@ -805,6 +904,29 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @throws SQLException if this object is closed
*/
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 {
if(debug()) {
debugCode("setCharacterStream("+parameterIndex+", x, "+length+");");
......@@ -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.
......@@ -1159,11 +1291,12 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
if(debug()) {
debugCode("setNClob("+parameterIndex+", x);");
}
checkClosed();
Value v;
if (x == null) {
if(x == null) {
v = ValueNull.INSTANCE;
} else {
v = session.createClob(x.getCharacterStream(), -1);
v = conn.createClob(x.getCharacterStream(), -1);
}
setParameter(parameterIndex, v);
} catch(Throwable e) {
......@@ -1173,6 +1306,26 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
*/
//#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.
*
......@@ -1245,26 +1398,4 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
*/
//#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;
}
}
......@@ -411,7 +411,8 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
*/
//#ifdef JDK16
/*
public Object unwrap(Class<?> iface) throws SQLException {
public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException();
}
*/
......@@ -424,6 +425,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException();
}
*/
......
......@@ -848,7 +848,7 @@ public class JdbcStatement extends TraceObject implements Statement {
*/
//#ifdef JDK16
/*
public Object unwrap(Class<?> iface) throws SQLException {
public <T> T unwrap(Class<T> iface) throws SQLException {
throw Message.getUnsupportedException();
}
*/
......@@ -866,6 +866,27 @@ public class JdbcStatement extends TraceObject implements Statement {
*/
//#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() {
// if(!Database.RUN_FINALIZERS) {
// return;
......
......@@ -23,6 +23,12 @@ import javax.sql.XADataSource;
import org.h2.jdbc.JdbcConnection;
import org.h2.message.TraceObject;
//#ifdef JDK16
/*
import org.h2.message.Message;
*/
//#endif
/**
* A data source for H2 database connections
*
......@@ -146,4 +152,20 @@ public class JdbcDataSource extends TraceObject implements XADataSource, DataSou
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;
import org.h2.message.TraceObject;
import org.h2.util.ByteUtils;
//#ifdef JDK16
/*
import javax.sql.StatementEventListener;
*/
//#endif
public class JdbcXAConnection extends TraceObject implements XAConnection, JdbcConnectionListener, XAResource {
private JdbcDataSourceFactory factory;
......@@ -258,4 +264,21 @@ public class JdbcXAConnection extends TraceObject implements XAConnection, JdbcC
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 {
return trace.debug();
}
protected boolean info() {
return trace.info();
}
protected Trace getTrace() {
return trace;
}
......
......@@ -52,7 +52,7 @@ public class RunScript {
* </ul>
* To include local files when using remote databases, use the special syntax:
* <pre>
* @INCLUDE fileName
* &#64;INCLUDE fileName
* </pre>
* This syntax is only supported by this tool.
* Embedded RUNSCRIPT SQL statements will be executed by the database.
......
......@@ -1395,7 +1395,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/** INTERNAL */
//#ifdef JDK16
/*
public Object unwrap(Class<?> iface) throws SQLException {
public <T> T unwrap(Class<T> iface) throws SQLException {
throw getUnsupportedException();
}
*/
......@@ -1410,4 +1410,144 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
*/
//#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;
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;
import java.lang.ref.PhantomReference;
......
......@@ -252,7 +252,7 @@ public class Transfer {
InputStream in = v.getInputStream();
long written = IOUtils.copyAndCloseInput(in, out);
if(Constants.CHECK && written != length) {
Message.getInternalError("length:" + length + " written:" + written);
throw Message.getInternalError("length:" + length + " written:" + written);
}
writeInt(LOB_MAGIC);
break;
......@@ -267,7 +267,7 @@ public class Transfer {
Writer writer = new OutputStreamWriter(out, Constants.UTF8);
long written = IOUtils.copyAndCloseInput(reader, writer);
if(Constants.CHECK && written != length) {
Message.getInternalError("length:" + length + " written:" + written);
throw Message.getInternalError("length:" + length + " written:" + written);
}
writer.flush();
writeInt(LOB_MAGIC);
......
......@@ -4,10 +4,6 @@
*/
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.util.Properties;
......@@ -90,21 +86,9 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
TestAll test = new TestAll();
test.printSystem();
// 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.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)
// javadoc for runscript is broken (@ problem)
// codeswitch_jdk13 doesnt work?
// Check if new Hibernate dialect for H2 is ok
// 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
// D:\data\h2test\openjpa\openjpa-persistence-jdbc>mvn test
// add H2 to maven
// OSGi Bundle (see Forum)
// Test and document JDK 1.6 QueryObjectFactory
// OSGi Bundle (see Forum)
// Test and document JDK 1.6 QueryObjectFactory
// clean build path (remove hibernate librarires)
// test with PostgreSQL Version 8.2
// test with PostgreSQL Version 8.2
// create table testoe(id int primary key, name varchar(255))
// create user oe identified by merlin
......@@ -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'
// GRANT select ON new_product_view TO hr;
// http://dev.helma.org/Wiki/RhinoLoader
// use version numbers 1.0.4 and so on
// http://dev.helma.org/Wiki/RhinoLoader
// use version numbers 1.0.4 and so on
// Fulltext search: Use reader for CLOB data, special reader tokenizer
// 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)
// 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
// 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
// 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
// repeatable test with a very big database (making backups of the database files)
// 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
new TestBatchUpdates().runTest(this);
new TestBigDb().runTest(this);
new TestBigResult().runTest(this);
new TestCache().runTest(this);
new TestCases().runTest(this);
new TestCheckpoint().runTest(this);
new TestCluster().runTest(this);
......
......@@ -19,13 +19,9 @@ import org.h2.test.TestBase;
public class TestMultiConn extends TestBase implements DatabaseEventListener {
public void test() throws Exception {
// testCommitRollback();
try {
testCommitRollback();
testConcurrentOpen();
} catch(SQLException e) {
e.printStackTrace();
System.exit(0); }
// testThreeThreads();
testThreeThreads();
}
private static int wait;
......
......@@ -18,7 +18,7 @@ import org.h2.util.RandomUtils;
public class TestRandomSQL extends TestBase {
private int dbId;
private boolean showSQL = true;
private boolean showSQL;
private ArrayList statements;
private int seed;
private boolean exitOnError = true;
......@@ -141,6 +141,7 @@ public class TestRandomSQL extends TestBase {
public void testCase(int i) throws Exception {
seed = i;
printTime("TestRandomSQL " + seed);
try {
deleteDb(getDatabaseName());
} catch(SQLException e) {
......@@ -154,7 +155,6 @@ public class TestRandomSQL extends TestBase {
showSQL = false;
for(int a=0; ; a++) {
int seed = RandomUtils.nextInt(Integer.MAX_VALUE);
System.out.println("a:" + a + " seed:" + seed);
testCase(seed);
}
}
......
......@@ -103,7 +103,7 @@ public class TestSynth extends TestBase {
add(Command.getCreateTable(this, table));
add(Command.getCreateIndex(this, table.newRandomIndex()));
}
for(int i=0; i<100; i++) {
for(int i=0; i<400; i++) {
addRandomCommands();
}
// for (int i = 0; i < 20; i++) {
......
......@@ -14,6 +14,9 @@ import org.h2.test.TestBase;
public class TestCache extends TestBase {
public void test() throws Exception {
if(config.memory) {
return;
}
deleteDb("cache");
Connection conn = getConnection("cache");
Statement stat = conn.createStatement();
......@@ -32,7 +35,6 @@ public class TestCache extends TestBase {
prep2.execute();
}
conn.close();
System.out.println("------------------- read ");
conn = getConnection("cache");
stat = conn.createStatement();
stat.execute("SET CACHE_SIZE 1024");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论