You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2013/08/29 02:36:31 UTC
svn commit: r1518431 - in
/jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc:
metadata/JenaMetadata.java metadata/MetadataSchema.java
statements/JenaStatement.java
Author: rvesse
Date: Thu Aug 29 00:36:31 2013
New Revision: 1518431
URL: http://svn.apache.org/r1518431
Log:
Fill in some more JDBC 4.1 implementations
Modified:
jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/JenaMetadata.java
jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/MetadataSchema.java
jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaStatement.java
Modified: jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/JenaMetadata.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/JenaMetadata.java?rev=1518431&r1=1518430&r2=1518431&view=diff
==============================================================================
--- jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/JenaMetadata.java (original)
+++ jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/JenaMetadata.java Thu Aug 29 00:36:31 2013
@@ -1219,12 +1219,14 @@ public abstract class JenaMetadata imple
@Override
public abstract boolean usesLocalFiles() throws SQLException;
+ @SuppressWarnings("javadoc")
public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
throws SQLException {
return new MetaResultSet(MetadataSchema.getPsuedoColumnColumns());
}
// Java 6/7 compatibility
+ @SuppressWarnings("javadoc")
public boolean generatedKeyAlwaysReturned() throws SQLException {
// We don't support returning keys
return false;
Modified: jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/MetadataSchema.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/MetadataSchema.java?rev=1518431&r1=1518430&r2=1518431&view=diff
==============================================================================
--- jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/MetadataSchema.java (original)
+++ jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/metadata/MetadataSchema.java Thu Aug 29 00:36:31 2013
@@ -207,7 +207,14 @@ public class MetadataSchema {
public static ColumnInfo[] getProcedureColumns() {
return PROCEDURE_COLUMNS;
}
-
+
+ /**
+ * Gets the columns for
+ * {@link JenaMetadata#getPseudoColumns(String, String, String, String)}
+ * method
+ *
+ * @return Column information
+ */
public static ColumnInfo[] getPsuedoColumnColumns() {
return PSUEDO_COLUMN_COLUMNS;
}
@@ -1083,7 +1090,7 @@ public class MetadataSchema {
// SPECIFIC_NAME String => The name which uniquely
// identifies this procedure within its schema.
specificName };
-
+
PSUEDO_COLUMN_COLUMNS = new ColumnInfo[] {
// TABLE_CAT String => table catalog (may be null)
tableCat,
@@ -1097,22 +1104,28 @@ public class MetadataSchema {
dataType,
// COLUMN_SIZE int => column size.
columnSize,
- // DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where DECIMAL_DIGITS is not applicable.
+ // DECIMAL_DIGITS int => the number of fractional digits.
+ // Null is returned for data types where DECIMAL_DIGITS is
+ // not applicable.
decimalDigits,
// NUM_PREC_RADIX int => Radix (typically either 10 or 2)
numPrecRadix,
- // COLUMN_USAGE String => The allowed usage for the column. The value returned will correspond to the enum name returned by PseudoColumnUsage.name()
+ // COLUMN_USAGE String => The allowed usage for the column.
+ // The value returned will correspond to the enum name
+ // returned by PseudoColumnUsage.name()
columnUsage,
// REMARKS String => comment describing column (may be null)
remarks,
- // CHAR_OCTET_LENGTH int => for char types the maximum number of bytes in the column
+ // CHAR_OCTET_LENGTH int => for char types the maximum
+ // number of bytes in the column
charOctetLength,
- // IS_NULLABLE String => ISO rules are used to determine the nullability for a column.
+ // IS_NULLABLE String => ISO rules are used to determine the
+ // nullability for a column.
// YES --- if the column can include NULLs
// NO --- if the column cannot include NULLs
- // empty string --- if the nullability for the column is unknown
- isNullable
- };
+ // empty string --- if the nullability for the column is
+ // unknown
+ isNullable };
// NB - For some reason JDBC suddenly uses TABLE_CATALOG instead of
// TABLE_CAT here?
Modified: jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaStatement.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaStatement.java?rev=1518431&r1=1518430&r2=1518431&view=diff
==============================================================================
--- jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaStatement.java (original)
+++ jena/trunk/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaStatement.java Thu Aug 29 00:36:31 2013
@@ -300,12 +300,13 @@ public abstract class JenaStatement impl
if (q.isSelectType()) {
switch (this.type) {
case ResultSet.TYPE_SCROLL_INSENSITIVE:
- this.currResults = new MaterializedSelectResults(this, qe, ResultSetFactory.makeRewindable(this.connection.applyPostProcessors(qe.execSelect())),
- false);
+ this.currResults = new MaterializedSelectResults(this, qe, ResultSetFactory.makeRewindable(this.connection
+ .applyPostProcessors(qe.execSelect())), false);
break;
case ResultSet.TYPE_FORWARD_ONLY:
default:
- this.currResults = new SelectResults(this, qe, this.connection.applyPostProcessors(qe.execSelect()), needsCommit);
+ this.currResults = new SelectResults(this, qe, this.connection.applyPostProcessors(qe.execSelect()),
+ needsCommit);
break;
}
} else if (q.isAskType()) {
@@ -315,21 +316,25 @@ public abstract class JenaStatement impl
} else if (q.isDescribeType()) {
switch (this.type) {
case ResultSet.TYPE_SCROLL_INSENSITIVE:
- this.currResults = new TripleListResults(this, qe, Iter.toList(this.connection.applyPostProcessors(qe.execDescribeTriples())), false);
+ this.currResults = new TripleListResults(this, qe, Iter.toList(this.connection.applyPostProcessors(qe
+ .execDescribeTriples())), false);
break;
case ResultSet.TYPE_FORWARD_ONLY:
default:
- this.currResults = new TripleIteratorResults(this, qe, this.connection.applyPostProcessors(qe.execDescribeTriples()), needsCommit);
+ this.currResults = new TripleIteratorResults(this, qe, this.connection.applyPostProcessors(qe
+ .execDescribeTriples()), needsCommit);
break;
}
} else if (q.isConstructType()) {
switch (this.type) {
case ResultSet.TYPE_SCROLL_INSENSITIVE:
- this.currResults = new TripleListResults(this, qe, Iter.toList(this.connection.applyPostProcessors(qe.execConstructTriples())), false);
+ this.currResults = new TripleListResults(this, qe, Iter.toList(this.connection.applyPostProcessors(qe
+ .execConstructTriples())), false);
break;
case ResultSet.TYPE_FORWARD_ONLY:
default:
- this.currResults = new TripleIteratorResults(this, qe, this.connection.applyPostProcessors(qe.execConstructTriples()), needsCommit);
+ this.currResults = new TripleIteratorResults(this, qe, this.connection.applyPostProcessors(qe
+ .execConstructTriples()), needsCommit);
break;
}
} else {
@@ -835,11 +840,16 @@ public abstract class JenaStatement impl
}
}
- // Java 6/7 compatibility
- public boolean isCloseOnCompletion() throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
- public void closeOnCompletion() throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }}
+ // Java 6/7 compatibility
+ @SuppressWarnings("javadoc")
+ public boolean isCloseOnCompletion() throws SQLException {
+ // Statements do not automatically close
+ return false;
+ }
+
+ @SuppressWarnings("javadoc")
+ public void closeOnCompletion() throws SQLException {
+ // We don't support the JDBC 4.1 feature of closing statements automatically
+ throw new SQLFeatureNotSupportedException();
+ }
+}