[teiid-commits] teiid SVN: r4018 - in branches/8.0.x: common-core/src/main/java/org/teiid/core/util and 2 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Apr 18 11:28:58 EDT 2012


Author: shawkins
Date: 2012-04-18 11:28:57 -0400 (Wed, 18 Apr 2012)
New Revision: 4018

Modified:
   branches/8.0.x/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
   branches/8.0.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
   branches/8.0.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
   branches/8.0.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
   branches/8.0.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java
   branches/8.0.x/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
   branches/8.0.x/client/src/main/java/org/teiid/jdbc/TeiidDriver.java
   branches/8.0.x/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
   branches/8.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java
   branches/8.0.x/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
Log:
TEIID-2004 updating for 1.7 builds

Modified: branches/8.0.x/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
===================================================================
--- branches/8.0.x/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -681,4 +681,13 @@
 		setObject((Object)parameterName, val);
 	}
 
+	public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
+		throw SqlUtil.createFeatureNotSupportedException();
+	}
+
+	public <T> T getObject(String columnLabel, Class<T> type)
+			throws SQLException {
+		throw SqlUtil.createFeatureNotSupportedException();
+	}
+
 }
\ No newline at end of file

Modified: branches/8.0.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
===================================================================
--- branches/8.0.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -32,6 +32,7 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executor;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -1005,6 +1006,34 @@
 				setPassword(oldPassword);
 			}
 		}
+	}
+
+	public void abort(Executor executor) throws SQLException {
+		if (closed) {
+			return;
+		}
+		//TODO: ensure that threads are released.  In theory they will be since close effectively cancels current executions
+		close();
+	}
+
+	public int getNetworkTimeout() throws SQLException {
+		throw SqlUtil.createFeatureNotSupportedException();
+	}
+
+	public String getSchema() throws SQLException {
+		return null;
+	}
+
+	/**
+	 * @see query timeouts and the synchronousTtl setting if using socket connections
+	 */
+	public void setNetworkTimeout(Executor executor, int milliseconds)
+			throws SQLException {
+		throw SqlUtil.createFeatureNotSupportedException();
+	}
+
+	public void setSchema(String schema) throws SQLException {
+		
 	}
 
 }

Modified: branches/8.0.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
===================================================================
--- branches/8.0.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -446,14 +446,13 @@
 
     /**
      * <p>Gets a description of the access rights for a column of the given name.
-     * Catalog, schema and table names are not used to narrow down the search,
-     * but the schema name should match the virtualdatabasename used to obtain
+     * Catalog name should match the virtualdatabasename used to obtain
      * this driver connection.</p>
      * @param name of the catalog to which columns belong.
      * @param name of the schema to which columns belong.
      * @param name of the table to which columns belong.
      * @param name pattern to be matched by column names.
-     * @return ResultSet containing column privilage information.
+     * @return ResultSet containing column privilege information.
      * @throws SQLException if there is an error obtaining server results
      */
     public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnName) throws SQLException {
@@ -487,9 +486,8 @@
 
     /**
      * <p>Get's the metadata information about the columns whose names match the given
-     * columnNamePattern. Catalog, schema and tableNamePattern are not used to
-     * narrow down the search, but Catalog and schema names should match the
-     * virtualdatabasename and version used to obtain this driver connection.</p>
+     * columnNamePattern. Catalog names should match the
+     * virtualdatabasename used to obtain this driver connection.</p>
      * <p> The ResultSet returned by this method contains the following additional
      * columns that are not specified in the JDBC specification.</p>
      * <OL>
@@ -594,9 +592,8 @@
     /**
      * <p>Gets the description of the foreign key columns in the table foreignTable.
      * These foreign key columns reference primary key columns of primaryTable.
-     * Catalog and schema information is not used to narrow down the search, but
-     * Catalog and schema names(primary and foreign) should match the
-     * virtualdatabasename and version used to obtain this driver connection.
+     * Catalog names(primary and foreign) should match the
+     * virtualdatabasename used to obtain this driver connection.
      * @param name of the catalog containing primary keys.
      * @param name of the schema containing primary keys.
      * @param name of the table containing primary keys.
@@ -1985,7 +1982,7 @@
     }
 
     public boolean supportsGroupByUnrelated() throws SQLException {
-        return false;
+        return true;
     }
 
     public boolean supportsIntegrityEnhancementFacility() throws SQLException {
@@ -2004,22 +2001,10 @@
         return true;
     }
 
-    /**
-     * <p>Checks whether mixed-case unquoted SQL identifiers used in SQL statements are
-     * case sensitive</p>
-     * @return if so return true, else false.
-     * @throws SQLException, should never occur.
-     */
     public boolean supportsMixedCaseIdentifiers() throws SQLException {
         return false;
     }
 
-    /**
-     * <p>Checks whether mixed-case quoted SQL identifiers used in SQL statements are
-     * case sensitive</p>
-     * @return if so return true, else false.
-     * @throws SQLException, should never occur.
-     */
     public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
         return false;
     }
