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

Javadocs

上级 c205a5be
......@@ -39,8 +39,12 @@ public class Driver implements java.sql.Driver {
}
/**
* Open a database connection.
* This method should not be called by an application.
* Instead, the method DriverManager.getConnection should be used.
*
* @param url the database URL
* @param info the connection properties
* @return the new connection
*/
public Connection connect(String url, Properties info) throws SQLException {
......@@ -58,8 +62,10 @@ public class Driver implements java.sql.Driver {
}
/**
* Check if the driver understands this URL.
* This method should not be called by an application.
*
* @param url the database URL
* @return if the driver understands the URL
*/
public boolean acceptsURL(String url) {
......@@ -67,6 +73,7 @@ public class Driver implements java.sql.Driver {
}
/**
* Get the major version number of the driver.
* This method should not be called by an application.
*
* @return the major version number
......@@ -76,6 +83,7 @@ public class Driver implements java.sql.Driver {
}
/**
* Get the minor version number of the driver.
* This method should not be called by an application.
*
* @return the minor version number
......@@ -85,8 +93,11 @@ public class Driver implements java.sql.Driver {
}
/**
* Get the list of supported properties.
* This method should not be called by an application.
*
* @param url the database URL
* @param info the connection properties
* @return a zero length array
*/
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) {
......@@ -94,6 +105,7 @@ public class Driver implements java.sql.Driver {
}
/**
* Check if this driver is compliant to the JDBC specification.
* This method should not be called by an application.
*
* @return true
......
......@@ -3074,6 +3074,7 @@ public class Parser {
* Checks if this string is a SQL keyword.
*
* @param s the token to check
* @param supportOffsetFetch if OFFSET and FETCH are keywords
* @return true if it is a keyword
*/
public static boolean isKeyword(String s, boolean supportOffsetFetch) {
......
......@@ -511,6 +511,7 @@ public class Session implements SessionInterface {
* Partially roll back the current transaction.
*
* @param index the position to which should be rolled back
* @param trimToSize if the list should be trimmed
*/
public void rollbackTo(int index, boolean trimToSize) throws SQLException {
while (undoLog.size() > index) {
......
......@@ -406,6 +406,7 @@ public class SessionRemote implements SessionInterface, SessionFactory, DataHand
*
* @param e the exception (used for debugging)
* @param i the index of the server to remove
* @param count the retry count index
*/
public void removeServer(IOException e, int i, int count) throws SQLException {
transferList.remove(i);
......@@ -426,6 +427,7 @@ public class SessionRemote implements SessionInterface, SessionFactory, DataHand
/**
* Automatically re-connect if necessary and if configured to do so.
*
* @param count the retry count index
* @return true if reconnected
*/
public boolean autoReconnect(int count) throws SQLException {
......
......@@ -190,6 +190,7 @@ public interface Index extends SchemaObject {
* allowed using the current compatibility mode for unique indexes. Note:
* NULL behavior is complicated in SQL.
*
* @param session the session
* @param newRow the row to check
* @return true if one of the columns is null and multiple nulls in unique
* indexes are allowed
......
......@@ -125,7 +125,6 @@ abstract class PageData extends Record {
/**
* Split the index page at the given point.
*
* @param session the session
* @param splitPoint the index where to split
* @return the new page that contains about half the entries
*/
......@@ -185,6 +184,7 @@ abstract class PageData extends Record {
/**
* Get the row for the given key.
*
* @param session the session
* @param key the key
* @return the row
*/
......
......@@ -85,6 +85,7 @@ class PageDataLeaf extends PageData {
* Add a row if possible. If it is possible this method returns 0, otherwise
* the split point. It is always possible to add one row.
*
* @param row the now to add
* @return the split point of this page, or 0 if no split is required
*/
int addRow(Row row) throws SQLException {
......
......@@ -878,6 +878,7 @@ public class JdbcConnection extends TraceObject implements Connection {
/**
* Creates a new named savepoint.
*
* @param name the savepoint name
* @return the new savepoint
*/
//## Java 1.4 begin ##
......@@ -900,6 +901,8 @@ public class JdbcConnection extends TraceObject implements Connection {
/**
* Rolls back to a savepoint.
*
* @param savepoint the savepoint
*/
//## Java 1.4 begin ##
public void rollback(Savepoint savepoint) throws SQLException {
......@@ -916,6 +919,8 @@ public class JdbcConnection extends TraceObject implements Connection {
/**
* Releases a savepoint.
*
* @param savepoint the savepoint to release
*/
//## Java 1.4 begin ##
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
......@@ -1408,6 +1413,8 @@ public class JdbcConnection extends TraceObject implements Connection {
/**
* Returns true if this connection is still valid.
*
* @param timeout the number of seconds to wait for the database to respond
* (ignored)
* @return true if the connection is valid.
*/
public synchronized boolean isValid(int timeout) {
......
......@@ -1445,6 +1445,8 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether CONVERT is supported for one datatype to another.
*
* @param fromType the source SQL type
* @param toType the target SQL type
* @return true
*/
public boolean supportsConvert(int fromType, int toType) {
......@@ -1983,6 +1985,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether a specific transaction isolation level is supported.
*
* @param level the transaction isolation level (Connection.TRANSACTION_*)
* @return true
*/
public boolean supportsTransactionIsolationLevel(int level) {
......@@ -2035,6 +2038,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* Returns whether a specific result set type is supported.
* ResultSet.TYPE_SCROLL_SENSITIVE is not supported.
*
* @param type the result set type
* @return true for all types except ResultSet.TYPE_FORWARD_ONLY
*/
public boolean supportsResultSetType(int type) {
......@@ -2046,6 +2050,8 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* Returns whether a specific result set concurrency is supported.
* ResultSet.TYPE_SCROLL_SENSITIVE is not supported.
*
* @param type the result set type
* @param concurrency the result set concurrency
* @return true if the type is not ResultSet.TYPE_SCROLL_SENSITIVE
*/
public boolean supportsResultSetConcurrency(int type, int concurrency) {
......@@ -2058,6 +2064,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether own updates are visible.
*
* @param type the result set type
* @return true
*/
public boolean ownUpdatesAreVisible(int type) {
......@@ -2068,6 +2075,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether own deletes are visible.
*
* @param type the result set type
* @return false
*/
public boolean ownDeletesAreVisible(int type) {
......@@ -2078,6 +2086,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether own inserts are visible.
*
* @param type the result set type
* @return false
*/
public boolean ownInsertsAreVisible(int type) {
......@@ -2088,6 +2097,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether other updates are visible.
*
* @param type the result set type
* @return false
*/
public boolean othersUpdatesAreVisible(int type) {
......@@ -2098,6 +2108,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether other deletes are visible.
*
* @param type the result set type
* @return false
*/
public boolean othersDeletesAreVisible(int type) {
......@@ -2108,6 +2119,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether other inserts are visible.
*
* @param type the result set type
* @return false
*/
public boolean othersInsertsAreVisible(int type) {
......@@ -2118,6 +2130,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether updates are detected.
*
* @param type the result set type
* @return false
*/
public boolean updatesAreDetected(int type) {
......@@ -2128,6 +2141,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether deletes are detected.
*
* @param type the result set type
* @return false
*/
public boolean deletesAreDetected(int type) {
......@@ -2138,6 +2152,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
/**
* Returns whether inserts are detected.
*
* @param type the result set type
* @return false
*/
public boolean insertsAreDetected(int type) {
......@@ -2522,16 +2537,20 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
}
/**
* Get the list of super tables of a table.
* This method currently returns an empty result set.
*
* Get the list of super tables of a table. This method currently returns an
* empty result set.
* <ul>
* <li>1 TABLE_CAT (String) table catalog
* </li><li>2 TABLE_SCHEM (String) table schema
* </li><li>3 TABLE_NAME (String) table name
* </li><li>4 SUPERTABLE_NAME (String) the name of the super table
* </li></ul>
* <li>1 TABLE_CAT (String) table catalog</li>
* <li>2 TABLE_SCHEM (String) table schema</li>
* <li>3 TABLE_NAME (String) table name</li>
* <li>4 SUPERTABLE_NAME (String) the name of the super table</li>
* </ul>
*
* @param catalog null (to get all objects) or the catalog name
* @param schemaPattern null (to get all objects) or a schema name (uppercase for
* unquoted names)
* @param tableNamePattern null (to get all objects) or a table name pattern
* (uppercase for unquoted names)
* @return an empty result set
*/
public ResultSet getSuperTables(String catalog, String schemaPattern,
......
......@@ -53,6 +53,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* If another result set exists for this statement, this will be closed
* (even if this statement fails).
*
* @param sql the SQL statement to execute
* @return the result set
*/
public ResultSet executeQuery(String sql) throws SQLException {
......@@ -135,6 +136,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* If auto commit is on, and the statement is not a select, this statement
* will be committed.
*
* @param sql the SQL statement to execute
* @return true if a result set is available, false if not
*/
public boolean execute(String sql) throws SQLException {
......@@ -569,6 +571,8 @@ public class JdbcStatement extends TraceObject implements Statement {
/**
* Adds a statement to the batch.
*
* @param sql the SQL statement
*/
public void addBatch(String sql) throws SQLException {
try {
......
......@@ -16,6 +16,8 @@ interface TraceWriter {
/**
* Set the name of the database or trace object.
*
* @param name the new name
*/
void setName(String name);
......
......@@ -343,6 +343,7 @@ public class Schema extends DbObjectBase {
/**
* Create a unique index name.
*
* @param session the session
* @param table the indexed table
* @param prefix the index name prefix
* @return the unique name
......@@ -471,6 +472,7 @@ public class Schema extends DbObjectBase {
* @param columns the column list
* @param persistent if the table should be persistent
* @param clustered if a clustered table should be created
* @param headPos the position (page number) of the head
* @return the created {@link TableData} object
*/
public TableData createTable(String tableName, int id, ObjectArray columns, boolean persistent, boolean clustered, int headPos)
......@@ -487,6 +489,7 @@ public class Schema extends DbObjectBase {
* @param url the database URL
* @param user the user name
* @param password the password
* @param originalSchema the schema name of the target table
* @param originalTable the table name of the target table
* @param emitUpdates if updates should be emitted instead of delete/insert
* @param force create the object even if the database can not be accessed
......
......@@ -187,6 +187,7 @@ public class BitField {
*
* @param start the index of the first bit to enable or disable
* @param len the number of bits to enable or disable
* @param value the new value
*/
public void setRange(int start, int len, boolean value) {
// go backwards so that OutOfMemory happens
......
......@@ -16,14 +16,18 @@ import org.osgi.framework.BundleContext;
public class DbDriverActivator implements BundleActivator {
/**
* Start the bundle. This will load the database driver.
* Start the bundle. This will load and register the database driver.
*
* @param bundleContext the bundle context
*/
public void start(BundleContext bundleContext) {
org.h2.Driver.load();
}
/**
* Stop the bundle. This will unload the database driver.
* Stop the bundle. This will deregister the database driver.
*
* @param bundleContext the bundle context
*/
public void stop(BundleContext bundleContext) {
org.h2.Driver.unload();
......
......@@ -775,6 +775,7 @@ public class StringUtils {
/**
* Check if a String is null or empty (the length is null).
*
* @param s the string to check
* @return true if it is null or empty
*/
public static boolean isNullOrEmpty(String s) {
......
......@@ -92,6 +92,8 @@ public class TestDeadlock extends TestBase {
/**
* Add the exception to the list of exceptions.
*
* @param e the exception
*/
void catchDeadlock(SQLException e) {
if (lastException != null) {
......
......@@ -76,6 +76,8 @@ public class TestAutoServer extends TestBase {
/**
* This method is called via reflection from the database.
*
* @param exitValue the exit value
*/
public static void halt(int exitValue) {
Runtime.getRuntime().halt(exitValue);
......
......@@ -130,6 +130,7 @@ class Command {
* Create a create table command.
*
* @param config the configuration
* @param table the table
* @return the command
*/
static Command getCreateTable(TestSynth config, Table table) {
......@@ -140,6 +141,7 @@ class Command {
* Create a create index command.
*
* @param config the configuration
* @param index the index
* @return the command
*/
static Command getCreateIndex(TestSynth config, Index index) {
......@@ -150,6 +152,7 @@ class Command {
* Create a random select command.
*
* @param config the configuration
* @param table the table
* @return the command
*/
static Command getRandomSelect(TestSynth config, Table table) {
......
......@@ -135,6 +135,8 @@ class Table {
/**
* Get the INSERT statement for this table.
*
* @param c the column list
* @param v the value list
* @return the SQL statement
*/
String getInsertSQL(Column[] c, Value[] v) {
......
......@@ -575,4 +575,4 @@ bleyl donald conservative offsets diabetes ansorg allocating osmond gluco
joachim mysqladmin sudo mysqld indicator wire ring relates expedites
approximated approximation dvan dsn dobysoft ebean syswow tmueller dbbench
connecturl problematic transformation lazy querydsl squill empire liq fle
xive evolving mssqlserver
xive evolving mssqlserver eric respond faulhaber fixing
......@@ -226,7 +226,17 @@ public class Doclet {
boolean hasComment = method.commentText() != null && method.commentText().trim().length() != 0;
writer.println(formatText(method.commentText()));
ParamTag[] paramTags = method.paramTags();
ThrowsTag[] throwsTags = method.throwsTags();
boolean hasThrowsTag = throwsTags != null && throwsTags.length > 0;
boolean space = false;
if (paramTags.length != params.length) {
if (hasComment && !method.commentText().startsWith("[") && !hasThrowsTag) {
// [Not supported] and such are not problematic
// also not problematic are methods that always throw an exception
addError("Undocumented parameter(s) (" +
clazz.name() + ".java:" + method.position().line() + ") " + name + " documented: " + paramTags.length + " params: "+ params.length);
}
}
for (int j = 0; j < paramTags.length; j++) {
if (!space) {
writer.println("<br /><br />");
......@@ -245,8 +255,6 @@ public class Doclet {
writer.println("<div class=\"item\">" + p + "</div>");
}
Tag[] returnTags = method.tags("return");
ThrowsTag[] throwsTags = method.throwsTags();
boolean hasThrowsTag = throwsTags != null && throwsTags.length > 0;
if (returnTags != null && returnTags.length > 0) {
if (!space) {
writer.println("<br /><br />");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论