Author: shawkins
Date: 2010-07-01 10:26:20 -0400 (Thu, 01 Jul 2010)
New Revision: 2327
Modified:
trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java
trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java
trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java
trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java
trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java
trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java
trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java
trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java
trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java
trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java
trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java
trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java
trunk/common-core/src/test/java/org/teiid/core/types/basic/TestStringToXmlTransform.java
trunk/common-core/src/test/java/org/teiid/core/util/UnitTestUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
Log:
TEIID-177 removing comment based approach to backwards compatibility and changing the
isvalid check to use a ping
Modified: trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-07-01 14:23:31
UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-07-01 14:26:20
UTC (rev 2327)
@@ -90,9 +90,7 @@
return target;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
if (method.getName().equals("close")) { //$NON-NLS-1$
Modified: trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -59,9 +59,7 @@
this.nested = nested;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
List<String> classNames = ExternalizeUtil.readList(in, String.class);
String message = (String)in.readObject();
@@ -93,9 +91,7 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void writeExternal(ObjectOutput out) throws IOException {
List<String> classNames = new ArrayList<String>();
Class<?> clazz = exception.getClass();
Modified: trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -33,16 +33,10 @@
import java.sql.Date;
import java.sql.Ref;
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.SQLXML;
import java.sql.NClob;
import java.sql.RowId;
-//## JDBC4.0-end ##
-/*## JDBC3.0-JDK1.5-begin ##
-import com.metamatrix.core.jdbc.SQLXML;
-## JDBC3.0-JDK1.5-end ##*/
-
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
@@ -468,17 +462,13 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public NClob getNClob(int parameterIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
- //## JDBC4.0-begin ##
public NClob getNClob(String parameterName) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public String getNString(int parameterIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -508,17 +498,13 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public RowId getRowId(int parameterIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
- //## JDBC4.0-begin ##
public RowId getRowId(String parameterName) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public SQLXML getSQLXML(String parameterName) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -687,11 +673,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void setNClob(String parameterName, NClob value) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void setNClob(String parameterName, Reader reader)
throws SQLException {
@@ -731,11 +715,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void setRowId(String parameterName, RowId x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void setSQLXML(String parameterName, SQLXML xmlObject)
throws SQLException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-07-01 14:23:31 UTC
(rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-07-01 14:26:20 UTC
(rev 2327)
@@ -32,15 +32,10 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
-//## JDBC4.0-begin ##
import java.sql.SQLClientInfoException;
import java.sql.NClob;
import java.sql.SQLXML;
-//## JDBC4.0-end ##
-/*## JDBC3.0-JDK1.5-begin ##
-import com.metamatrix.core.jdbc.SQLXML;
-## JDBC3.0-JDK1.5-end ##*/
import java.sql.Savepoint;
import java.sql.Statement;
import java.sql.Struct;
@@ -52,6 +47,9 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -840,22 +838,20 @@
return transactionXid;
}
- public boolean isValid(int timeout) throws SQLException {
- Statement statement = null;
- try {
- statement = createStatement();
- statement.setQueryTimeout(timeout);
- statement.execute("select 1"); //$NON-NLS-1$
- return true;
- } catch (SQLException e) {
- return false;
- } finally {
- if (statement != null) {
- try {
- statement.close();
- } catch (SQLException e) {
- }
- }
+ public boolean isValid(int timeout) throws SQLException {
+ ResultsFuture<?> future = this.getServerConnection().isOpen();
+ if (future == null) {
+ return false;
+ }
+ try {
+ future.get(timeout, TimeUnit.SECONDS);
+ return true;
+ } catch (InterruptedException e) {
+ return false;
+ } catch (ExecutionException e) {
+ return false;
+ } catch (TimeoutException e) {
+ return false;
}
}
@@ -891,7 +887,6 @@
return this.serverConn.isSameInstance(conn.serverConn);
}
- //## JDBC4.0-begin ##
public void setClientInfo(Properties properties)
throws SQLClientInfoException {
}
@@ -899,7 +894,6 @@
public void setClientInfo(String name, String value)
throws SQLClientInfoException {
}
- //## JDBC4.0-end ##
public Properties getClientInfo() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -922,11 +916,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public NClob createNClob() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public SQLXML createSQLXML() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
Modified: trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java 2010-07-01 14:23:31
UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java 2010-07-01 14:26:20
UTC (rev 2327)
@@ -29,12 +29,7 @@
import java.sql.Clob;
import java.sql.Date;
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.SQLXML;
-//## JDBC4.0-end ##
-/*## JDBC3.0-JDK1.5-begin ##
-import com.metamatrix.core.jdbc.SQLXML;
-## JDBC3.0-JDK1.5-end ##*/
import java.sql.Time;
import java.sql.Timestamp;
Modified: trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -2382,11 +2382,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public RowIdLifetime getRowIdLifetime() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public ResultSet getSchemas(String catalog, String schemaPattern)
throws SQLException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -190,9 +190,7 @@
throw new TeiidSQLException(msg);
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public boolean execute() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, ResultsMode.EITHER);
return hasResultSet();
@@ -211,17 +209,13 @@
return this.updateCounts;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ResultSet executeQuery() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, ResultsMode.RESULTSET);
return resultSet;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public int executeUpdate() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, ResultsMode.UPDATECOUNT);
return this.updateCounts[0];
@@ -750,11 +744,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void setNClob(int parameterIndex, NClob value) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void setNClob(int parameterIndex, Reader reader) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -774,11 +766,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void setRowId(int parameterIndex, RowId x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void setUnicodeStream(int parameterIndex, InputStream x, int length)
throws SQLException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2010-07-01 14:23:31 UTC
(rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2010-07-01 14:26:20 UTC
(rev 2327)
@@ -406,9 +406,7 @@
checkClosed(); // check to see if the ResultSet is closed
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void clearWarnings() throws SQLException {
// do nothing
checkClosed(); // check to see if the ResultSet is closed
@@ -1263,7 +1261,6 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public NClob getNClob(int columnIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
@@ -1271,7 +1268,6 @@
public NClob getNClob(String columnLabel) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public String getNString(int columnIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -1299,17 +1295,13 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public RowId getRowId(int columnIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
- //## JDBC4.0-begin ##
public RowId getRowId(String columnLabel) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public SQLXML getSQLXML(String columnLabel) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -1625,11 +1617,9 @@
}
- //## JDBC4.0-begin ##
public void updateNClob(int columnIndex, NClob clob) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void updateNClob(int columnIndex, Reader reader, long length)
throws SQLException {
@@ -1640,11 +1630,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void updateNClob(String columnLabel, NClob clob) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void updateNClob(String columnLabel, Reader reader, long length)
throws SQLException {
@@ -1704,17 +1692,13 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void updateRowId(int columnIndex, RowId x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
- //## JDBC4.0-begin ##
public void updateRowId(String columnLabel, RowId x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void updateShort(int columnIndex, short x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-07-01 14:23:31 UTC
(rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-07-01 14:26:20 UTC
(rev 2327)
@@ -22,8 +22,6 @@
package org.teiid.jdbc;
-import java.io.IOException;
-import java.io.Reader;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
@@ -56,9 +54,8 @@
import org.teiid.client.plan.Annotation;
import org.teiid.client.plan.PlanNode;
import org.teiid.core.TeiidComponentException;
-import org.teiid.core.TeiidProcessingException;
import org.teiid.core.TeiidException;
-import org.teiid.core.util.ObjectConverterUtil;
+import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.SqlUtil;
@@ -299,17 +296,13 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public boolean execute(String sql) throws SQLException {
executeSql(new String[] {sql}, false, ResultsMode.EITHER);
return hasResultSet();
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public int[] executeBatch() throws SQLException {
if (batchedUpdates == null || batchedUpdates.isEmpty()) {
return new int[0];
@@ -319,17 +312,13 @@
return updateCounts;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ResultSet executeQuery(String sql) throws SQLException {
executeSql(new String[] {sql}, false, ResultsMode.RESULTSET);
return resultSet;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public int executeUpdate(String sql) throws SQLException {
String[] commands = new String[] {sql};
executeSql(commands, false, ResultsMode.UPDATECOUNT);
Modified: trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java 2010-07-01 14:23:31 UTC
(rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java 2010-07-01 14:26:20 UTC
(rev 2327)
@@ -52,13 +52,7 @@
return warning;
}
}
- //## JDBC4.0-begin ##
return new SQLWarning(ex);
- //## JDBC4.0-end ##
- /*## JDBC3.0-JDK1.5-begin ##
- return new SQLWarning(ex.getMessage());
- ## JDBC3.0-JDK1.5-end ##*/
-
}
/**
Modified: trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java 2010-07-01 14:23:31 UTC
(rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java 2010-07-01 14:26:20 UTC
(rev 2327)
@@ -23,17 +23,12 @@
package org.teiid.jdbc;
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.Wrapper;
import org.teiid.core.util.ArgCheck;
-public class WrapperImpl
- //## JDBC4.0-begin ##
- implements Wrapper
- //## JDBC4.0-end ##
- {
+public class WrapperImpl implements Wrapper {
public boolean isWrapperFor(Class<?> iface) throws SQLException {
ArgCheck.isNotNull(iface);
Modified: trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java 2010-07-01 14:23:31
UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java 2010-07-01 14:26:20
UTC (rev 2327)
@@ -33,9 +33,7 @@
import javax.sql.ConnectionEvent;
import javax.sql.ConnectionEventListener;
-//## JDBC4.0-begin ##
import javax.sql.StatementEventListener;
-//## JDBC4.0-end ##
import javax.sql.XAConnection;
import javax.transaction.xa.XAResource;
@@ -190,11 +188,9 @@
}
}
- //## JDBC4.0-begin ##
public void addStatementEventListener(StatementEventListener arg0) {
}
public void removeStatementEventListener(StatementEventListener arg0) {
}
- //## JDBC4.0-end ##
}
Modified: trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
===================================================================
---
trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -71,9 +71,7 @@
inputStream = new ObjectDecoderInputStream(new DataInputStream(bis), cl,
MAX_OBJECT_SIZE);
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void close() {
log.finer("closing socket"); //$NON-NLS-1$
try {
@@ -98,23 +96,17 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketAddress getRemoteAddress() {
return socket.getRemoteSocketAddress();
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public boolean isOpen() {
return !socket.isClosed();
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object read() throws IOException, ClassNotFoundException {
log.finer("reading message from socket"); //$NON-NLS-1$
synchronized (readLock) {
@@ -129,9 +121,7 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public synchronized Future<?> write(Object msg) {
log.finer("writing message to socket"); //$NON-NLS-1$
ResultsFuture<Void> result = new ResultsFuture<Void>();
@@ -160,9 +150,7 @@
PropertiesUtils.setBeanProperties(this, props, "org.teiid.sockets");
//$NON-NLS-1$
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ObjectChannel createObjectChannel(SocketAddress address, boolean ssl) throws
IOException,
CommunicationException {
final Socket socket;
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -33,6 +33,7 @@
import java.net.SocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Timer;
@@ -181,7 +182,8 @@
// Log on to server
try {
this.logonResult = logon.logon(connProps);
- if (this.serverDiscovery.getKnownHosts(logonResult,
this.serverInstance).size() > 1) {
+ List<HostInfo> knownHosts =
this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance);
+ if (knownHosts.size() > 1 && !new
HashSet<HostInfo>(knownHosts).equals(new
HashSet<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, null)))) {
//if there are multiple instances, allow for load-balancing
closeServerInstance();
}
Modified:
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
===================================================================
---
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -74,9 +74,7 @@
this.key = key;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object invoke(Object arg0, Method arg1, Object[] arg2)
throws Throwable {
if (arg1.getName().equals("shutdown")) { //$NON-NLS-1$
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
===================================================================
---
trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -105,16 +105,12 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public HostInfo getHostInfo() {
return this.hostInfo;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketAddress getRemoteAddress() {
return this.socketChannel.getRemoteAddress();
}
@@ -286,9 +282,7 @@
}
@SuppressWarnings("unchecked")
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public <T> T getService(Class<T> iface) {
return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface},
new RemoteInvocationHandler(iface));
}
@@ -303,9 +297,7 @@
this.secure = ILogon.class.isAssignableFrom(targetClass);
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
Throwable t = null;
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java 2010-07-01 14:23:31
UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java 2010-07-01 14:26:20
UTC (rev 2327)
@@ -116,12 +116,7 @@
// One way SSL with custom properties defined
result = getClientSSLContext(null, null, truststore, truststorePassword,
keystoreAlgorithm, keystoreType, keystoreProtocol);
} else {
- //## JDBC4.0-begin ##
result = SSLContext.getDefault();
- //## JDBC4.0-end ##
- /*## JDBC3.0-JDK1.5-begin ##
- result = SSLContext.getInstance("Default");
- ## JDBC3.0-JDK1.5-end ##*/
}
return new SSLSocketFactory(result, anon);
}
Modified: trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -44,38 +44,28 @@
this.url = url;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public List<HostInfo> getKnownHosts(LogonResult result,
SocketServerInstance instance) {
return url.getHostInfo();
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void init(TeiidURL url, Properties p) {
this.url = url;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void connectionSuccessful(HostInfo info) {
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void markInstanceAsBad(HostInfo info) {
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void shutdown() {
}
Modified: trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java
===================================================================
--- trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -21,7 +21,6 @@
public class TestExceptionHolder {
- //## JDBC4.0-begin ##
@SuppressWarnings("all")
public static class BadException extends TeiidProcessingException {
private Object obj;
@@ -116,11 +115,4 @@
Throwable e = holder.getException();
assertTrue(e instanceof TeiidException);
}
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- public void testPass(){
- // since the jar files required are built with 1.6, it will always fail, so just comment
the test for 1.5
- }
- ## JDBC3.0-JDK1.5-end ##*/
}
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java 2010-07-01 14:23:31 UTC
(rev 2326)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java 2010-07-01 14:26:20 UTC
(rev 2327)
@@ -27,16 +27,14 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.Wrapper;
import org.teiid.jdbc.WrapperImpl;
-//## JDBC4.0-end ##
import junit.framework.TestCase;
public class TestWrapperImpl extends TestCase {
- //## JDBC4.0-begin ##
+
interface Foo extends Wrapper {
void callMe();
}
@@ -50,9 +48,9 @@
}
}
- //## JDBC4.0-end ##
+
public void testProxy() throws SQLException {
- //## JDBC4.0-begin ##
+
final FooImpl fooImpl = new FooImpl();
Foo proxy = (Foo)Proxy.newProxyInstance(TestWrapperImpl.class.getClassLoader(), new
Class[] {Foo.class}, new InvocationHandler() {
@@ -85,7 +83,6 @@
} catch (SQLException e) {
assertEquals("Wrapped object is not an instance of class java.lang.String",
e.getMessage());
}
- //## JDBC4.0-end ##
}
}
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java 2010-07-01 14:23:31
UTC (rev 2326)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java 2010-07-01 14:26:20
UTC (rev 2327)
@@ -43,9 +43,7 @@
final ConnectionImpl mmConn = TestConnection.getMMConnection();
XAConnectionImpl xaConn = new XAConnectionImpl(new XAConnectionImpl.ConnectionSource()
{
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ConnectionImpl createConnection() throws SQLException {
return mmConn;
}
@@ -71,9 +69,7 @@
@Test public void testNotification() throws Exception {
XAConnectionImpl xaConn = new XAConnectionImpl(new XAConnectionImpl.ConnectionSource()
{
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ConnectionImpl createConnection() throws SQLException {
ConnectionImpl c = Mockito.mock(ConnectionImpl.class);
Mockito.doThrow(new SQLException(new InvalidSessionException())).when(c).commit();
Modified: trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
===================================================================
---
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -61,25 +61,19 @@
Throwable t;
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void assertIdentity(SessionToken sessionId)
throws InvalidSessionException, TeiidComponentException {
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ResultsFuture<?> logoff()
throws InvalidSessionException {
return null;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public LogonResult logon(
Properties connectionProperties)
throws LogonException,
@@ -87,9 +81,7 @@
return new LogonResult(new SessionToken(1, "fooUser"), "foo", 1,
"fake"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ResultsFuture<?> ping()
throws InvalidSessionException,
TeiidComponentException {
@@ -129,9 +121,7 @@
public void testLogonFailsWithMultipleHosts() throws Exception {
Properties p = new Properties();
SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketServerInstance getServerInstance(HostInfo info,
boolean ssl) throws CommunicationException, IOException {
throw new SingleInstanceCommunicationException();
@@ -193,9 +183,7 @@
Properties p = new Properties();
ServerDiscovery discovery = new UrlServerDiscovery(new TeiidURL(hostInfo.getHostName(),
hostInfo.getPortNumber(), false));
SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketServerInstance getServerInstance(final HostInfo info,
boolean ssl) throws CommunicationException, IOException {
SocketServerInstance instance = Mockito.mock(SocketServerInstance.class);
Modified:
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java
===================================================================
---
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -56,23 +56,17 @@
this.readMsgs = readMsgs;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void close() {
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public boolean isOpen() {
return true;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Future<?> write(Object msg) {
msgs.add(msg);
ResultsFuture<?> result = new ResultsFuture<Void>();
@@ -80,9 +74,7 @@
return result;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object read() throws IOException,
ClassNotFoundException {
if (readCount >= readMsgs.size()) {
@@ -102,24 +94,18 @@
return msg;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketAddress getRemoteAddress() {
return null;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ObjectChannel createObjectChannel(SocketAddress address,
boolean ssl) throws IOException, CommunicationException {
return this;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public int getSoTimeout() {
return 1;
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java 2010-07-01 14:23:31
UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java 2010-07-01 14:26:20
UTC (rev 2327)
@@ -121,7 +121,6 @@
this.reference.truncate(len);
}
- //## JDBC4.0-begin ##
public void free() throws SQLException {
this.reference.free();
}
@@ -130,7 +129,6 @@
throws SQLException {
return this.reference.getBinaryStream(pos, length);
}
- //## JDBC4.0-end ##
public static SerialBlob createBlob(byte[] bytes) {
if (bytes == null) {
Modified: trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java 2010-07-01 14:23:31
UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java 2010-07-01 14:26:20
UTC (rev 2327)
@@ -200,15 +200,14 @@
};
}
- //## JDBC4.0-begin ##
- public void free() throws SQLException {
+
+ public void free() throws SQLException {
this.reference.free();
}
public Reader getCharacterStream(long pos, long length) throws SQLException {
return this.reference.getCharacterStream(pos, length);
}
- //## JDBC4.0-end ##
public static SerialClob createClob(char[] chars) {
try {
Modified: trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -704,50 +704,38 @@
static void loadSourceConversions() {
sourceConverters.put(Clob.class, new SourceTransform<Clob, ClobType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ClobType transform(Clob value) {
return new ClobType(value);
}
});
sourceConverters.put(char[].class, new SourceTransform<char[], ClobType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ClobType transform(char[] value) {
return new ClobType(ClobType.createClob(value));
}
});
sourceConverters.put(Blob.class, new SourceTransform<Blob, BlobType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public BlobType transform(Blob value) {
return new BlobType(value);
}
});
addSourceTransform(byte[].class, new SourceTransform<byte[], BlobType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public BlobType transform(byte[] value) {
return new BlobType(BlobType.createBlob(value));
}
});
addSourceTransform(SQLXML.class, new SourceTransform<SQLXML, XMLType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public XMLType transform(SQLXML value) {
return new XMLType(value);
}
});
//Note: the default transform from non-InputStreamFactory source is a fully
materialized string
addSourceTransform(Source.class, new SourceTransform<Source, XMLType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public XMLType transform(Source value) {
if (value instanceof InputStreamFactory) {
return new XMLType(new SQLXMLImpl((InputStreamFactory)value));
@@ -761,9 +749,7 @@
}
});
addSourceTransform(Date.class, new SourceTransform<Date, Timestamp>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Timestamp transform(Date value) {
return new Timestamp(value.getTime());
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java
===================================================================
---
trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -27,6 +27,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.io.Reader;
import java.nio.charset.Charset;
import java.sql.Blob;
@@ -34,6 +35,7 @@
import java.sql.SQLException;
import java.sql.SQLXML;
+import javax.activation.DataSource;
import javax.xml.transform.Source;
import org.teiid.core.util.ReaderInputStream;
@@ -102,7 +104,7 @@
}
- public static class ClobInputStreamFactory extends InputStreamFactory {
+ public static class ClobInputStreamFactory extends InputStreamFactory implements
DataSource {
private Clob clob;
private Charset charset = Charset.forName(Streamable.ENCODING);
@@ -136,10 +138,25 @@
throw new IOException(e);
}
}
+
+ @Override
+ public String getContentType() {
+ return "text/plain"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getName() {
+ return "clob"; //$NON-NLS-1$
+ }
+
+ @Override
+ public OutputStream getOutputStream() throws IOException {
+ throw new UnsupportedOperationException();
+ }
}
- public static class BlobInputStreamFactory extends InputStreamFactory {
+ public static class BlobInputStreamFactory extends InputStreamFactory implements
DataSource {
private Blob blob;
@@ -165,9 +182,24 @@
}
}
+ @Override
+ public String getContentType() {
+ return "application/octet-stream"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getName() {
+ return "blob"; //$NON-NLS-1$
+ }
+
+ @Override
+ public OutputStream getOutputStream() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
}
- public static class SQLXMLInputStreamFactory extends InputStreamFactory {
+ public static class SQLXMLInputStreamFactory extends InputStreamFactory implements
DataSource {
private SQLXML sqlxml;
@@ -193,6 +225,21 @@
}
}
+ @Override
+ public String getContentType() {
+ return "application/xml"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getName() {
+ return "sqlxml"; //$NON-NLS-1$
+ }
+
+ @Override
+ public OutputStream getOutputStream() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -24,13 +24,8 @@
import java.sql.Blob;
import java.sql.Clob;
-//## JDBC4.0-begin ##
import java.sql.SQLXML;
-//## JDBC4.0-end ##
-/*## JDBC3.0-JDK1.5-begin ##
-import com.metamatrix.core.jdbc.SQLXML;
-## JDBC3.0-JDK1.5-end ##*/
import java.sql.Types;
import java.util.HashMap;
import java.util.Map;
@@ -86,12 +81,7 @@
public static final String OBJECT_CLASS =
DataTypeManager.DefaultDataClasses.OBJECT.getName();
public static final String CLOB_CLASS = Clob.class.getName();
public static final String BLOB_CLASS = Blob.class.getName();
- //## JDBC4.0-begin ##
public static final String XML_CLASS = SQLXML.class.getName();
- //## JDBC4.0-end ##
- /*## JDBC3.0-JDK1.5-begin ##
- public static final String XML_CLASS =
DataTypeManager.DefaultDataClasses.OBJECT.getName();
- ## JDBC3.0-JDK1.5-end ##*/
private static Map<String, Integer> NAME_TO_TYPE_MAP = new HashMap<String,
Integer>();
private static Map<Integer, String> TYPE_TO_NAME_MAP = new HashMap<Integer,
String>();
@@ -119,17 +109,11 @@
addTypeMapping(NULL, null, Types.NULL);
- //## JDBC4.0-begin ##
addTypeMapping(XML, XML_CLASS, Types.SQLXML);
TYPE_TO_NAME_MAP.put(Types.NVARCHAR, STRING);
TYPE_TO_NAME_MAP.put(Types.LONGNVARCHAR, STRING);
TYPE_TO_NAME_MAP.put(Types.NCHAR, CHAR);
TYPE_TO_NAME_MAP.put(Types.NCLOB, CLOB);
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- NAME_TO_CLASSNAME.put(XML, OBJECT_CLASS);
- ## JDBC3.0-JDK1.5-end ##*/
}
private static void addTypeMapping(String typeName, String javaClass, int sqlType, int
... secondaryTypes) {
Modified: trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java 2010-07-01 14:23:31
UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java 2010-07-01 14:26:20
UTC (rev 2327)
@@ -24,14 +24,10 @@
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.SQLFeatureNotSupportedException;
-//## JDBC4.0-end ##
import java.util.regex.Pattern;
-
-
/**
* Utilities for dealing with SQL strings.
*/
@@ -111,13 +107,6 @@
}
public static SQLException createFeatureNotSupportedException() {
- //## JDBC4.0-begin ##
return new SQLFeatureNotSupportedException();
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- return new SQLException("unsupported feature");
- ## JDBC3.0-JDK1.5-end ##*/
-
}
}
Modified: trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
===================================================================
---
trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -172,9 +172,7 @@
}
assertEquals(Types.TIMESTAMP,
JDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.TIMESTAMP));
- //## JDBC4.0-begin ##
assertEquals(Types.SQLXML,
JDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.XML));
- //## JDBC4.0-end ##
assertEquals(DataTypeManager.DefaultDataTypes.STRING,
JDBCSQLTypeInfo.getTypeName(Types.CHAR));
assertEquals(Types.CHAR,
JDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.CHAR));
}
Modified: trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -38,7 +38,6 @@
String testStr = "<foo>test</foo>"; //$NON-NLS-1$
- //## JDBC4.0-begin ##
@Test public void testGetSource() throws Exception {
SQLXMLImpl xml = new SQLXMLImpl(testStr);
assertTrue(xml.getSource(null) instanceof StreamSource);
@@ -46,7 +45,6 @@
StreamSource ss = (StreamSource)xml.getSource(null);
assertEquals(testStr, new
String(ObjectConverterUtil.convertToByteArray(ss.getInputStream()),
Streamable.ENCODING));
}
- //## JDBC4.0-end ##
@Test public void testGetCharacterStream() throws Exception {
SQLXMLImpl xml = new SQLXMLImpl(testStr);
Modified:
trunk/common-core/src/test/java/org/teiid/core/types/basic/TestStringToXmlTransform.java
===================================================================
---
trunk/common-core/src/test/java/org/teiid/core/types/basic/TestStringToXmlTransform.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/common-core/src/test/java/org/teiid/core/types/basic/TestStringToXmlTransform.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -22,7 +22,6 @@
package org.teiid.core.types.basic;
-//## JDBC4.0-begin ##
import static org.junit.Assert.*;
import java.sql.SQLXML;
Modified: trunk/common-core/src/test/java/org/teiid/core/util/UnitTestUtil.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/util/UnitTestUtil.java 2010-07-01
14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/test/java/org/teiid/core/util/UnitTestUtil.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -43,13 +43,7 @@
public static final String PATH_SEPARATOR = "/"; //$NON-NLS-1$
- //## JDBC4.0-begin ##
private static final String DEFAULT_TESTDATA_PATH = "src/test/resources";
//$NON-NLS-1$
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- private static final String DEFAULT_TESTDATA_PATH =
"target/generated-sources/test/resources"; //$NON-NLS-1$
- ## JDBC3.0-JDK1.5-end ##*/
private static final String DEFAULT_TEMP_DIR = "target/scratch";
//$NON-NLS-1$
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-07-01
14:23:31 UTC (rev 2326)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-07-01
14:26:20 UTC (rev 2327)
@@ -88,7 +88,6 @@
import org.teiid.query.sql.lang.SubqueryContainer;
import org.teiid.query.sql.lang.SubqueryFromClause;
import org.teiid.query.sql.lang.TableFunctionReference;
-import org.teiid.query.sql.lang.TextTable;
import org.teiid.query.sql.lang.UnaryFromClause;
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.symbol.GroupSymbol;