Author: rareddy
Date: 2009-04-20 20:07:29 -0400 (Mon, 20 Apr 2009)
New Revision: 809
Modified:
trunk/client-jdbc/
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/DataTypeTransformer.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMBlob.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMCallableStatement.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMClob.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDatabaseMetaData.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMPreparedStatement.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMResultSet.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMSQLXML.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMStatement.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMXAConnection.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/WarningUtil.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/WrapperImpl.java
trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMResultSet.java
trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMXAConnection.java
trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestWrapperImpl.java
trunk/client/
trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/SocketUtil.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/OioOjbectChannelFactory.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java
trunk/client/src/test/java/com/metamatrix/common/lob/TestReaderInputStream.java
trunk/common-core/
trunk/common-core/src/main/java/com/metamatrix/common/jdbc/SimplePooledConnectionSource.java
trunk/common-core/src/main/java/com/metamatrix/common/protocol/mmfile/MMFileURLConnection.java
trunk/common-core/src/main/java/com/metamatrix/common/types/BlobImpl.java
trunk/common-core/src/main/java/com/metamatrix/common/types/BlobType.java
trunk/common-core/src/main/java/com/metamatrix/common/types/ClobImpl.java
trunk/common-core/src/main/java/com/metamatrix/common/types/ClobType.java
trunk/common-core/src/main/java/com/metamatrix/common/types/DataTypeManager.java
trunk/common-core/src/main/java/com/metamatrix/common/types/SQLXMLImpl.java
trunk/common-core/src/main/java/com/metamatrix/common/types/XMLType.java
trunk/common-core/src/main/java/com/metamatrix/common/util/NetUtils.java
trunk/common-core/src/main/java/com/metamatrix/common/util/SqlUtil.java
trunk/common-core/src/main/java/com/metamatrix/internal/core/log/PlatformLog.java
trunk/common-core/src/test/java/com/metamatrix/common/jdbc/TestSimplePooledConnectionSource.java
trunk/common-core/src/test/java/com/metamatrix/common/types/TestBlobValue.java
trunk/common-core/src/test/java/com/metamatrix/common/types/TestClobValue.java
trunk/common-core/src/test/java/com/metamatrix/common/types/TestSQLXMLImpl.java
trunk/common-core/src/test/java/com/metamatrix/common/types/TestXMLValue.java
trunk/common-core/src/test/java/com/metamatrix/common/types/basic/TestStringToXmlTransform.java
Log:
TEIID-177: adding language processors such that same code can be compiled aginst java 1.5
and java 1.6. Also between JDBC 4.0 and JDBC 3.0
Property changes on: trunk/client
___________________________________________________________________
Name: svn:mergeinfo
-
Modified:
trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -79,7 +79,9 @@
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/com/metamatrix/common/comm/platform/socket/SocketUtil.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/SocketUtil.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/SocketUtil.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -115,7 +115,12 @@
// 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/com/metamatrix/common/comm/platform/socket/client/OioOjbectChannelFactory.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/OioOjbectChannelFactory.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/OioOjbectChannelFactory.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -73,7 +73,9 @@
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,17 +100,23 @@
}
}
+ //## 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) {
@@ -123,7 +131,9 @@
}
}
+ //## 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>();
@@ -152,7 +162,9 @@
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/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -75,7 +75,9 @@
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/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -236,7 +236,9 @@
}
@SuppressWarnings("unchecked")
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public <T> T getService(Class<T> iface) {
return (T)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new
Class[] {iface}, new RemoteInvocationHandler(iface));
}
@@ -251,7 +253,9 @@
this.secure = !ClientSideDQP.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/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java
===================================================================
---
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -53,17 +53,23 @@
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>();
@@ -71,7 +77,9 @@
return result;
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public Object read() throws IOException,
ClassNotFoundException {
Object msg = readMsgs.get(readCount++);
@@ -87,18 +95,24 @@
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/client/src/test/java/com/metamatrix/common/lob/TestReaderInputStream.java
===================================================================
---
trunk/client/src/test/java/com/metamatrix/common/lob/TestReaderInputStream.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client/src/test/java/com/metamatrix/common/lob/TestReaderInputStream.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -53,7 +53,7 @@
ReaderInputStream ris = new ReaderInputStream(new StringReader(actual),
Charset.forName("UTF-16"), 1); //$NON-NLS-1$
byte[] result = new byte[(actual.length()) * 2 + 2];
ris.read(result);
- String resultString = new String(result, Charset.forName("UTF-16"));
//$NON-NLS-1$
+ String resultString = new String(result, "UTF-16"); //$NON-NLS-1$
assertEquals(resultString, actual);
}
@@ -62,7 +62,7 @@
ReaderInputStream ris = new ReaderInputStream(new StringReader(actual),
Charset.forName("US-ASCII"), 1); //$NON-NLS-1$
byte[] result = new byte[actual.length()];
ris.read(result);
- String resultString = new String(result, Charset.forName("US-ASCII"));
//$NON-NLS-1$
+ String resultString = new String(result, "US-ASCII"); //$NON-NLS-1$
assertEquals(resultString, actual);
}
Property changes on: trunk/client-jdbc
___________________________________________________________________
Name: svn:mergeinfo
-
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/DataTypeTransformer.java
===================================================================
---
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/DataTypeTransformer.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/DataTypeTransformer.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -27,7 +27,12 @@
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;
@@ -253,5 +258,5 @@
*/
static final SQLXML getSQLXML(Object value) throws SQLException {
return transform(value, SQLXML.class, DefaultDataClasses.XML, "SQLXML");
//$NON-NLS-1$
- }
+ }
}
\ No newline at end of file
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMBlob.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMBlob.java 2009-04-20 21:02:03
UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMBlob.java 2009-04-21 00:07:29
UTC (rev 809)
@@ -27,12 +27,12 @@
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
import com.metamatrix.common.lob.LobChunkInputStream;
import com.metamatrix.common.types.BlobImpl;
import com.metamatrix.common.types.BlobType;
import com.metamatrix.common.types.Streamable;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.dqp.client.impl.StreamingLobChunckProducer;
import com.metamatrix.jdbc.LobSearchUtil.StreamProvider;
@@ -185,28 +185,40 @@
}
public void free() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public InputStream getBinaryStream(long arg0, long arg1)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public OutputStream setBinaryStream(long arg0) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+
+ /**
+ * @see java.sql.Blob#setBytes(long, byte[])
+ */
+ public int setBytes(long pos, byte[] bytes) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public int setBytes(long arg0, byte[] arg1) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ /**
+ * @see java.sql.Blob#setBytes(long, byte[], int, int)
+ */
+ public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public int setBytes(long arg0, byte[] arg1, int arg2, int arg3)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ /**
+ * @see java.sql.Blob#setBinaryStream(long)
+ */
+ public OutputStream setBinaryStream(long pos) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void truncate(long arg0) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ /**
+ * @see java.sql.Blob#truncate(long)
+ */
+ public void truncate(long len) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMCallableStatement.java
===================================================================
---
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMCallableStatement.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMCallableStatement.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -31,17 +31,24 @@
import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.Date;
-import java.sql.NClob;
import java.sql.Ref;
-import java.sql.RowId;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
+//## 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;
import java.util.Map;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.common.util.TimestampWithTimezone;
import com.metamatrix.dqp.message.RequestMessage;
@@ -395,385 +402,385 @@
}
public Array getArray(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Array getArray(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public BigDecimal getBigDecimal(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Blob getBlob(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public boolean getBoolean(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public byte getByte(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public byte[] getBytes(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public byte[] getBytes(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Reader getCharacterStream(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Reader getCharacterStream(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Clob getClob(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Date getDate(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Date getDate(String parameterName, Calendar cal) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public double getDouble(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public float getFloat(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public int getInt(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public long getLong(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Reader getNCharacterStream(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Reader getNCharacterStream(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public NClob getNClob(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
+ //## JDBC4.0-begin ##
public NClob getNClob(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public String getNString(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public String getNString(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Object getObject(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public Object getObject(int parameterIndex, Map<String, Class<?>> map)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public Object getObject(int parameterIndex, Map<String, Class<?>> map)
throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public Object getObject(String parameterName, Map<String, Class<?>> map)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public Object getObject(String parameterName, Map<String, Class<?>> map)
throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Ref getRef(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Ref getRef(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public RowId getRowId(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
+ //## JDBC4.0-begin ##
public RowId getRowId(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public SQLXML getSQLXML(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public short getShort(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public String getString(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Time getTime(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Time getTime(String parameterName, Calendar cal) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Timestamp getTimestamp(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public Timestamp getTimestamp(String parameterName, Calendar cal)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
public URL getURL(int parameterIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public URL getURL(String parameterName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void registerOutParameter(String parameterName, int sqlType)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void registerOutParameter(String parameterName, int sqlType) throws SQLException
{
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void registerOutParameter(String parameterName, int sqlType,
- int scale) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void registerOutParameter(String parameterName, int sqlType,int scale) throws
SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void registerOutParameter(String parameterName, int sqlType,
- String typeName) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void registerOutParameter(String parameterName, int sqlType, String typeName)
throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void setAsciiStream(String parameterName, InputStream x)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void setAsciiStream(String parameterName, InputStream x, int length)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void setAsciiStream(String parameterName, InputStream x, int length) throws
SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void setAsciiStream(String parameterName, InputStream x, long length)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void setAsciiStream(String parameterName, InputStream x, long length) throws
SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void setBigDecimal(String parameterName, BigDecimal x)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void setBinaryStream(String parameterName, InputStream x)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBinaryStream(String parameterName, InputStream x, int length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBinaryStream(String parameterName, InputStream x, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBlob(String parameterName, Blob x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBlob(String parameterName, InputStream inputStream)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBlob(String parameterName, InputStream inputStream,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBoolean(String parameterName, boolean x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setByte(String parameterName, byte x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBytes(String parameterName, byte[] x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setCharacterStream(String parameterName, Reader reader)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
+ throw SqlUtil.createFeatureNotSupportedException(); }
public void setCharacterStream(String parameterName, Reader reader,
int length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setCharacterStream(String parameterName, Reader reader,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setClob(String parameterName, Clob x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setClob(String parameterName, Reader reader)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setClob(String parameterName, Reader reader, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setDate(String parameterName, Date x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setDate(String parameterName, Date x, Calendar cal)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setDouble(String parameterName, double x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setFloat(String parameterName, float x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setInt(String parameterName, int x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setLong(String parameterName, long x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNCharacterStream(String parameterName, Reader value)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNCharacterStream(String parameterName, Reader value,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public void setNClob(String parameterName, NClob value) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public void setNClob(String parameterName, Reader reader)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNClob(String parameterName, Reader reader, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNString(String parameterName, String value)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNull(String parameterName, int sqlType) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNull(String parameterName, int sqlType, String typeName)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setObject(String parameterName, Object x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setObject(String parameterName, Object x, int targetSqlType)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setObject(String parameterName, Object x, int targetSqlType,
int scale) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public void setRowId(String parameterName, RowId x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public void setSQLXML(String parameterName, SQLXML xmlObject)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+
public void setShort(String parameterName, short x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setString(String parameterName, String x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setTime(String parameterName, Time x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setTime(String parameterName, Time x, Calendar cal)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setTimestamp(String parameterName, Timestamp x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setTimestamp(String parameterName, Timestamp x, Calendar cal)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setURL(String parameterName, URL val) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
}
\ No newline at end of file
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMClob.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMClob.java 2009-04-20 21:02:03
UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMClob.java 2009-04-21 00:07:29
UTC (rev 809)
@@ -30,13 +30,13 @@
import java.nio.charset.Charset;
import java.sql.Clob;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
import com.metamatrix.common.lob.LobChunkInputStream;
import com.metamatrix.common.lob.ReaderInputStream;
import com.metamatrix.common.types.ClobImpl;
import com.metamatrix.common.types.ClobType;
import com.metamatrix.common.types.Streamable;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.dqp.client.impl.StreamingLobChunckProducer;
/**
@@ -198,32 +198,32 @@
}
public void free() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
+
public Reader getCharacterStream(long arg0, long arg1) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public OutputStream setAsciiStream(long arg0) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Writer setCharacterStream(long arg0) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public int setString(long arg0, String arg1) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public int setString(long arg0, String arg1, int arg2, int arg3)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void truncate(long arg0) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -28,14 +28,19 @@
import java.sql.Clob;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
-import java.sql.NClob;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
-import java.sql.SQLClientInfoException;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
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;
@@ -55,6 +60,7 @@
import com.metamatrix.common.api.MMURL;
import com.metamatrix.common.comm.api.ServerConnection;
import com.metamatrix.common.comm.exception.CommunicationException;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.common.xa.MMXid;
import com.metamatrix.common.xa.XATransactionException;
import com.metamatrix.dqp.client.ClientSideDQP;
@@ -684,7 +690,7 @@
*/
public PreparedStatement prepareStatement(String sql, int resultSetType, int
resultSetConcurrency,
int resultSetHoldability ) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
/**
@@ -861,7 +867,7 @@
protected MMXid getTransactionXid() {
return transactionXid;
}
-
+
public boolean isValid(int timeout) throws SQLException {
Statement statement = null;
try {
@@ -907,103 +913,113 @@
abstract BaseDriver getBaseDriver();
abstract boolean isSameProcess(MMConnection conn) throws CommunicationException;
-
+
+ //## JDBC4.0-begin ##
public void setClientInfo(Properties properties)
throws SQLClientInfoException {
-
- }
-
+ }
+
public void setClientInfo(String name, String value)
throws SQLClientInfoException {
- }
-
+ }
+ //## JDBC4.0-end ##
+
public Properties getClientInfo() throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+
public String getClientInfo(String name) throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+
public Array createArrayOf(String typeName, Object[] elements)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+
public Blob createBlob() throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+
public Clob createClob() throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+
+ //## JDBC4.0-begin ##
public NClob createNClob() throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+ //## JDBC4.0-end ##
+
public SQLXML createSQLXML() throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
public Statement createStatement(int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
+
}
-
+
public Struct createStruct(String typeName, Object[] attributes)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
public CallableStatement prepareCall(String sql, int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
+
}
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
+
}
public PreparedStatement prepareStatement(String sql, int[] columnIndexes)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
+
}
public PreparedStatement prepareStatement(String sql, String[] columnNames)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
+
}
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
+
}
public void rollback(Savepoint savepoint) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
+
}
public void setHoldability(int holdability) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Savepoint setSavepoint() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Savepoint setSavepoint(String name) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setTransactionIsolation(int level) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDatabaseMetaData.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDatabaseMetaData.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDatabaseMetaData.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -27,9 +27,10 @@
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
+//## JDBC4.0-begin ##
import java.sql.RowIdLifetime;
+//## JDBC4.0-end ##
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Arrays;
@@ -43,6 +44,7 @@
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.common.types.MMJDBCSQLTypeInfo;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.dqp.message.ResultsMessage;
import com.metamatrix.dqp.metadata.ResultsMetadataConstants;
@@ -3304,34 +3306,34 @@
return false;
}
- public ResultSet getAttributes(String catalog, String schemaPattern,
- String typeNamePattern, String attributeNamePattern)
+ public ResultSet getAttributes(String catalog, String schemaPattern, String
typeNamePattern, String attributeNamePattern)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public ResultSet getClientInfoProperties() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public ResultSet getFunctionColumns(String catalog, String schemaPattern,
String functionNamePattern, String columnNamePattern)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public ResultSet getFunctions(String catalog, String schemaPattern,
String functionNamePattern) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public RowIdLifetime getRowIdLifetime() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public ResultSet getSchemas(String catalog, String schemaPattern)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMPreparedStatement.java
===================================================================
---
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMPreparedStatement.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMPreparedStatement.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -30,16 +30,23 @@
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
-import java.sql.NClob;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
-import java.sql.RowId;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
+
+//## 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.Types;
import java.util.ArrayList;
import java.util.Calendar;
@@ -54,6 +61,7 @@
import com.metamatrix.common.types.BlobImpl;
import com.metamatrix.common.types.ClobImpl;
import com.metamatrix.common.types.MMJDBCSQLTypeInfo;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.common.util.TimestampWithTimezone;
import com.metamatrix.core.util.ArgCheck;
import com.metamatrix.dqp.client.MetadataResult;
@@ -168,7 +176,9 @@
throw new MMSQLException(msg);
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public boolean execute() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, null);
return hasResultSet();
@@ -187,13 +197,17 @@
return this.updateCounts;
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public ResultSet executeQuery() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, true);
return resultSet;
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public int executeUpdate() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, false);
return this.updateCounts[0];
@@ -467,7 +481,7 @@
setObject(parameterIndex, bigDecimalObject);
}
}
-
+
public void setObject(int parameterIndex, Object value, int targetJdbcType) throws
SQLException {
Object targetObject = null;
@@ -665,96 +679,99 @@
}
public void setArray(int parameterIndex, Array x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setAsciiStream(int parameterIndex, InputStream x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setAsciiStream(int parameterIndex, InputStream x, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBinaryStream(int parameterIndex, InputStream x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBinaryStream(int parameterIndex, InputStream x, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setBlob(int parameterIndex, InputStream inputStream)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void setBlob(int parameterIndex, InputStream inputStream, long length)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws
SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setCharacterStream(int parameterIndex, Reader reader)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setCharacterStream(int parameterIndex, Reader reader,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setClob(int parameterIndex, Reader reader) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setClob(int parameterIndex, Reader reader, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNCharacterStream(int parameterIndex, Reader value)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNCharacterStream(int parameterIndex, Reader value,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public void setNClob(int parameterIndex, NClob value) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public void setNClob(int parameterIndex, Reader reader) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNClob(int parameterIndex, Reader reader, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setNString(int parameterIndex, String value)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setRef(int parameterIndex, Ref x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public void setRowId(int parameterIndex, RowId x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public void setUnicodeStream(int parameterIndex, InputStream x, int length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMResultSet.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMResultSet.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMResultSet.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -30,15 +30,20 @@
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
-import java.sql.NClob;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
-import java.sql.RowId;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLWarning;
+//## JDBC4.0-begin ##
+import java.sql.RowId;
+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.Time;
import java.sql.Timestamp;
import java.util.Calendar;
@@ -54,6 +59,7 @@
import com.metamatrix.common.types.ClobType;
import com.metamatrix.common.types.Streamable;
import com.metamatrix.common.types.XMLType;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.common.util.TimestampWithTimezone;
import com.metamatrix.dqp.client.ResultsFuture;
import com.metamatrix.dqp.client.impl.StreamingLobChunckProducer;
@@ -385,7 +391,9 @@
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
@@ -1366,23 +1374,23 @@
}
public void deleteRow() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Array getArray(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Array getArray(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public InputStream getAsciiStream(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public InputStream getAsciiStream(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Clob getClob(int columnIndex) throws SQLException {
@@ -1397,521 +1405,505 @@
return getClob(findColumn(columnLabel));
}
+
public int getHoldability() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Reader getNCharacterStream(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Reader getNCharacterStream(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public NClob getNClob(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public NClob getNClob(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
+ //## JDBC4.0-end ##
+
public String getNString(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public String getNString(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
+
public Object getObject(int columnIndex, Map<String, Class<?>> map)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Object getObject(String columnLabel, Map<String, Class<?>> map)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Ref getRef(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Ref getRef(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public RowId getRowId(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
+ //## JDBC4.0-begin ##
public RowId getRowId(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public SQLXML getSQLXML(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public InputStream getUnicodeStream(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public InputStream getUnicodeStream(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
+
public URL getURL(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public URL getURL(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void insertRow() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void moveToInsertRow() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void refreshRow() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public boolean rowDeleted() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public boolean rowInserted() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public boolean rowUpdated() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setFetchDirection(int direction) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setFetchSize(int rows) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateArray(int columnIndex, Array x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateArray(String columnLabel, Array x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+
public void updateAsciiStream(int columnIndex, InputStream x, int length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
+
+ public void updateAsciiStream(String columnLabel, InputStream x, int length)
+ throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+
public void updateAsciiStream(int columnIndex, InputStream x, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateAsciiStream(int columnIndex, InputStream x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void updateAsciiStream(String columnLabel, InputStream x, int length)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
public void updateAsciiStream(String columnLabel, InputStream x, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateAsciiStream(String columnLabel, InputStream x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBigDecimal(int columnIndex, BigDecimal x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBigDecimal(String columnLabel, BigDecimal x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBinaryStream(int columnIndex, InputStream x, int length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+
+ public void updateBinaryStream(String columnLabel, InputStream x, int length)
+ throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+
public void updateBinaryStream(int columnIndex, InputStream x, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBinaryStream(int columnIndex, InputStream x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void updateBinaryStream(String columnLabel, InputStream x, int length)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
public void updateBinaryStream(String columnLabel, InputStream x,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBinaryStream(String columnLabel, InputStream x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBlob(int columnIndex, Blob x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
+
+ public void updateBlob(String columnLabel, Blob x) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
public void updateBlob(int columnIndex, InputStream inputStream, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBlob(int columnIndex, InputStream inputStream)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
- public void updateBlob(String columnLabel, Blob x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
+
public void updateBlob(String columnLabel, InputStream inputStream,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
+
public void updateBlob(String columnLabel, InputStream inputStream)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
+
public void updateBoolean(int columnIndex, boolean x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBoolean(String columnLabel, boolean x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateByte(int columnIndex, byte x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateByte(String columnLabel, byte x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBytes(int columnIndex, byte[] x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateBytes(String columnLabel, byte[] x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+
public void updateCharacterStream(int columnIndex, Reader x, int length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+
+ public void updateCharacterStream(String columnLabel, Reader reader,
+ int length) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
public void updateCharacterStream(int columnIndex, Reader x, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateCharacterStream(int columnIndex, Reader x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateCharacterStream(String columnLabel, Reader reader,
- int length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
- public void updateCharacterStream(String columnLabel, Reader reader,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateCharacterStream(String columnLabel, Reader reader)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateClob(int columnIndex, Clob x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ public void updateClob(String columnLabel, Clob x) throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
+ }
+
public void updateClob(int columnIndex, Reader reader, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateClob(int columnIndex, Reader reader) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
- public void updateClob(String columnLabel, Clob x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
- }
-
public void updateClob(String columnLabel, Reader reader, long length)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateClob(String columnLabel, Reader reader)
- throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throws SQLException {
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateDate(int columnIndex, Date x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateDate(String columnLabel, Date x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateDouble(int columnIndex, double x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateDouble(String columnLabel, double x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateFloat(int columnIndex, float x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateFloat(String columnLabel, float x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateInt(int columnIndex, int x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateInt(String columnLabel, int x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateLong(int columnIndex, long x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateLong(String columnLabel, long x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNCharacterStream(int columnIndex, Reader x, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNCharacterStream(int columnIndex, Reader x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNCharacterStream(String columnLabel, Reader reader,
long length) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNCharacterStream(String columnLabel, Reader reader)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public void updateNClob(int columnIndex, NClob clob) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public void updateNClob(int columnIndex, Reader reader, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNClob(int columnIndex, Reader reader) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public void updateNClob(String columnLabel, NClob clob) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public void updateNClob(String columnLabel, Reader reader, long length)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNClob(String columnLabel, Reader reader)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNString(int columnIndex, String string)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNString(String columnLabel, String string)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNull(int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateNull(String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateObject(int columnIndex, Object x, int scaleOrLength)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateObject(int columnIndex, Object x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateObject(String columnLabel, Object x, int scaleOrLength)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateObject(String columnLabel, Object x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateRef(int columnIndex, Ref x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateRef(String columnLabel, Ref x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateRow() throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-begin ##
public void updateRowId(int columnIndex, RowId x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
+ //## JDBC4.0-begin ##
public void updateRowId(String columnLabel, RowId x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
public void updateShort(int columnIndex, short x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateShort(String columnLabel, short x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateSQLXML(int columnIndex, SQLXML xmlObject)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateSQLXML(String columnLabel, SQLXML xmlObject)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateString(int columnIndex, String x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateString(String columnLabel, String x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateTime(int columnIndex, Time x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateTime(String columnLabel, Time x) throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateTimestamp(int columnIndex, Timestamp x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
-
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void updateTimestamp(String columnLabel, Timestamp x)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMSQLXML.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMSQLXML.java 2009-04-20 21:02:03
UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMSQLXML.java 2009-04-21 00:07:29
UTC (rev 809)
@@ -29,9 +29,14 @@
import java.io.Writer;
import java.nio.charset.Charset;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
+//## 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 javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
@@ -39,6 +44,7 @@
import com.metamatrix.common.lob.LobChunkInputStream;
import com.metamatrix.common.types.Streamable;
import com.metamatrix.common.types.XMLType;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.dqp.client.impl.StreamingLobChunckProducer;
@@ -72,7 +78,12 @@
public String getString() throws SQLException {
LobChunkInputStream in = new
LobChunkInputStream(lobChunckFactory.getLobChunkProducer());
try {
+ //## JDBC4.0-begin ##
return new String(in.getByteContents(), Charset.forName("UTF-16"));
//$NON-NLS-1$
+ //## JDBC4.0-end ##
+ /*## JDBC3.0-JDK1.5-begin ##
+ return new String(in.getByteContents(), "UTF-16"); //$NON-NLS-1$
+ ## JDBC3.0-JDK1.5-end ##*/
} catch (IOException e) {
throw MMSQLException.create(e);
}
@@ -94,28 +105,27 @@
}
public InputStream getBinaryStream() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void free() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public OutputStream setBinaryStream() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Writer setCharacterStream() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public <T extends Result> T setResult(Class<T> resultClass)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setString(String value) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMStatement.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMStatement.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMStatement.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -29,7 +29,6 @@
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLWarning;
import java.util.ArrayList;
import java.util.Calendar;
@@ -52,6 +51,7 @@
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.common.comm.exception.CommunicationException;
import com.metamatrix.common.util.PropertiesUtils;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.dqp.client.ClientSideDQP;
import com.metamatrix.dqp.message.ParameterInfo;
import com.metamatrix.dqp.message.RequestMessage;
@@ -83,7 +83,7 @@
// integer indicating no maximum limit - used in some metadata-ish methods.
private static final int NO_LIMIT = 0;
- // ######## Configuration state #############
+ //######## Configuration state #############
private MMConnection driverConnection;
private Properties execProps = null;
@@ -100,7 +100,7 @@
private int resultSetType = ResultSet.TYPE_FORWARD_ONLY;
private int resultSetConcurrency = ResultSet.CONCUR_READ_ONLY;
- // ######## Processing state #############
+ //######## Processing state #############
// boolean to indicate if this statement object is closed
private boolean isClosed = false;
@@ -111,7 +111,7 @@
// number of seconds for the query to timeout.
protected int queryTimeout = NO_TIMEOUT;
- // ########## Per-execution state ########
+ //########## Per-execution state ########
// ID for current request
protected long currentRequestID = -1;
@@ -320,13 +320,17 @@
}
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public boolean execute(String sql) throws SQLException {
executeSql(new String[] {sql}, false, null);
return hasResultSet();
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public int[] executeBatch() throws SQLException {
if (batchedUpdates == null || batchedUpdates.isEmpty()) {
return new int[0];
@@ -336,13 +340,17 @@
return updateCounts;
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public ResultSet executeQuery(String sql) throws SQLException {
executeSql(new String[] {sql}, false, true);
return resultSet;
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public int executeUpdate(String sql) throws SQLException {
String[] commands = new String[] {sql};
executeSql(commands, false, false);
@@ -825,7 +833,7 @@
* @throws CommunicationException
*/
protected ResultsMessage sendRequestMessageAndWait(RequestMessage reqMsg)
- throws SQLException, InterruptedException, TimeoutException,
CommunicationException {
+ throws SQLException, InterruptedException, TimeoutException {
this.currentRequestID = this.driverConnection.nextRequestID();
// Create a request message
@@ -1038,47 +1046,46 @@
public boolean execute(String sql, int autoGeneratedKeys)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public boolean execute(String sql, int[] columnIndexes) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public boolean execute(String sql, String[] columnNames)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public int executeUpdate(String sql, int autoGeneratedKeys)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public int executeUpdate(String sql, int[] columnIndexes)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public int executeUpdate(String sql, String[] columnNames)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public ResultSet getGeneratedKeys() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public int getResultSetHoldability() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setCursorName(String name) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void setMaxFieldSize(int max) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
-
}
\ No newline at end of file
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMXAConnection.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMXAConnection.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMXAConnection.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -33,7 +33,9 @@
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;
@@ -164,10 +166,11 @@
}
}
+ //## JDBC4.0-begin ##
public void addStatementEventListener(StatementEventListener arg0) {
}
public void removeStatementEventListener(StatementEventListener arg0) {
}
-
+ //## JDBC4.0-end ##
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/WarningUtil.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/WarningUtil.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/WarningUtil.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -51,7 +51,13 @@
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 ##*/
+
}
/**
@@ -76,5 +82,4 @@
return warning;
}
-
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/WrapperImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/WrapperImpl.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/WrapperImpl.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -23,12 +23,17 @@
package com.metamatrix.jdbc;
import java.sql.SQLException;
+//## JDBC4.0-begin ##
import java.sql.Wrapper;
+//## JDBC4.0-end ##
import com.metamatrix.core.util.ArgCheck;
-public class WrapperImpl implements Wrapper {
-
+public class WrapperImpl
+ //## JDBC4.0-begin ##
+ implements Wrapper
+ //## JDBC4.0-end ##
+ {
public boolean isWrapperFor(Class<?> iface) throws SQLException {
ArgCheck.isNotNull(iface);
Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMResultSet.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMResultSet.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMResultSet.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -688,11 +688,11 @@
try {
return TestAllResultsImpl.helpTestBatching(statement, fetchSize, Math.min(fetchSize,
totalResults), totalResults);
} catch (MetaMatrixProcessingException e) {
- throw new SQLException(e);
+ throw new SQLException(e.getMessage());
} catch (InterruptedException e) {
- throw new SQLException(e);
+ throw new SQLException(e.getMessage());
} catch (ExecutionException e) {
- throw new SQLException(e);
+ throw new SQLException(e.getMessage());
}
}
Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMXAConnection.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMXAConnection.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMXAConnection.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -40,14 +40,16 @@
final MMConnection mmConn = TestMMConnection.getMMConnection();
MMXAConnection xaConn = new MMXAConnection(new MMXAConnection.ConnectionSource() {
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public MMConnection createConnection() throws SQLException {
return mmConn;
}
});
Connection conn = xaConn.getConnection();
- Statement stmt = conn.createStatement();
+ MMStatement stmt = (MMStatement)conn.createStatement();
conn.setAutoCommit(false);
conn.close();
@@ -55,7 +57,7 @@
assertTrue(conn.getAutoCommit());
conn = xaConn.getConnection();
- stmt = conn.createStatement();
+ stmt = (MMStatement)conn.createStatement();
XAResource resource = xaConn.getXAResource();
resource.start(new MMXid(1, new byte[0], new byte[0]), XAResource.TMNOFLAGS);
conn.close();
Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestWrapperImpl.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestWrapperImpl.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestWrapperImpl.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -27,12 +27,14 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.SQLException;
+//## JDBC4.0-begin ##
import java.sql.Wrapper;
+//## JDBC4.0-end ##
import junit.framework.TestCase;
public class TestWrapperImpl extends TestCase {
-
+ //## JDBC4.0-begin ##
interface Foo extends Wrapper {
void callMe();
}
@@ -46,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() {
@@ -81,7 +83,7 @@
} catch (SQLException e) {
assertEquals("Wrapped object is not an instance of class java.lang.String",
e.getMessage());
}
-
+ //## JDBC4.0-end ##
}
}
Property changes on: trunk/common-core
___________________________________________________________________
Name: svn:mergeinfo
-
Modified:
trunk/common-core/src/main/java/com/metamatrix/common/jdbc/SimplePooledConnectionSource.java
===================================================================
---
trunk/common-core/src/main/java/com/metamatrix/common/jdbc/SimplePooledConnectionSource.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/main/java/com/metamatrix/common/jdbc/SimplePooledConnectionSource.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -7,7 +7,10 @@
import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.SQLException;
+//## JDBC4.0-begin ##
import java.sql.SQLFeatureNotSupportedException;
+//## JDBC4.0-end ##
+
import java.util.Properties;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Semaphore;
@@ -47,8 +50,12 @@
*
* TODO: Should be switched to proxool or some implementation
*/
-public class SimplePooledConnectionSource implements DataSource {
-
+public class SimplePooledConnectionSource
+ //## JDBC4.0-begin ##
+ implements DataSource
+ //## JDBC4.0-end ##
+{
+ //## JDBC4.0-begin ##
public static final String WAIT_TIME_FOR_RESOURCE=
"pooling.resource.pool.wait.time"; //$NON-NLS-1$
public static final String MAXIMUM_RESOURCE_POOL_SIZE =
"pooling.resource.pool.maximum.size"; //$NON-NLS-1$
public static final String RESOURCE_TEST_INTERVAL =
"pooling.resource.pool.test.interval"; //$NON-NLS-1$
@@ -230,5 +237,7 @@
public <T> T unwrap(Class<T> arg0) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
+ //## JDBC4.0-end ##
+}
-}
+
Modified:
trunk/common-core/src/main/java/com/metamatrix/common/protocol/mmfile/MMFileURLConnection.java
===================================================================
---
trunk/common-core/src/main/java/com/metamatrix/common/protocol/mmfile/MMFileURLConnection.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/main/java/com/metamatrix/common/protocol/mmfile/MMFileURLConnection.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -175,14 +175,18 @@
String sort = props.getProperty(FILE_LIST_SORT, DATE);
if (sort.equals(DATE)) {
Arrays.sort(matchedFiles, new Comparator<File>() {
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public int compare(File o1, File o2) {
return Long.valueOf(o2.lastModified()).compareTo(o1.lastModified()); // latest
first.
}
});
} else if (sort.equals(ALPHA)) {
Arrays.sort(matchedFiles, new Comparator<File>() {
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public int compare(File o1, File o2) {
return o1.getName().compareTo(o2.getName());
}
@@ -190,7 +194,9 @@
} else if (sort.equals(REVERSEALPHA)) {
Arrays.sort(matchedFiles, new Comparator<File>() {
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public int compare(File o1, File o2) {
return o2.getName().compareTo(o1.getName());
}
Modified: trunk/common-core/src/main/java/com/metamatrix/common/types/BlobImpl.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/BlobImpl.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/BlobImpl.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -29,8 +29,8 @@
import java.io.Serializable;
import java.sql.Blob;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.core.CorePlugin;
/**
@@ -262,37 +262,37 @@
* @see java.sql.Blob#setBytes(long, byte[])
*/
public int setBytes(long pos, byte[] bytes) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
/**
* @see java.sql.Blob#setBytes(long, byte[], int, int)
*/
public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
/**
* @see java.sql.Blob#setBinaryStream(long)
*/
public OutputStream setBinaryStream(long pos) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
/**
* @see java.sql.Blob#truncate(long)
*/
public void truncate(long len) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void free() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public InputStream getBinaryStream(long arg0, long arg1)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
}
Modified: trunk/common-core/src/main/java/com/metamatrix/common/types/BlobType.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/BlobType.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/BlobType.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -228,7 +228,7 @@
writer.close();
return data;
}
-
+ //## JDBC4.0-begin ##
public void free() throws SQLException {
checkReference();
this.srcBlob.free();
@@ -239,4 +239,5 @@
checkReference();
return this.srcBlob.getBinaryStream(pos, length);
}
+ //## JDBC4.0-end ##
}
Modified: trunk/common-core/src/main/java/com/metamatrix/common/types/ClobImpl.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/ClobImpl.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/ClobImpl.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -34,9 +34,13 @@
import java.nio.charset.Charset;
import java.sql.Clob;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
import java.util.Arrays;
+/*## JDBC3.0-JDK1.5-begin ##
+import java.io.UnsupportedEncodingException;
+## JDBC3.0-JDK1.5-end ##*/
+
+import com.metamatrix.common.util.SqlUtil;
import com.metamatrix.core.CorePlugin;
/**
@@ -111,7 +115,17 @@
* <code>CLOB</code> value
*/
public InputStream getAsciiStream() throws SQLException {
+ //## JDBC4.0-begin ##
byte[] bytes = new String(data).getBytes(Charset.forName("US-ASCII"));
//$NON-NLS-1$
+ //## JDBC4.0-end ##
+ /*## JDBC3.0-JDK1.5-begin ##
+ byte[] bytes;
+ try {
+ bytes = new String(data).getBytes("US-ASCII"); //$NON-NLS-1$
+ } catch (UnsupportedEncodingException e) {
+ throw new SQLException(e.getMessage());
+ }
+ ## JDBC3.0-JDK1.5-end ##*/
return new ByteArrayInputStream(bytes);
}
@@ -285,43 +299,43 @@
* @see java.sql.Clob#setString(long, java.lang.String)
*/
public int setString(long pos, String str) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
/**
* @see java.sql.Clob#setString(long, java.lang.String, int, int)
*/
public int setString(long pos, String str, int offset, int len) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
/**
* @see java.sql.Clob#setAsciiStream(long)
*/
public OutputStream setAsciiStream(long pos) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
/**
* @see java.sql.Clob#setCharacterStream(long)
*/
public Writer setCharacterStream(long pos) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
/**
* @see java.sql.Clob#truncate(long)
*/
public void truncate(long len) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public void free() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public Reader getCharacterStream(long arg0, long arg1) throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
}
Modified: trunk/common-core/src/main/java/com/metamatrix/common/types/ClobType.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/ClobType.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/ClobType.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -293,7 +293,7 @@
};
}
-
+ //## JDBC4.0-begin ##
public void free() throws SQLException {
checkReference();
this.srcClob.free();
@@ -303,4 +303,5 @@
checkReference();
return this.srcClob.getCharacterStream(pos, length);
}
+ //## JDBC4.0-end ##
}
Modified:
trunk/common-core/src/main/java/com/metamatrix/common/types/DataTypeManager.java
===================================================================
---
trunk/common-core/src/main/java/com/metamatrix/common/types/DataTypeManager.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/main/java/com/metamatrix/common/types/DataTypeManager.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -24,7 +24,14 @@
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.Timestamp;
import java.util.Arrays;
import java.util.Collections;
@@ -974,55 +981,73 @@
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(new ClobImpl(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);
}
});
sourceConverters.put(byte[].class, new SourceTransform<byte[], BlobType>() {
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public BlobType transform(byte[] value) {
return new BlobType(new BlobImpl(value));
}
});
sourceConverters.put(SQLXML.class, new SourceTransform<SQLXML, XMLType>() {
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public XMLType transform(SQLXML value) {
return new XMLType(value);
}
});
sourceConverters.put(DOMSource.class, new SourceTransform<DOMSource, XMLType>()
{
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public XMLType transform(DOMSource value) {
return new XMLType(new SQLXMLImpl(value));
}
});
sourceConverters.put(SAXSource.class, new SourceTransform<SAXSource, XMLType>()
{
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public XMLType transform(SAXSource value) {
return new XMLType(new SQLXMLImpl(value));
}
});
sourceConverters.put(StreamSource.class, new SourceTransform<StreamSource,
XMLType>() {
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public XMLType transform(StreamSource value) {
return new XMLType(new SQLXMLImpl(value));
}
});
sourceConverters.put(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/com/metamatrix/common/types/SQLXMLImpl.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/SQLXMLImpl.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/SQLXMLImpl.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -28,8 +28,14 @@
import java.io.Reader;
import java.io.Writer;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
+//## 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.io.UnsupportedEncodingException;
import java.util.Properties;
import javax.xml.transform.Result;
@@ -38,7 +44,9 @@
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
+import com.metamatrix.common.util.SqlUtil;
+
/**
* This metamatrix specific implementation of the SQLXML interface;
*/
@@ -158,11 +166,11 @@
}
public void free() throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
public <T extends Result> T setResult(Class<T> resultClass)
throws SQLException {
- throw new SQLFeatureNotSupportedException();
+ throw SqlUtil.createFeatureNotSupportedException();
}
}
Modified: trunk/common-core/src/main/java/com/metamatrix/common/types/XMLType.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/XMLType.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/XMLType.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -27,8 +27,14 @@
import java.io.Reader;
import java.io.Writer;
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 javax.xml.transform.Result;
import javax.xml.transform.Source;
Modified: trunk/common-core/src/main/java/com/metamatrix/common/util/NetUtils.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/util/NetUtils.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/common-core/src/main/java/com/metamatrix/common/util/NetUtils.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -118,7 +118,9 @@
Enumeration<NetworkInterface> ne = NetworkInterface.getNetworkInterfaces();
while (ne.hasMoreElements()) {
NetworkInterface ni = ne.nextElement();
+ //## JDBC4.0-begin ##
if (ni.isUp()) {
+ //## JDBC4.0-end ##
Enumeration<InetAddress> addrs = ni.getInetAddresses();
while (addrs.hasMoreElements()) {
InetAddress addr = addrs.nextElement();
@@ -128,7 +130,9 @@
return addr;
}
}
+ //## JDBC4.0-begin ##
}
+ //## JDBC4.0-end ##
}
} catch (SocketException e) {
// treat this as address not found and return null;
Modified: trunk/common-core/src/main/java/com/metamatrix/common/util/SqlUtil.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/util/SqlUtil.java 2009-04-20
21:02:03 UTC (rev 808)
+++ trunk/common-core/src/main/java/com/metamatrix/common/util/SqlUtil.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -22,6 +22,12 @@
package com.metamatrix.common.util;
+import java.sql.SQLException;
+
+//## JDBC4.0-begin ##
+import java.sql.SQLFeatureNotSupportedException;
+//## JDBC4.0-end ##
+
import java.util.regex.Pattern;
import com.metamatrix.core.util.ArgCheck;
@@ -104,4 +110,15 @@
}
return isDifferent;
}
+
+ 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/main/java/com/metamatrix/internal/core/log/PlatformLog.java
===================================================================
---
trunk/common-core/src/main/java/com/metamatrix/internal/core/log/PlatformLog.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/main/java/com/metamatrix/internal/core/log/PlatformLog.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -139,7 +139,9 @@
return t;
}});
this.executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy());
+ //## JDBC4.0-begin ##
this.executor.allowCoreThreadTimeOut(true);
+ //## JDBC4.0-end ##
}
public List getLogListeners() {
Modified:
trunk/common-core/src/test/java/com/metamatrix/common/jdbc/TestSimplePooledConnectionSource.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/jdbc/TestSimplePooledConnectionSource.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/test/java/com/metamatrix/common/jdbc/TestSimplePooledConnectionSource.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -33,7 +33,7 @@
import com.metamatrix.api.exception.MetaMatrixException;
public class TestSimplePooledConnectionSource extends TestCase {
-
+ //## JDBC4.0-begin ##
public void testMax() throws Exception {
Properties p = new Properties();
p.setProperty(SimplePooledConnectionSource.MAXIMUM_RESOURCE_POOL_SIZE,
String.valueOf(2));
@@ -63,5 +63,5 @@
c.close();
assertSame(c, pool.getConnection());
}
-
+ //## JDBC4.0-end ##
}
Modified: trunk/common-core/src/test/java/com/metamatrix/common/types/TestBlobValue.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/types/TestBlobValue.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/test/java/com/metamatrix/common/types/TestBlobValue.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -28,6 +28,8 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import com.metamatrix.core.util.UnitTestUtil;
+
import junit.framework.TestCase;
@@ -51,7 +53,7 @@
bv.setReferenceStreamId(key);
// now force to serialize
- File saved = new File("blobassaved.bin"); //$NON-NLS-1$
+ File saved = new
File(UnitTestUtil.getTestScratchPath()+"/blobassaved.bin"); //$NON-NLS-1$
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(saved));
out.writeObject(bv);
out.close();
Modified: trunk/common-core/src/test/java/com/metamatrix/common/types/TestClobValue.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/types/TestClobValue.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/test/java/com/metamatrix/common/types/TestClobValue.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -28,6 +28,8 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import com.metamatrix.core.util.UnitTestUtil;
+
import junit.framework.TestCase;
@@ -51,7 +53,7 @@
cv.setReferenceStreamId(key);
// now force to serialize
- File saved = new File("clobassaved.bin"); //$NON-NLS-1$
+ File saved = new
File(UnitTestUtil.getTestScratchPath()+"/clobassaved.bin"); //$NON-NLS-1$
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(saved));
out.writeObject(cv);
out.close();
Modified: trunk/common-core/src/test/java/com/metamatrix/common/types/TestSQLXMLImpl.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/types/TestSQLXMLImpl.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/test/java/com/metamatrix/common/types/TestSQLXMLImpl.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -66,6 +66,7 @@
}
};
+ //## JDBC4.0-begin ##
public void testGetSource() throws Exception {
SQLXMLImpl xml = new SQLXMLImpl(translator);
assertTrue(xml.getSource(null) instanceof StreamSource);
@@ -73,6 +74,7 @@
StreamSource ss = (StreamSource)xml.getSource(null);
assertEquals(testStr, getContents(ss.getReader()));
}
+ //## JDBC4.0-end ##
public void testGetCharacterStream() throws Exception {
SQLXMLImpl xml = new SQLXMLImpl(translator);
Modified: trunk/common-core/src/test/java/com/metamatrix/common/types/TestXMLValue.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/types/TestXMLValue.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/test/java/com/metamatrix/common/types/TestXMLValue.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -28,6 +28,8 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import com.metamatrix.core.util.UnitTestUtil;
+
import junit.framework.TestCase;
@@ -53,7 +55,7 @@
xv.setPersistenceStreamId(pkey);
// now force to serialize
- File saved = new File("xmlsaved.bin"); //$NON-NLS-1$
+ File saved = new
File(UnitTestUtil.getTestScratchPath()+"/xmlsaved.bin"); //$NON-NLS-1$
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(saved));
out.writeObject(xv);
out.close();
Modified:
trunk/common-core/src/test/java/com/metamatrix/common/types/basic/TestStringToXmlTransform.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/types/basic/TestStringToXmlTransform.java 2009-04-20
21:02:03 UTC (rev 808)
+++
trunk/common-core/src/test/java/com/metamatrix/common/types/basic/TestStringToXmlTransform.java 2009-04-21
00:07:29 UTC (rev 809)
@@ -22,8 +22,14 @@
package com.metamatrix.common.types.basic;
+//## 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 com.metamatrix.common.types.TransformationException;
import junit.framework.TestCase;