@@ -2028,36 +2013,20 @@
         return false;
     }
 
-    /**
-     * <p>Are multiple ResultSets from a single execute supported?</p>
-     * @return <code>true</code> if so; <code>false</code> otherwise
-     * @throws SQLException, should never occur
-     */
     public boolean supportsMultipleResultSets() throws SQLException {
         return false;
     }
 
-    /**
-     * Retrieves whether it is possible to have multiple ResultSet objects
-     * returned from a CallableStatement object simultaneously.
-     * @return <code>true</code> if so; <code>false</code> otherwise
-     * @throws SQLException, should never occur
-     */
     public boolean supportsMultipleOpenResults() throws SQLException {
         return false;
     }
 
-    /**
-     * <p>Checks whether multiple transactions open at once on different connectons</p>
-     * @return if so return true, else false.
-     * @throws SQLException, should never occur.
-     */
     public boolean supportsMultipleTransactions() throws SQLException {
         return true;
     }
 
     public boolean supportsNamedParameters() throws SQLException {
-        return false;
+        return true;
     }
 
     public boolean supportsNonNullableColumns() throws SQLException {
@@ -2076,11 +2045,6 @@
         return true;
     }
 
-    /**
-     * <p>Checks whether an ORDER BY clause can use columns that are not in the SELECT clause.</p>
-     * @return if so return true, else false.
-     * @throws SQLException, should never occur.
-     */
     public boolean supportsOrderByUnrelated() throws SQLException {
         return true;
     }
@@ -2115,7 +2079,6 @@
      * @param intValue holdability
      * @return boolean true if so; false otherwise
      * @throws SQLException, should never occur
-
      */
     public boolean supportsResultSetHoldability(int holdability) throws SQLException {
         return false;
@@ -2354,4 +2317,14 @@
         	}
         }
 	}
+
+	public boolean generatedKeyAlwaysReturned() throws SQLException {
+		return false;
+	}
+
+	public ResultSet getPseudoColumns(String catalog, String schemaPattern,
+			String tableNamePattern, String columnNamePattern)
+			throws SQLException {
+		throw SqlUtil.createFeatureNotSupportedException();
+	}
 }

Modified: branches/8.0.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- branches/8.0.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -1666,4 +1666,13 @@
 			throws SQLException {
 		throw SqlUtil.createFeatureNotSupportedException();	
 	}
+
+	public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
+		throw SqlUtil.createFeatureNotSupportedException();
+	}
+
+	public <T> T getObject(String columnLabel, Class<T> type)
+			throws SQLException {
+		throw SqlUtil.createFeatureNotSupportedException();
+	}
 }

Modified: branches/8.0.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- branches/8.0.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -1108,4 +1108,12 @@
 	
 	    return metadataMap;
 	}
+
+	public void closeOnCompletion() throws SQLException {
+		throw SqlUtil.createFeatureNotSupportedException();
+	}
+
+	public boolean isCloseOnCompletion() throws SQLException {
+		return false;
+	}
 }
\ No newline at end of file

Modified: branches/8.0.x/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
===================================================================
--- branches/8.0.x/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -24,7 +24,9 @@
 
 import java.net.MalformedURLException;
 import java.sql.Connection;
+import java.sql.SQLFeatureNotSupportedException;
 import java.util.Properties;
+import java.util.logging.Logger;
 
 import org.teiid.net.TeiidURL;
 
@@ -517,5 +519,9 @@
 	public void setKerberosServicePrincipleName(String kerberosServerName) {
 		this.kerberosServicePrincipleName = kerberosServerName;
 	}
+
+	public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+		return TeiidDriver.logger;
+	}
 }
 

