# HG changeset patch # User lancea # Date 1523048464 14400 # Node ID 729f80d0cf312ac8097a090b3cf6fda2772a58ca # Parent 9171771664eea415a8fd0949b509e982592a50c6 JDK-8188051-branch javadoc and minor updates diff -r 9171771664ee -r 729f80d0cf31 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/AdbaType.java --- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/AdbaType.java Mon Apr 02 15:52:50 2018 -0400 +++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/AdbaType.java Fri Apr 06 17:01:04 2018 -0400 @@ -26,227 +26,204 @@ package jdk.incubator.sql2; /** - * Remove dependence on java.sql. + *
Defines the constants that are used to identify generic
+ * SQL types, called JDBC types.
+ *
+ * @see SqlType
+ * @since 1.8
*/
public enum AdbaType implements SqlType {
-
- /**
- *
- */
- ARRAY,
-
- /**
- *
- */
- BIGINT,
-
- /**
- *
- */
- BINARY,
-
- /**
- *
- */
- BIT,
-
- /**
- *
- */
- BOOLEAN,
-
- /**
- *
- */
- CHAR,
-
- /**
- *
- */
- CLOB,
-
- /**
- *
- */
- CURSOR,
-
- /**
- *
- */
- DATALINK,
-
- /**
- *
- */
- DATE,
-
- /**
- *
- */
- DECIMAL,
-
- /**
- *
- */
- DISTINCT,
-
- /**
- *
- */
- DOUBLE,
-
- /**
- *
- */
- FLOAT,
-
- /**
- *
- */
- INTEGER,
-
- /**
- *
- */
- JAVA_OBJECT,
-
- /**
- *
- */
- LONGNVARCHAR,
-
- /**
- *
- */
- LONGVARBINARY,
-
- /**
- *
- */
- LONGVARCHAR,
+
+ /**
+ * Identifies the generic SQL type {@code BIT}.
+ */
+ BIT,
+ /**
+ * Identifies the generic SQL type {@code TINYINT}.
+ */
+ TINYINT,
+ /**
+ * Identifies the generic SQL type {@code SMALLINT}.
+ */
+ SMALLINT,
+ /**
+ * Identifies the generic SQL type {@code INTEGER}.
+ */
+ INTEGER,
+ /**
+ * Identifies the generic SQL type {@code BIGINT}.
+ */
+ BIGINT,
+ /**
+ * Identifies the generic SQL type {@code FLOAT}.
+ */
+ FLOAT,
+ /**
+ * Identifies the generic SQL type {@code REAL}.
+ */
+ REAL,
+ /**
+ * Identifies the generic SQL type {@code DOUBLE}.
+ */
+ DOUBLE,
+ /**
+ * Identifies the generic SQL type {@code NUMERIC}.
+ */
+ NUMERIC,
+ /**
+ * Identifies the generic SQL type {@code DECIMAL}.
+ */
+ DECIMAL,
+ /**
+ * Identifies the generic SQL type {@code CHAR}.
+ */
+ CHAR,
+ /**
+ * Identifies the generic SQL type {@code VARCHAR}.
+ */
+ VARCHAR,
+ /**
+ * Identifies the generic SQL type {@code LONGVARCHAR}.
+ */
+ LONGVARCHAR,
+ /**
+ * Identifies the generic SQL type {@code DATE}.
+ */
+ DATE,
+ /**
+ * Identifies the generic SQL type {@code TIME}.
+ */
+ TIME,
+ /**
+ * Identifies the generic SQL type {@code TIMESTAMP}.
+ */
+ TIMESTAMP,
+ /**
+ * Identifies the generic SQL type {@code BINARY}.
+ */
+ BINARY,
+ /**
+ * Identifies the generic SQL type {@code VARBINARY}.
+ */
+ VARBINARY,
+ /**
+ * Identifies the generic SQL type {@code LONGVARBINARY}.
+ */
+ LONGVARBINARY,
+ /**
+ * Identifies the generic SQL value {@code NULL}.
+ */
+ NULL,
+ /**
+ * Indicates that the SQL type
+ * is database-specific and gets mapped to a Java object that can be
+ * accessed via the methods getObject and setObject.
+ */
+ OTHER,
+ /**
+ * Indicates that the SQL type
+ * is database-specific and gets mapped to a Java object that can be
+ * accessed via the methods getObject and setObject.
+ */
+ JAVA_OBJECT,
+ /**
+ * Identifies the generic SQL type {@code DISTINCT}.
+ */
+ DISTINCT,
+ /**
+ * Identifies the generic SQL type {@code STRUCT}.
+ */
+ STRUCT,
+ /**
+ * Identifies the generic SQL type {@code ARRAY}.
+ */
+ ARRAY,
+ /**
+ * Identifies the generic SQL type {@code BLOB}.
+ */
+ BLOB,
+ /**
+ * Identifies the generic SQL type {@code CLOB}.
+ */
+ CLOB,
+ /**
+ * Identifies the generic SQL type {@code REF}.
+ */
+ REF,
+ /**
+ * Identifies the generic SQL type {@code DATALINK}.
+ */
+ DATALINK,
+ /**
+ * Identifies the generic SQL type {@code BOOLEAN}.
+ */
+ BOOLEAN,
- /**
- *
- */
- NCHAR,
-
- /**
- *
- */
- NCLOB,
-
- /**
- *
- */
- NULL,
-
- /**
- *
- */
- NUMERIC,
-
- /**
- *
- */
- NVARCHAR,
-
- /**
- *
- */
- OTHER,
-
- /**
- *
- */
- REAL,
-
- /**
- *
- */
- REF,
-
- /**
- *
- */
- REF_CURSOR,
-
- /**
- *
- */
- ROWID,
+ /**
+ * Identifies the SQL type {@code ROWID}.
+ */
+ ROWID,
+ /**
+ * Identifies the generic SQL type {@code NCHAR}.
+ */
+ NCHAR,
+ /**
+ * Identifies the generic SQL type {@code NVARCHAR}.
+ */
+ NVARCHAR,
+ /**
+ * Identifies the generic SQL type {@code LONGNVARCHAR}.
+ */
+ LONGNVARCHAR,
+ /**
+ * Identifies the generic SQL type {@code NCLOB}.
+ */
+ NCLOB,
+ /**
+ * Identifies the generic SQL type {@code SQLXML}.
+ */
+ SQLXML,
- /**
- *
- */
- SMALLINT,
-
- /**
- *
- */
- SQLXML,
+ /**
+ * Identifies the generic SQL type {@code REF_CURSOR}.
+ */
+ REF_CURSOR,
- /**
- *
- */
- STRUCT,
-
- /**
- *
- */
- TIME,
-
- /**
- *
- */
- TIMESTAMP,
+ /**
+ * Identifies the generic SQL type {@code TIME_WITH_TIMEZONE}.
+ */
+ TIME_WITH_TIMEZONE,
- /**
- *
- */
- TIME_WITH_TIME_ZONE,
-
- /**
- *
- */
- TIMESTAMP_WITH_TIME_ZONE,
-
- /**
- *
- */
- TINYINT,
+ /**
+ * Identifies the generic SQL type {@code TIMESTAMP_WITH_TIMEZONE}.
+ */
+ TIMESTAMP_WITH_TIMEZONE;
- /**
- *
- */
- VARBINARY,
-
- /**
- *
- */
- VARCHAR;
-
- /**
- *
- * @return
- */
+
+ /**
+ *{@inheritDoc }
+ * @return The name of this {@code SQLType}.
+ */
@Override
public String getName() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
- /**
- *
- * @return
- */
+ /**
+ * Returns the name of the vendor that supports this data type.
+ * @return The name of the vendor for this data type which is
+ * {@literal java.sql} for ABDAType.
+ */
@Override
public String getVendor() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
- /**
- *
- * @return
- */
+ /**
+ * Returns the vendor specific type number for the data type.
+ * @return An Integer representing the data type. For {@code ABDAType},
+ * the value will be the same value as in {@code Types} for the data type.
+ */
@Override
public Integer getVendorTypeNumber() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
diff -r 9171771664ee -r 729f80d0cf31 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ConnectionProperty.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ConnectionProperty.java Mon Apr 02 15:52:50 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ConnectionProperty.java Fri Apr 06 17:01:04 2018 -0400
@@ -54,7 +54,7 @@
* {@code true} if {@code value} is valid and {@code false} otherwise.
*
* @param value a value for this {@link ConnectionProperty}
- * @return {@code true} iff {@code value} is valid for this {@link ConnectionProperty}
+ * @return {@code true} if {@code value} is valid for this {@link ConnectionProperty}
*/
public default boolean validate(Object value) {
return (value == null && this.range() == Void.class) || this.range().isInstance(value);
@@ -74,7 +74,7 @@
* Returns true if this {@link ConnectionProperty} is contains sensitive information
* such as a password or encryption key.
*
- * @return true iff this is sensitive
+ * @return true if this is sensitive
*/
public boolean isSensitive();
@@ -87,7 +87,7 @@
* in the {@link Connection.Builder#property} method. ConnectionProperties known to the implementation
* may return {@code null} and rely on the implementation to do the right thing.
*
- * @param
+ * @param Operation Type
* @param group an {@link OperationGroup} which will be the container of the returned
* {@link Operation}, if any
* @param value the value to which the property is to be set. May be null if
diff -r 9171771664ee -r 729f80d0cf31 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/DataSourceFactory.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/DataSourceFactory.java Mon Apr 02 15:52:50 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/DataSourceFactory.java Fri Apr 06 17:01:04 2018 -0400
@@ -24,7 +24,9 @@
*/
package jdk.incubator.sql2;
+import java.util.Objects;
import java.util.ServiceLoader;
+import java.util.ServiceLoader.Provider;
/**
* This interface supports injecting a {@link DataSourceFactory}. The SPI
@@ -41,11 +43,17 @@
* @param name the name of the class that implements the factory
* @return a {@link DataSourceFactory} for {@code name} or {@code null} if one
* is not found
+ * @throws NullPointerException if name is {@code null}
*/
public static DataSourceFactory forName(String name) {
- if (name == null) throw new IllegalArgumentException("DataSourceFactory name is null");
- return ServiceLoader.load(DataSourceFactory.class).stream()
- .filter(p -> p.type().getName().equals(name)).findFirst().get().get();
+ Objects.requireNonNull(name, "DataSourceFactory name is null");
+ return ServiceLoader
+ .load(DataSourceFactory.class)
+ .stream()
+ .filter(p -> p.type().getName().equals(name))
+ .findFirst()
+ .map(Provider::get)
+ .orElse(null);
}
/**
diff -r 9171771664ee -r 729f80d0cf31 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/DynamicMultiOperation.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/DynamicMultiOperation.java Mon Apr 02 15:52:50 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/DynamicMultiOperation.java Fri Apr 06 17:01:04 2018 -0400
@@ -79,7 +79,7 @@
*
* If this method is not called any row sequence result is ignored.
*
- * @param handler
+ * @param handler the error handler for this operation
* @return This DynamicMultiOperation
* @throws IllegalStateException if the RowOperation has not been submitted
* when the call to the handler returns
@@ -109,7 +109,7 @@
* handler returns the {@link Operation} is completed exceptionally with the
* {@link Throwable}.
*
- * @param handler
+ * @param handler the error handler for this operation
* @return this DynamicMultiOperation
* @throws IllegalStateException if any onError method was called previously
*/
diff -r 9171771664ee -r 729f80d0cf31 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/Operation.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/Operation.java Mon Apr 02 15:52:50 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/Operation.java Fri Apr 06 17:01:04 2018 -0400
@@ -46,7 +46,7 @@
* {@link Operation} results in an error, before the Operation is completed,
* the handler is called with the {@link Throwable} as the argument.
*
- * @param handler
+ * @param handler the error handler for this operation
* @return this {@link Operation}
*/
public Operation