提交 c9dd1fe3 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 8f8e77d1
......@@ -83,7 +83,7 @@ public class BtreeLeaf extends BtreePage {
public SearchRow remove(Session session, Row oldRow, int level) throws SQLException {
int l = 0, r = pageData.size();
if (r == 0) {
if(!Constants.ALLOW_EMTPY_BTREE_PAGES && !root) {
if(!Constants.ALLOW_EMPTY_BTREE_PAGES && !root) {
throw Message.getInternalError("Empty btree page");
}
}
......@@ -91,7 +91,7 @@ public class BtreeLeaf extends BtreePage {
int i = (l + r) >>> 1;
SearchRow row = (SearchRow) pageData.get(i);
if(Constants.CHECK && row == null) {
throw Message.getInternalError("btree currupted");
throw Message.getInternalError("btree corrupt");
}
int comp = index.compareRows(row, oldRow);
if (comp == 0) {
......@@ -142,7 +142,7 @@ public class BtreeLeaf extends BtreePage {
public boolean findFirst(BtreeCursor cursor, SearchRow compare) throws SQLException {
int l = 0, r = pageData.size();
if (r == 0 && !Constants.ALLOW_EMTPY_BTREE_PAGES && !root) {
if (r == 0 && !Constants.ALLOW_EMPTY_BTREE_PAGES && !root) {
throw Message.getInternalError("Empty btree page");
}
while (l < r) {
......@@ -178,7 +178,7 @@ public class BtreeLeaf extends BtreePage {
public void first(BtreeCursor cursor) throws SQLException {
if (pageData.size() == 0) {
if (!Constants.ALLOW_EMTPY_BTREE_PAGES && !root) {
if (!Constants.ALLOW_EMPTY_BTREE_PAGES && !root) {
throw Message.getInternalError("Empty btree page");
}
nextUpper(cursor);
......@@ -258,7 +258,7 @@ public class BtreeLeaf extends BtreePage {
SearchRow getLast() throws SQLException {
if(pageData.size()==0) {
if(!Constants.ALLOW_EMTPY_BTREE_PAGES && !root) {
if(!Constants.ALLOW_EMPTY_BTREE_PAGES && !root) {
throw Message.getInternalError("Empty btree page");
}
return null;
......@@ -268,7 +268,7 @@ public class BtreeLeaf extends BtreePage {
SearchRow getFirst() throws SQLException {
if(pageData.size()==0) {
if(!Constants.ALLOW_EMTPY_BTREE_PAGES && !root) {
if(!Constants.ALLOW_EMPTY_BTREE_PAGES && !root) {
throw Message.getInternalError("Empty btree page");
}
return null;
......
......@@ -68,7 +68,7 @@ public class BtreeNode extends BtreePage {
public int add(Row newRow, Session session) throws SQLException {
int l = 0, r = pageData.size();
if (!Constants.ALLOW_EMTPY_BTREE_PAGES && pageChildren.size() == 0) {
if (!Constants.ALLOW_EMPTY_BTREE_PAGES && pageChildren.size() == 0) {
throw Message.getInternalError("Empty btree page");
}
while (l < r) {
......@@ -110,7 +110,7 @@ public class BtreeNode extends BtreePage {
public SearchRow remove(Session session, Row oldRow, int level) throws SQLException {
int l = 0, r = pageData.size();
if (!Constants.ALLOW_EMTPY_BTREE_PAGES && pageChildren.size() == 0) {
if (!Constants.ALLOW_EMPTY_BTREE_PAGES && pageChildren.size() == 0) {
throw Message.getInternalError("Empty btree page");
}
int comp = 0;
......@@ -201,7 +201,7 @@ public class BtreeNode extends BtreePage {
public boolean findFirst(BtreeCursor cursor, SearchRow compare) throws SQLException {
int l = 0, r = pageData.size();
if (!Constants.ALLOW_EMTPY_BTREE_PAGES && pageChildren.size() == 0) {
if (!Constants.ALLOW_EMPTY_BTREE_PAGES && pageChildren.size() == 0) {
throw Message.getInternalError("Empty btree page");
}
while (l < r) {
......@@ -331,7 +331,7 @@ public class BtreeNode extends BtreePage {
}
SearchRow getLast() throws SQLException {
if (!Constants.ALLOW_EMTPY_BTREE_PAGES && pageChildren.size() == 0) {
if (!Constants.ALLOW_EMPTY_BTREE_PAGES && pageChildren.size() == 0) {
throw Message.getInternalError("Empty btree page");
}
for(int i=pageChildren.size()-1; i>=0; i--) {
......
......@@ -129,7 +129,7 @@ public abstract class Index extends SchemaObject {
int index = columnIndex[i];
Value v = compare.getValue(index);
if(v==null) {
// can't compare futher
// can't compare further
return 0;
}
int c = compareValues(rowData.getValue(index), v);
......
......@@ -70,9 +70,7 @@ public class JdbcBlob extends TraceObject implements Blob {
}
/**
* Truncates the object.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Truncates the object.
*/
public void truncate(long len) throws SQLException {
debugCodeCall("truncate", len);
......@@ -112,9 +110,7 @@ public class JdbcBlob extends TraceObject implements Blob {
}
/**
* Sets some bytes of the object.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Sets some bytes of the object.
*/
public int setBytes(long pos, byte[] bytes) throws SQLException {
debugCode("setBytes("+pos+", bytes);");
......@@ -122,9 +118,7 @@ public class JdbcBlob extends TraceObject implements Blob {
}
/**
* Sets some bytes of the object.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Sets some bytes of the object.
*/
public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException {
debugCode("setBytes("+pos+", bytes, "+offset+", "+len+");");
......@@ -142,9 +136,7 @@ public class JdbcBlob extends TraceObject implements Blob {
}
/**
* Returns an output stream.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Returns an output stream.
*/
public OutputStream setBinaryStream(long pos) throws SQLException {
debugCodeCall("setBinaryStream", pos);
......@@ -152,9 +144,7 @@ public class JdbcBlob extends TraceObject implements Blob {
}
/**
* Searches a pattern and return the position.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Searches a pattern and return the position.
*/
public long position(byte[] pattern, long start) throws SQLException {
debugCode("position(pattern, "+start+");");
......@@ -205,9 +195,7 @@ public class JdbcBlob extends TraceObject implements Blob {
}
/**
* Searches a pattern and return the position.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Searches a pattern and return the position.
*/
public long position(Blob blobPattern, long start) throws SQLException {
debugCode("position(blobPattern, "+start+");");
......@@ -246,9 +234,7 @@ public class JdbcBlob extends TraceObject implements Blob {
}
/**
* Returns the input stream, starting from an offset.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Returns the input stream, starting from an offset.
*/
public InputStream getBinaryStream(long pos, long length) throws SQLException {
debugCode("getBinaryStream("+pos+", "+length+");");
......
......@@ -38,6 +38,9 @@ public class JdbcClob extends TraceObject implements Clob
private Value value;
private JdbcConnection conn;
/**
* INTERNAL
*/
public JdbcClob(SessionInterface session, JdbcConnection conn, Value value, int id) {
setTrace(session.getTrace(), TraceObject.CLOB, id);
this.conn = conn;
......@@ -80,9 +83,7 @@ public class JdbcClob extends TraceObject implements Clob
}
/**
* Truncates the object.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Truncates the object.
*/
public void truncate(long len) throws SQLException {
debugCodeCall("truncate", len);
......@@ -106,9 +107,7 @@ public class JdbcClob extends TraceObject implements Clob
}
/**
* Returns an output stream.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Returns an output stream.
*/
public OutputStream setAsciiStream(long pos) throws SQLException {
debugCodeCall("setAsciiStream", pos);
......@@ -131,9 +130,7 @@ public class JdbcClob extends TraceObject implements Clob
}
/**
* Returns a writer.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Returns a writer starting from a given position.
*/
public Writer setCharacterStream(long pos) throws SQLException {
debugCodeCall("setCharacterStream", pos);
......@@ -178,9 +175,7 @@ public class JdbcClob extends TraceObject implements Clob
}
/**
* Sets a substring.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Sets a substring.
*/
public int setString(long pos, String str) throws SQLException {
debugCode("setString("+pos+", "+quote(str)+");");
......@@ -188,9 +183,7 @@ public class JdbcClob extends TraceObject implements Clob
}
/**
* Sets a substring.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Sets a substring.
*/
public int setString(long pos, String str, int offset, int len) throws SQLException {
debugCode("setString("+pos+", "+quote(str)+", "+offset+", "+len+");");
......@@ -198,9 +191,7 @@ public class JdbcClob extends TraceObject implements Clob
}
/**
* Searches a pattern and return the position.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Searches a pattern and return the position.
*/
public long position(String pattern, long start) throws SQLException {
debugCode("position("+quote(pattern)+", "+start+");");
......@@ -208,9 +199,7 @@ public class JdbcClob extends TraceObject implements Clob
}
/**
* Searches a pattern and return the position.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Searches a pattern and return the position.
*/
public long position(Clob clobPattern, long start) throws SQLException {
debugCode("position(clobPattern, "+start+");");
......@@ -226,9 +215,7 @@ public class JdbcClob extends TraceObject implements Clob
}
/**
* Returns the reader, starting from an offset.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Returns the reader, starting from an offset.
*/
public Reader getCharacterStream(long pos, long length) throws SQLException {
debugCode("getCharacterStream("+pos+", "+length+");");
......
......@@ -85,8 +85,7 @@ public class JdbcConnection extends TraceObject implements Connection {
* Creates a new statement.
*
* @return the new statement
* @throws SQLException
* if the connection is closed
* @throws SQLException if the connection is closed
*/
public Statement createStatement() throws SQLException {
try {
......@@ -307,22 +306,22 @@ public class JdbcConnection extends TraceObject implements Connection {
* if the connection is closed
*/
public synchronized boolean getAutoCommit() throws SQLException {
try {
checkClosed();
debugCodeCall("getAutoCommit");
return getInternalAutoCommit();
} catch(Throwable e) {
throw logAndConvert(e);
}
}
private boolean getInternalAutoCommit() throws SQLException {
try {
checkClosed();
getAutoCommit = prepareCommand("CALL AUTOCOMMIT()", getAutoCommit);
ResultInterface result = getAutoCommit.executeQuery(0, false);
result.next();
boolean autocommit = result.currentRow()[0].getBoolean().booleanValue();
result.close();
return autocommit;
} catch(Throwable e) {
throw logAndConvert(e);
}
}
/**
......@@ -374,7 +373,6 @@ public class JdbcConnection extends TraceObject implements Connection {
}
}
/**
* Translates a SQL statement into the database grammar.
*
......@@ -652,9 +650,7 @@ public class JdbcConnection extends TraceObject implements Connection {
}
/**
* Sets the type map.
*
* @throws SQLException Unsupported Feature (SQL State 0A000) if the map is not empty
* [Partially supported] Sets the type map. This is only supported if the map is empty or null.
*/
public void setTypeMap(Map map) throws SQLException {
try {
......@@ -771,7 +767,7 @@ public class JdbcConnection extends TraceObject implements Connection {
*
* @return the new savepoint
*/
//#ifdef JDK14
//#ifdef JDK14
public Savepoint setSavepoint() throws SQLException {
try {
int id = getNextId(TraceObject.SAVEPOINT);
......@@ -789,14 +785,14 @@ public class JdbcConnection extends TraceObject implements Connection {
throw logAndConvert(e);
}
}
//#endif
//#endif
/**
* Creates a new named savepoint.
*
* @return the new savepoint
*/
//#ifdef JDK14
//#ifdef JDK14
public Savepoint setSavepoint(String name) throws SQLException {
try {
int id = getNextId(TraceObject.SAVEPOINT);
......@@ -813,12 +809,12 @@ public class JdbcConnection extends TraceObject implements Connection {
throw logAndConvert(e);
}
}
//#endif
//#endif
/**
* Rolls back to a savepoint.
*/
//#ifdef JDK14
//#ifdef JDK14
public void rollback(Savepoint savepoint) throws SQLException {
try {
JdbcSavepoint sp = convertSavepoint(savepoint);
......@@ -829,12 +825,12 @@ public class JdbcConnection extends TraceObject implements Connection {
throw logAndConvert(e);
}
}
//#endif
//#endif
/**
* Releases a savepoint.
*/
//#ifdef JDK14
//#ifdef JDK14
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
try {
debugCode("releaseSavepoint(savepoint);");
......@@ -851,7 +847,7 @@ public class JdbcConnection extends TraceObject implements Connection {
}
return (JdbcSavepoint) savepoint;
}
//#endif
//#endif
/**
* Creates a prepared statement with the specified result set type, concurrency, and holdability.
......@@ -1210,7 +1206,7 @@ public class JdbcConnection extends TraceObject implements Connection {
}
protected void finalize() {
if(!Constants.RUN_FINALIZERS) {
if(!Constants.RUN_FINALIZE) {
return;
}
if(isInternal) {
......@@ -1308,7 +1304,7 @@ public class JdbcConnection extends TraceObject implements Connection {
*
* @return the object
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public NClob createNClob() throws SQLException {
try {
......@@ -1323,43 +1319,40 @@ public class JdbcConnection extends TraceObject implements Connection {
}
}
*/
//#endif
//#endif
/**
* Create a new empty SQLXML object.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Create a new empty SQLXML object.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public SQLXML createSQLXML() throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Create a new empty Array object.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Create a new empty Array object.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Create a new empty Struct object.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Create a new empty Struct object.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Returns true if this connection is still valid.
......@@ -1380,72 +1373,66 @@ public class JdbcConnection extends TraceObject implements Connection {
}
/**
* Set a client property.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Set a client property.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public void setClientInfo(String name, String value) throws SQLClientInfoException {
throw new SQLClientInfoException();
}
*/
//#endif
//#endif
/**
* Set the client properties.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Set the client properties.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public void setClientInfo(Properties properties) throws SQLClientInfoException {
throw new SQLClientInfoException();
}
*/
//#endif
//#endif
/**
* Get the client properties.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Get the client properties.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public Properties getClientInfo() throws SQLClientInfoException {
throw new SQLClientInfoException();
}
*/
//#endif
//#endif
/**
* Set a client property.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Set a client property.
*/
public String getClientInfo(String name) throws SQLException {
throw Message.getUnsupportedException();
}
/**
* Return an object of this class if possible.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Return an object of this class if possible.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public <T> T unwrap(Class<T> iface) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Checks if unwrap can return an object of this class.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Checks if unwrap can return an object of this class.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
Value createClob(Reader x, long length) throws SQLException {
if(x == null) {
......
......@@ -2403,10 +2403,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
}
/**
* THIS FEATURE IS NOT SUPPORTED.
*
* @throws SQLException
* Unsupported Feature (SQL State 0A000)
* [Not supported]
*/
public ResultSet getSuperTypes(String catalog, String schemaPattern,
String typeNamePattern) throws SQLException {
......@@ -2460,10 +2457,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
}
/**
* THIS FEATURE IS NOT SUPPORTED.
*
* @throws SQLException
* Unsupported Feature (SQL State 0A000)
* [Not supported]
*/
public ResultSet getAttributes(String catalog, String schemaPattern,
String typeNamePattern, String attributeNamePattern)
......@@ -2599,18 +2593,17 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* Get the lifetime of a rowid.
* @return ROWID_UNSUPPORTED
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public RowIdLifetime getRowIdLifetime() {
debugCodeCall("getRowIdLifetime");
return RowIdLifetime.ROWID_UNSUPPORTED;
}
*/
//#endif
//#endif
/**
* Gets the list of schemas.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Gets the list of schemas.
*/
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
debugCodeCall("getSchemas");
......@@ -2636,8 +2629,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
}
/**
* Returns the client info properties.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Returns the client info properties.
*/
public ResultSet getClientInfoProperties() throws SQLException {
debugCodeCall("getClientInfoProperties");
......@@ -2645,34 +2637,31 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
}
/**
* Return an object of this class if possible.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Return an object of this class if possible.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Checks if unwrap can return an object of this class.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Checks if unwrap can return an object of this class.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Gets the list of function columns.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Gets the list of function columns.
*/
public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException {
debugCodeCall("getFunctionColumns");
......@@ -2680,8 +2669,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
}
/**
* Gets the list of functions.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Gets the list of functions.
*/
public ResultSet getFunctions(String arg0, String arg1, String arg2) throws SQLException {
debugCodeCall("getFunctions");
......
......@@ -186,29 +186,27 @@ implements ParameterMetaData
}
/**
* Return an object of this class if possible.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Return an object of this class if possible.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Checks if unwrap can return an object of this class.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Checks if unwrap can return an object of this class.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
}
......@@ -192,7 +192,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public ResultSet executeQuery(String sql) throws SQLException {
try {
......@@ -206,7 +206,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public void addBatch(String sql) throws SQLException {
try {
......@@ -220,7 +220,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public int executeUpdate(String sql) throws SQLException {
try {
......@@ -234,7 +234,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public boolean execute(String sql) throws SQLException {
try {
......@@ -557,9 +557,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
/**
* Sets the value of a column as a reference.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Sets the value of a column as a reference.
*/
public void setRef(int parameterIndex, Ref x) throws SQLException {
try {
......@@ -642,11 +640,8 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
/**
* This feature is deprecated and not supported.
*
* [Not supported] This feature is deprecated and not supported.
* @deprecated
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
*/
public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
try {
......@@ -774,9 +769,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
/**
* Sets the value of a parameter as a Array.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Sets the value of a parameter as a Array.
*/
public void setArray(int parameterIndex, Array x) throws SQLException {
try {
......@@ -943,9 +936,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
/**
* THIS FEATURE IS NOT SUPPORTED.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported]
*/
public void setURL(int parameterIndex, URL x) throws SQLException {
try {
......@@ -959,7 +950,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
/**
* Gets the result set metadata of the query returned when the statement is executed.
* [Not supported] Gets the result set metadata of the query returned when the statement is executed.
*
* @return null as the method is not supported
* @throws SQLException if this object is closed
......@@ -974,7 +965,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
}
/**
* Clears the batch.
*/
......@@ -1083,7 +1073,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
try {
......@@ -1100,7 +1090,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
try {
......@@ -1116,7 +1106,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public int executeUpdate(String sql, String[] columnNames) throws SQLException {
try {
......@@ -1132,7 +1122,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
try {
......@@ -1148,7 +1138,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public boolean execute(String sql, int[] columnIndexes) throws SQLException {
try {
......@@ -1164,7 +1154,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
/**
* Calling this method is not legal on a PreparedStatement.
*
* @throws SQLException Unsupported Feature (SQL State 0A000)
* @throws SQLException Unsupported Feature
*/
public boolean execute(String sql, String[] columnNames) throws SQLException {
try {
......@@ -1219,16 +1209,15 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
/**
* Sets the value of a parameter as a row id.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Sets the value of a parameter as a row id.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public void setRowId(int parameterIndex, RowId x) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Sets the value of a parameter.
......@@ -1288,7 +1277,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @param x the value
* @throws SQLException if this object is closed
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public void setNClob(int parameterIndex, NClob x) throws SQLException {
try {
......@@ -1308,7 +1297,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
}
*/
//#endif
//#endif
/**
* Sets the value of a parameter as a Clob.
......@@ -1391,15 +1380,14 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
/**
* Sets the value of a parameter as a SQLXML object.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Sets the value of a parameter as a SQLXML object.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public void setSQLXML(int parameterIndex, SQLXML x) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
}
......@@ -406,29 +406,27 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
}
/**
* Return an object of this class if possible.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Return an object of this class if possible.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public <T> T unwrap(Class<T> iface) throws SQLException {
debugCodeCall("unwrap");
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Checks if unwrap can return an object of this class.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Checks if unwrap can return an object of this class.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
debugCodeCall("isWrapperFor");
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
}
......@@ -91,7 +91,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* @return the update count (number of row affected by an insert,
* update or delete, or 0 if no rows or the statement was a
* create, drop, commit or rollback)
* @throws SQLException if a database error occured or a
* @throws SQLException if a database error occurred or a
* select statement was executed
*/
public int executeUpdate(String sql) throws SQLException {
......@@ -487,7 +487,7 @@ public class JdbcStatement extends TraceObject implements Statement {
}
/**
* Cancels a currently running statement.
* [Partially supported] Cancels a currently running statement.
* This method must be called from within another
* thread than the execute method.
* This method is not supported in the server mode.
......@@ -636,8 +636,7 @@ public class JdbcStatement extends TraceObject implements Statement {
}
/**
* THIS FEATURE IS NOT SUPPORTED.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported]
*/
public boolean getMoreResults(int current) throws SQLException {
try {
......@@ -656,7 +655,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* @return the update count (number of row affected by an insert,
* update or delete, or 0 if no rows or the statement was a
* create, drop, commit or rollback)
* @throws SQLException if a database error occured or a
* @throws SQLException if a database error occurred or a
* select statement was executed
*/
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
......@@ -678,7 +677,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* @return the update count (number of row affected by an insert,
* update or delete, or 0 if no rows or the statement was a
* create, drop, commit or rollback)
* @throws SQLException if a database error occured or a
* @throws SQLException if a database error occurred or a
* select statement was executed
*/
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
......@@ -700,7 +699,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* @return the update count (number of row affected by an insert,
* update or delete, or 0 if no rows or the statement was a
* create, drop, commit or rollback)
* @throws SQLException if a database error occured or a
* @throws SQLException if a database error occurred or a
* select statement was executed
*/
public int executeUpdate(String sql, String[] columnNames) throws SQLException {
......@@ -722,7 +721,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* @return the update count (number of row affected by an insert,
* update or delete, or 0 if no rows or the statement was a
* create, drop, commit or rollback)
* @throws SQLException if a database error occured or a
* @throws SQLException if a database error occurred or a
* select statement was executed
*/
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
......@@ -744,7 +743,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* @return the update count (number of row affected by an insert,
* update or delete, or 0 if no rows or the statement was a
* create, drop, commit or rollback)
* @throws SQLException if a database error occured or a
* @throws SQLException if a database error occurred or a
* select statement was executed
*/
public boolean execute(String sql, int[] columnIndexes) throws SQLException {
......@@ -766,7 +765,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* @return the update count (number of row affected by an insert,
* update or delete, or 0 if no rows or the statement was a
* create, drop, commit or rollback)
* @throws SQLException if a database error occured or a
* @throws SQLException if a database error occurred or a
* select statement was executed
*/
public boolean execute(String sql, String[] columnNames) throws SQLException {
......@@ -847,28 +846,26 @@ public class JdbcStatement extends TraceObject implements Statement {
}
/**
* Return an object of this class if possible.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Return an object of this class if possible.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public <T> T unwrap(Class<T> iface) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Checks if unwrap can return an object of this class.
* @throws SQLException Unsupported Feature (SQL State 0A000)
* [Not supported] Checks if unwrap can return an object of this class.
*/
//#ifdef JDK16
//#ifdef JDK16
/*
public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw Message.getUnsupportedException();
}
*/
//#endif
//#endif
/**
* Returns whether this object is poolable.
......@@ -892,7 +889,7 @@ public class JdbcStatement extends TraceObject implements Statement {
}
// public void finalize() {
// if(!Database.RUN_FINALIZERS) {
// if(!Constants.RUN_FINALIZE) {
// return;
// }
// closeOld();
......
......@@ -10,8 +10,8 @@ import org.h2.jdbc.JdbcConnection;
public interface JdbcConnectionListener {
// TODO pooled connection: make sure fatalErrorOccured is called in the right situations
void fatalErrorOccured(JdbcConnection conn, SQLException e) throws SQLException;
// TODO pooled connection: make sure fatalErrorOccurred is called in the right situations
void fatalErrorOccurred(JdbcConnection conn, SQLException e) throws SQLException;
void closed(JdbcConnection conn);
}
......@@ -52,8 +52,8 @@ Serializable, Referenceable {
private String url = "";
public JdbcDataSource() {
int id = getNextId(TraceObject.DATASOURCE);
setTrace(factory.getTrace(), TraceObject.DATASOURCE, id);
int id = getNextId(TraceObject.DATA_SOURCE);
setTrace(factory.getTrace(), TraceObject.DATA_SOURCE, id);
}
public int getLoginTimeout() throws SQLException {
......@@ -138,13 +138,13 @@ Serializable, Referenceable {
//#ifdef JDK14
public XAConnection getXAConnection() throws SQLException {
debugCodeCall("getXAConnection");
int id = getNextId(XA_DATASOURCE);
int id = getNextId(XA_DATA_SOURCE);
return new JdbcXAConnection(factory, id, url, user, password);
}
public XAConnection getXAConnection(String user, String password) throws SQLException {
debugCode("getXAConnection("+quote(user)+", "+quote(password)+");");
int id = getNextId(XA_DATASOURCE);
int id = getNextId(XA_DATA_SOURCE);
return new JdbcXAConnection(factory, id, url, user, password);
}
......
......@@ -45,7 +45,7 @@ implements XAConnection, XAResource, JdbcConnectionListener
JdbcXAConnection(JdbcDataSourceFactory factory, int id, String url, String user, String password) {
this.factory = factory;
setTrace(factory.getTrace(), TraceObject.XA_DATASOURCE, id);
setTrace(factory.getTrace(), TraceObject.XA_DATA_SOURCE, id);
this.url = url;
this.user = user;
this.password = password;
......@@ -85,8 +85,8 @@ implements XAConnection, XAResource, JdbcConnectionListener
listeners.remove(listener);
}
public void fatalErrorOccured(JdbcConnection conn, SQLException e) throws SQLException {
debugCode("fatalErrorOccured(conn, e)");
public void fatalErrorOccurred(JdbcConnection conn, SQLException e) throws SQLException {
debugCode("fatalErrorOccurred(conn, e)");
for(int i=0; i<listeners.size(); i++) {
ConnectionEventListener listener = (ConnectionEventListener)listeners.get(i);
ConnectionEvent event = new ConnectionEvent(this, e);
......
......@@ -68,12 +68,12 @@ public class Message {
}
public static SQLException getSyntaxError(String sql, int index) {
sql = StringUtils.addAsterix(sql, index);
sql = StringUtils.addAsterisk(sql, index);
return Message.getSQLException(Message.SYNTAX_ERROR_1, sql);
}
public static SQLException getSyntaxError(String sql, int index, String expected) {
sql = StringUtils.addAsterix(sql, index);
sql = StringUtils.addAsterisk(sql, index);
return Message.getSQLException(Message.SYNTAX_ERROR_2, new String[]{sql, expected}, null);
}
......@@ -232,7 +232,7 @@ public class Message {
public static final int MUST_GROUP_BY_COLUMN_1 = 90016;
public static final int SECOND_PRIMARY_KEY = 90017;
public static final int TRACE_CONNECTION_NOT_CLOSED = 90018;
public static final int CANT_DROP_CURRENT_USER = 90019;
public static final int CANNOT_DROP_CURRENT_USER = 90019;
public static final int DATABASE_ALREADY_OPEN_1 = 90020;
public static final int DATA_CONVERSION_ERROR_1 = 90021;
public static final int FUNCTION_NOT_FOUND_1 = 90022;
......@@ -297,7 +297,7 @@ public class Message {
public static final int COLUMN_CONTAINS_NULL_VALUES_1 = 90081;
public static final int SEQUENCE_BELONGS_TO_A_TABLE_1 = 90082;
public static final int COLUMN_MAY_BE_REFERENCED_1 = 90083;
public static final int CANT_DROP_LAST_COLUMN = 90084;
public static final int CANNOT_DROP_LAST_COLUMN = 90084;
public static final int INDEX_BELONGS_TO_CONSTRAINT_1 = 90085;
public static final int CLASS_NOT_FOUND_1 = 90086;
public static final int METHOD_NOT_FOUND_1 = 90087;
......@@ -319,8 +319,8 @@ public class Message {
public static final int UNSUPPORTED_COMPRESSION_ALGORITHM_1 = 90103;
public static final int COMPRESSION_ERROR = 90104;
private static final int EXCEPTION_IN_FUNCTION = 90105;
public static final int CANT_TRUNCATE_1 = 90106;
public static final int CANT_DROP_2 = 90107;
public static final int CANNOT_TRUNCATE_1 = 90106;
public static final int CANNOT_DROP_2 = 90107;
public static final int STACK_OVERFLOW = 90108;
public static final int VIEW_IS_INVALID_1 = 90109;
public static final int OVERFLOW_FOR_TYPE_1 = 90110;
......@@ -331,14 +331,15 @@ public class Message {
public static final int CONSTANT_NOT_FOUND_1 = 90115;
public static final int LITERALS_ARE_NOT_ALLOWED = 90116;
public static final int REMOTE_CONNECTION_NOT_ALLOWED = 90117;
public static final int CANT_DROP_TABLE_1 = 90118;
public static final int CANNOT_DROP_TABLE_1 = 90118;
public static final int USER_DATA_TYPE_ALREADY_EXISTS_1 = 90119;
public static final int USER_DATA_TYPE_NOT_FOUND_1 = 90120;
public static final int DATABASE_CALLED_AT_SHUTDOWN = 90121;
public static final int OPERATION_NOT_SUPPORTED_WITH_VIEWS_2 = 90122;
public static final int CANT_MIX_INDEXED_AND_UNINDEXED_PARAMS = 90123;
public static final int CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMS = 90123;
public static final int FILE_NOT_FOUND_1 = 90124;
public static final int INVALID_CLASS_2 = 90125;
public static final int DATABASE_IS_NOT_PERSISTENT = 90126;
public static SQLException addSQL(SQLException e, String sql) {
if(e.getMessage().indexOf("SQL")>=0) {
......
......@@ -13,17 +13,12 @@ import java.sql.SQLException;
import org.h2.engine.Constants;
import org.h2.util.StringUtils;
/**
*
* @author tgdmuth6
*
*/
public class TraceObject {
public static final int CALLABLE_STATEMENT = 0, CONNECTION = 1, DATABASE_META_DATA = 2,
PREPARED_STATEMENT = 3, RESULT_SET = 4, RESULT_SET_META_DATA = 5,
SAVEPOINT = 6, SQL_EXCEPTION = 7, STATEMENT = 8, BLOB = 9, CLOB = 10,
PARAMETER_META_DATA = 11;
public static final int DATASOURCE = 12, XA_DATASOURCE = 13, XID = 14;
public static final int DATA_SOURCE = 12, XA_DATA_SOURCE = 13, XID = 14;
private static int LAST = XID + 1;
private Trace trace;
......
......@@ -218,7 +218,7 @@ public class TraceSystem {
}
protected void finalize() {
if(!Constants.RUN_FINALIZERS) {
if(!Constants.RUN_FINALIZE) {
return;
}
close();
......
......@@ -533,6 +533,7 @@ Removes all rows from a table.
Other than DELETE FROM without where clause, this command can not be rolled back.
This command is faster than DELETE without where clause.
Only regular data tables without foreign key constraints can be truncated.
This command commits an open transaction.
","
TRUNCATE TABLE TEST
"
......@@ -2371,22 +2372,24 @@ CURRVAL('TESTSEQ')
"
"Functions (System)","CSVREAD","
CSVREAD(fileNameString [, columnNamesString [, charsetString]]): resultSet
CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparator]]]): resultSet
","
Returns the result set of reading the CSV (comma separated values) file.
If the column names are specified (a comma separated list of column names),
those are used they are read from the file, otherwise (or if they are set to NULL) the first line
of the file is interpreted as the column names.
The default charset is the default value for this system, and the default field separator is a comma.
Admin rights are required to execute this command.
","
CALL CSVREAD('test.csv')
"
"Functions (System)","CSVWRITE","
CSVWRITE(fileNameString, queryString [, charsetString]): null
CSVWRITE(fileNameString, queryString [, charsetString [, fieldSeparator]]): null
","
Writes a CSV (comma separated values).
The file is overwritten if it exists.
The default charset is the default value for this system, and the default field separator is a comma.
Admin rights are required to execute this command.
","
CALL CSVWRITE('test.csv', 'SELECT * FROM TEST')
......
......@@ -146,6 +146,7 @@
90123=Cannot mix indexed and non-indexed parameters
90124=File not found: {0}
90125=Invalid class, expected {0} but got {1}
90126=Database is not persistent
HY000=General error: {0}
HY004=Unknown data type: {0}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论