Modified: branches/8.0.x/client/src/main/java/org/teiid/jdbc/TeiidDriver.java
===================================================================
--- branches/8.0.x/client/src/main/java/org/teiid/jdbc/TeiidDriver.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/client/src/main/java/org/teiid/jdbc/TeiidDriver.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -27,6 +27,7 @@
 import java.sql.DriverManager;
 import java.sql.DriverPropertyInfo;
 import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
 import java.util.Enumeration;
 import java.util.LinkedList;
 import java.util.List;
@@ -55,7 +56,7 @@
 
 public class TeiidDriver implements Driver {
 	
-	private static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$
+	static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$
 	static final String DRIVER_NAME = "Teiid JDBC Driver"; //$NON-NLS-1$
 	
     private static TeiidDriver INSTANCE = new TeiidDriver();
@@ -235,6 +236,10 @@
     public boolean jdbcCompliant() {
         return false;
     }
+
+	public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+		return logger;
+	}
 }
 
 

Modified: branches/8.0.x/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
===================================================================
--- branches/8.0.x/common-core/src/main/java/org/teiid/core/util/SqlUtil.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/common-core/src/main/java/org/teiid/core/util/SqlUtil.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -87,6 +87,6 @@
     public static SQLException createFeatureNotSupportedException() {
     	StackTraceElement ste = new Exception().getStackTrace()[1];
     	String methodName = ste.getMethodName();
-    	return new SQLFeatureNotSupportedException(methodName + " is not supported");
+    	return new SQLFeatureNotSupportedException(methodName + " is not supported"); //$NON-NLS-1$
     }    
 }

Modified: branches/8.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java
===================================================================
--- branches/8.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -28,7 +28,15 @@
 import java.io.InputStreamReader;
 import java.net.URISyntaxException;
 import java.nio.charset.Charset;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 import java.util.concurrent.Semaphore;
 
 import org.jboss.vfs.VirtualFile;
@@ -375,19 +383,6 @@
 		
 		List<Table> records = recs;
 		
-		//load non-materialized first, so that the uuid->table cache is populated
-		Collections.sort(records, new Comparator<Table>() {
-			@Override
-			public int compare(Table o1, Table o2) {
-				if (!o1.isMaterialized()) {
-					return -1;
-				}
-				if (!o2.isMaterialized()) {
-					return 1;
-				}
-				return 0;
-			}
-		});
 		for (Table tableRecord : records) {
 	    	List<Column> columns = new ArrayList<Column>(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.COLUMN, Column.class, false));
 	        for (Column columnRecordImpl : columns) {

Modified: branches/8.0.x/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
===================================================================
--- branches/8.0.x/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java	2012-04-18 15:24:25 UTC (rev 4017)
+++ branches/8.0.x/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java	2012-04-18 15:28:57 UTC (rev 4018)
@@ -825,7 +825,7 @@
         expected.put("supportsGetGeneratedKeys", Boolean.FALSE); //$NON-NLS-1$
         expected.put("supportsGroupBy", Boolean.TRUE); //$NON-NLS-1$
         expected.put("supportsGroupByBeyondSelect", Boolean.TRUE); //$NON-NLS-1$
-        expected.put("supportsGroupByUnrelated", Boolean.FALSE); //$NON-NLS-1$
+        expected.put("supportsGroupByUnrelated", Boolean.TRUE); //$NON-NLS-1$
         expected.put("supportsIntegrityEnhancementFacility", Boolean.FALSE); //$NON-NLS-1$
         expected.put("supportsLikeEscapeClause", Boolean.TRUE); //$NON-NLS-1$
         expected.put("supportsLimitedOuterJoins", Boolean.TRUE); //$NON-NLS-1$
@@ -836,7 +836,7 @@
         expected.put("supportsMultipleResultSets", Boolean.FALSE); //$NON-NLS-1$
         expected.put("supportsMultipleOpenResults", Boolean.FALSE); //$NON-NLS-1$
         expected.put("supportsMultipleTransactions", Boolean.TRUE); //$NON-NLS-1$
-        expected.put("supportsNamedParameters", Boolean.FALSE); //$NON-NLS-1$
+        expected.put("supportsNamedParameters", Boolean.TRUE); //$NON-NLS-1$
         expected.put("supportsNonNullableColumns", Boolean.TRUE); //$NON-NLS-1$
         expected.put("supportsOpenCursorsAcrossRollback", Boolean.FALSE); //$NON-NLS-1$
         expected.put("supportsOpenStatementsAcrossCommit", Boolean.TRUE); //$NON-NLS-1$



More information about the teiid-commits mailing list