Changeset: 38292b17cc8c for monetdb-java
URL: http://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=38292b17cc8c
Modified Files:
src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java
src/main/java/nl/cwi/monetdb/util/Exporter.java
src/main/java/nl/cwi/monetdb/util/SQLExporter.java
Branch: embedded
Log Message:
Fixed misspelling on documentation
diffs (truncated from 3090 to 300 lines):
diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
@@ -1179,7 +1179,7 @@ public class MonetConnection extends Mon
*/
@Override
public void setReadOnly(boolean readOnly) throws SQLException {
- if (readOnly == true)
+ if (readOnly)
addWarning("cannot setReadOnly(true): read-only
Connection mode not supported", "01M08");
}
@@ -1571,7 +1571,6 @@ public class MonetConnection extends Mon
* Instructs the Response implementation to close and do the
* necessary clean up procedures.
*
- * @throws SQLException
*/
public abstract void close();
}
@@ -1603,9 +1602,9 @@ public class MonetConnection extends Mon
private String[] name;
/** The types of the columns in this result */
private String[] type;
- /** The max string length for each columns in this result */
+ /** The max string length for each column in this result */
private int[] columnLengths;
- /** The table for each columns in this result */
+ /** The table for each column in this result */
private String[] tableNames;
/** The query sequence number */
private final int seqnr;
@@ -1753,11 +1752,7 @@ public class MonetConnection extends Mon
*/
@Override
public boolean wantsMore() {
- if (isSet[LENS] && isSet[TYPES] && isSet[TABLES] &&
isSet[NAMES]) {
- return resultBlocks[0].wantsMore();
- } else {
- return true;
- }
+ return !(isSet[LENS] && isSet[TYPES] && isSet[TABLES]
&& isSet[NAMES]) || resultBlocks[0].wantsMore();
}
/**
@@ -1811,8 +1806,8 @@ public class MonetConnection extends Mon
if (!isSet[NAMES]) error += "name header missing\n";
if (!isSet[TYPES]) error += "type header missing\n";
if (!isSet[TABLES]) error += "table name header
missing\n";
- if (!isSet[LENS]) error += "columns width header
missing\n";
- if (error != "") throw new SQLException(error, "M0M10");
+ if (!isSet[LENS]) error += "column width header
missing\n";
+ if (!error.equals("")) throw new SQLException(error,
"M0M10");
}
/**
@@ -2008,7 +2003,7 @@ public class MonetConnection extends Mon
* <pre>
* [ "value", 56 ]
* </pre>
- * where each columns is separated by ",\t" and each tuple surrounded
+ * where each column is separated by ",\t" and each tuple surrounded
* by brackets ("[" and "]"). A DataBlockResponse object holds the
* raw data as read from the server, in a parsed manner, ready for
* easy retrieval.
@@ -2091,7 +2086,6 @@ public class MonetConnection extends Mon
* Instructs the Response implementation to close and do the
* necessary clean up procedures.
*
- * @throws SQLException
*/
@Override
public void close() {
@@ -2258,7 +2252,7 @@ public class MonetConnection extends Mon
this.maxrows = maxrows;
this.rstype = rstype;
this.rsconcur = rsconcur;
- responses = new ArrayList<Response>();
+ responses = new ArrayList<>();
curResponse = -1;
seqnr = MonetConnection.seqCounter++;
}
@@ -2452,7 +2446,7 @@ public class MonetConnection extends Mon
if (rsresponses == null)
rsresponses = new HashMap<Integer, ResultSetResponse>();
rsresponses.put(
-
Integer.valueOf(id),
+
id,
(ResultSetResponse) res
);
}
@@ -2467,7 +2461,7 @@ public class MonetConnection extends Mon
res = new SchemaResponse();
break;
case StartOfHeaderParser.Q_TRANS:
-
boolean ac = sohp.getNextAsString().equals("t") ? true : false;
+
boolean ac = sohp.getNextAsString().equals("t");
if (autoCommit && ac) {
addWarning("Server enabled auto commit " +
"mode while local state " +
@@ -2485,7 +2479,7 @@ public class MonetConnection extends Mon
int rowcount = sohp.getNextAsInt();
int offset = sohp.getNextAsInt();
ResultSetResponse t =
-
rsresponses.get(Integer.valueOf(id));
+
rsresponses.get(id);
if (t == null) {
error = "M0M12!no ResultSetResponse with id " + id + " found";
break;
@@ -2597,14 +2591,14 @@ public class MonetConnection extends Mon
if (error != null) {
SQLException ret = null;
String[] errors = error.split("\n");
- for (int i = 0; i < errors.length; i++)
{
+ for (String error1 : errors) {
if (ret == null) {
- ret = new
SQLException(errors[i].substring(6),
-
errors[i].substring(0, 5));
+ ret = new
SQLException(error1.substring(6),
+
error1.substring(0, 5));
} else {
ret.setNextException(new SQLException(
-
errors[i].substring(6),
-
errors[i].substring(0, 5)));
+
error1.substring(6),
+
error1.substring(0, 5)));
}
}
throw ret;
diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
b/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
@@ -87,7 +87,7 @@ public class MonetDatabaseMetaData exten
* we set it to close (and free server resources) when the ResultSet
object is closed by the caller.
*/
private ResultSet executeMetaDataQuery(String query) throws
SQLException {
- Statement stmt = null;
+ Statement stmt;
ResultSet rs = null;
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
if (stmt != null) {
@@ -180,8 +180,6 @@ public class MonetDatabaseMetaData exten
* By contrast, the method nullsAreSortedAtStart indicates whether NULL
values are sorted at the beginning regardless of sort order.
*
* @return true because MonetDB shows NULL values at the beginning upon
ORDER BY .. ASC
- *
- * @return negative of nullsAreSortedHigh()
* @see #nullsAreSortedHigh()
*/
@Override
@@ -433,7 +431,7 @@ public class MonetDatabaseMetaData exten
/**
* Internal utility method getConcatenatedStringFromQuery(String query)
- * args: query: SQL SELECT query. Only the output of the first columns
is concatenated.
+ * args: query: SQL SELECT query. Only the output of the first column
is concatenated.
* @return a String of query result values concatenated into one
string, and values separated by comma's
*/
private String getConcatenatedStringFromQuery(String query) {
@@ -443,7 +441,7 @@ public class MonetDatabaseMetaData exten
try {
st = con.createStatement();
rs = st.executeQuery(query);
- // Fetch the first columns output and concatenate the
values into a StringBuilder separated by comma's
+ // Fetch the first column output and concatenate the
values into a StringBuilder separated by comma's
boolean isfirst = true;
while (rs.next()) {
String value = rs.getString(1);
@@ -548,7 +546,7 @@ public class MonetDatabaseMetaData exten
}
/**
- * Is "ALTER TABLE" with an add columns supported?
+ * Is "ALTER TABLE" with an add column supported?
*
* @return true if so
*/
@@ -558,7 +556,7 @@ public class MonetDatabaseMetaData exten
}
/**
- * Is "ALTER TABLE" with a drop columns supported?
+ * Is "ALTER TABLE" with a drop column supported?
*
* @return true if so
*/
@@ -568,7 +566,7 @@ public class MonetDatabaseMetaData exten
}
/**
- * Is columns aliasing supported?
+ * Is column aliasing supported?
*
* <p>If so, the SQL AS clause can be used to provide names for
* computed columns or to provide alias names for columns as
@@ -580,7 +578,7 @@ public class MonetDatabaseMetaData exten
* select count(C) as C_COUNT from T group by C;
*
* </pre><br>
- * should return a columns named as C_COUNT instead of count(C)
+ * should return a column named as C_COUNT instead of count(C)
*
* @return true if so
*/
@@ -1343,14 +1341,14 @@ public class MonetDatabaseMetaData exten
}
/**
- * Whats the limit on columns name length.
+ * Whats the limit on column name length.
* I take some safety here, but it's just a varchar in MonetDB
*
- * @return the maximum columns name length
+ * @return the maximum column name length
*/
@Override
public int getMaxColumnNameLength() {
- return 1024; // In MonetDB the max length of columns
sys._columns.name is defined as 1024
+ return 1024; // In MonetDB the max length of column
sys._columns.name is defined as 1024
}
/**
@@ -1396,7 +1394,7 @@ public class MonetDatabaseMetaData exten
/**
* What is the maximum number of columns in a table?
*
- * The theoretical max value of int columns sys._columns.id is 2^31 -1
+ * The theoretical max value of int column sys._columns.id is 2^31 -1
* but this is for all columns of all tables in all schemas (including
all data dictionary columns).
* For one table we should reduce it to a more practical soft limit of
say 100 thousand
*
@@ -1466,7 +1464,7 @@ public class MonetDatabaseMetaData exten
*/
@Override
public int getMaxSchemaNameLength() {
- return 1024; // In MonetDB the max length of columns
sys.schemas.name is defined as 1024
+ return 1024; // In MonetDB the max length of column
sys.schemas.name is defined as 1024
}
/**
@@ -1476,7 +1474,7 @@ public class MonetDatabaseMetaData exten
*/
@Override
public int getMaxProcedureNameLength() {
- return 256; // In MonetDB the max length of columns
sys.functions.name is defined as 256
+ return 256; // In MonetDB the max length of column
sys.functions.name is defined as 256
}
/**
@@ -1541,7 +1539,7 @@ public class MonetDatabaseMetaData exten
*/
@Override
public int getMaxTableNameLength() {
- return 1024; // In MonetDB the max length of columns
sys._tables.name is defined as 1024
+ return 1024; // In MonetDB the max length of column
sys._tables.name is defined as 1024
}
/**
@@ -1562,7 +1560,7 @@ public class MonetDatabaseMetaData exten
*/
@Override
public int getMaxUserNameLength() {
- return 1024; // In MonetDB the max length of columns
sys.db_user_info.name is defined as 1024
+ return 1024; // In MonetDB the max length of column
sys.db_user_info.name is defined as 1024
}
/**
@@ -1743,22 +1741,22 @@ public class MonetDatabaseMetaData exten
* criteria are returned. They are ordered by PROCEDURE_SCHEM,
PROCEDURE_NAME
* and SPECIFIC_NAME. Within this, the return value, if any, is first.
* Next are the parameter descriptions in call order. The
- * columns descriptions follow in columns number order.
+ * column descriptions follow in column number order.
*
- * <p>Each row in the ResultSet is a parameter description or columns
+ * <p>Each row in the ResultSet is a parameter description or column
* description with the following fields:
* <ol>
* <li><b>PROCEDURE_CAT</b> String => procedure catalog (may be null)
* <li><b>PROCEDURE_SCHEM</b> String => procedure schema (may be null)
* <li><b>PROCEDURE_NAME</b> String => procedure name
- * <li><b>COLUMN_NAME</b> String => columns/parameter name
- * <li><b>COLUMN_TYPE</b> Short => kind of columns/parameter:
+ * <li><b>COLUMN_NAME</b> String => column/parameter name
+ * <li><b>COLUMN_TYPE</b> Short => kind of column/parameter:
* <ul><li>procedureColumnUnknown - nobody knows
* <li>procedureColumnIn - IN parameter
* <li>procedureColumnInOut - INOUT parameter
* <li>procedureColumnOut - OUT parameter
* <li>procedureColumnReturn - procedure return value
- * <li>procedureColumnResult - result columns in ResultSet
+ * <li>procedureColumnResult - result column in ResultSet
* </ul>
* <li><b>DATA_TYPE</b> int => SQL type from java.sql.Types
* <li><b>TYPE_NAME</b> String => SQL type name, for a UDT type the
type name is fully qualified
@@ -1771,8 +1769,8 @@ public class MonetDatabaseMetaData exten
* <li>procedureNullable - allows NULL values
* <li>procedureNullableUnknown - nullability unknown
* </ul>
- * <li><b>REMARKS</b> String => comment describing parameter/columns
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list