teiid SVN: r812 - trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-20 22:41:33 -0400 (Mon, 20 Apr 2009)
New Revision: 812
Modified:
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.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
Modified: trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java 2009-04-21 02:16:03 UTC (rev 811)
+++ trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java 2009-04-21 02:41:33 UTC (rev 812)
@@ -59,20 +59,26 @@
Throwable t;
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void assertIdentity(SessionToken sessionId)
throws InvalidSessionException, MetaMatrixComponentException {
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public ResultsFuture<?> logoff()
throws InvalidSessionException,
MetaMatrixComponentException {
return null;
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public LogonResult logon(
Properties connectionProperties)
throws LogonException,
@@ -80,7 +86,9 @@
return new LogonResult(new SessionToken(new MetaMatrixSessionID(1), "fooUser"), new Properties(), "fake"); //$NON-NLS-1$ //$NON-NLS-2$
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public ResultsFuture<?> ping()
throws InvalidSessionException,
MetaMatrixComponentException {
@@ -120,7 +128,9 @@
public void testLogonFailsWithMultipleHosts() throws Exception {
Properties p = new Properties();
SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public SocketServerInstance getServerInstance(HostInfo info,
boolean ssl) throws CommunicationException, IOException {
throw new SingleInstanceCommunicationException();
@@ -182,7 +192,9 @@
Properties p = new Properties();
ServerDiscovery discovery = new UrlServerDiscovery(new MMURL(hostInfo.getHostName(), hostInfo.getPortNumber(), false));
SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public SocketServerInstance getServerInstance(final HostInfo info,
boolean ssl) throws CommunicationException, IOException {
SocketServerInstance instance = Mockito.mock(SocketServerInstance.class);
15 years, 8 months
teiid SVN: r811 - in trunk: client-jdbc30 and 2 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-20 22:16:03 -0400 (Mon, 20 Apr 2009)
New Revision: 811
Modified:
trunk/client-jdbc30/
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/UrlServerDiscovery.java
trunk/common-core/src/main/java/com/metamatrix/api/exception/ExceptionHolder.java
trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java
trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.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
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-21 00:10:07 UTC (rev 810)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java 2009-04-21 02:16:03 UTC (rev 811)
@@ -105,12 +105,16 @@
}
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public HostInfo getHostInfo() {
return this.hostInfo;
}
- @Override
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
public SocketAddress getRemoteAddress() {
return this.socketChannel.getRemoteAddress();
}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java 2009-04-21 00:10:07 UTC (rev 810)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java 2009-04-21 02:16:03 UTC (rev 811)
@@ -43,28 +43,38 @@
this.url = url;
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public List<HostInfo> getKnownHosts(LogonResult result,
SocketServerInstance instance) {
return url.getHostInfo();
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void init(MMURL url, Properties p) {
this.url = url;
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void connectionSuccessful(HostInfo info) {
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void markInstanceAsBad(HostInfo info) {
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void shutdown() {
}
Property changes on: trunk/client-jdbc30
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
.settings
+ .classpath
.project
.settings
target
Modified: trunk/common-core/src/main/java/com/metamatrix/api/exception/ExceptionHolder.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/api/exception/ExceptionHolder.java 2009-04-21 00:10:07 UTC (rev 810)
+++ trunk/common-core/src/main/java/com/metamatrix/api/exception/ExceptionHolder.java 2009-04-21 02:16:03 UTC (rev 811)
@@ -59,7 +59,9 @@
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
List<String> classNames = (List<String>)in.readObject();;
String message = (String)in.readObject();
@@ -90,7 +92,9 @@
}
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void writeExternal(ObjectOutput out) throws IOException {
List<String> classNames = new ArrayList<String>();
Class<?> clazz = exception.getClass();
Modified: trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java 2009-04-21 00:10:07 UTC (rev 810)
+++ trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java 2009-04-21 02:16:03 UTC (rev 811)
@@ -95,13 +95,17 @@
return this.throwablesList;
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException {
this.code = (String)in.readObject();
this.throwablesList = ExceptionHolder.toThrowables((List<ExceptionHolder>)in.readObject());
}
+ //## JDBC4.0-begin ##
@Override
+ //## JDBC4.0-end ##
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(code);
out.writeObject(ExceptionHolder.toExceptionHolders(throwablesList));
Modified: trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java 2009-04-21 00:10:07 UTC (rev 810)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java 2009-04-21 02:16:03 UTC (rev 811)
@@ -24,7 +24,13 @@
import java.sql.Blob;
import java.sql.Clob;
+//## JDBC4.0-begin ##
import java.sql.SQLXML;
+//## JDBC4.0-end ##
+
+/*## JDBC3.0-JDK1.5-begin ##
+import com.metamatrix.core.jdbc.SQLXML;
+## JDBC3.0-JDK1.5-end ##*/
import java.sql.Types;
import java.util.HashMap;
import java.util.Map;
@@ -126,7 +132,15 @@
CLASSNAME_TO_TYPE_MAP.put(OBJECT_CLASS.toLowerCase(), Integer.valueOf(Types.JAVA_OBJECT));
CLASSNAME_TO_TYPE_MAP.put(CLOB_CLASS.toLowerCase(), Integer.valueOf(Types.CLOB));
CLASSNAME_TO_TYPE_MAP.put(BLOB_CLASS.toLowerCase(), Integer.valueOf(Types.BLOB));
+
+ //## JDBC4.0-begin ##
CLASSNAME_TO_TYPE_MAP.put(XML_CLASS.toLowerCase(), Integer.valueOf(Types.SQLXML));
+ //## JDBC4.0-end ##
+
+ /*## JDBC3.0-JDK1.5-begin ##
+ CLASSNAME_TO_TYPE_MAP.put(XML_CLASS.toLowerCase(), Integer.valueOf(Types.JAVA_OBJECT));
+ ## JDBC3.0-JDK1.5-end ##*/
+
}
/**
15 years, 8 months
teiid SVN: r810 - in trunk: client-jdbc30 and 7 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-20 20:10:07 -0400 (Mon, 20 Apr 2009)
New Revision: 810
Added:
trunk/client-jdbc30/
trunk/client-jdbc30/pom.xml
trunk/client-jdbc30/src/
trunk/client-jdbc30/src/main/
trunk/client-jdbc30/src/main/java/
trunk/client-jdbc30/src/main/java/com/
trunk/client-jdbc30/src/main/java/com/metamatrix/
trunk/client-jdbc30/src/main/java/com/metamatrix/core/
trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/
trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java
Removed:
trunk/client-jdbc30/pom.xml
trunk/client-jdbc30/src/
trunk/client-jdbc30/src/main/
trunk/client-jdbc30/src/main/java/
trunk/client-jdbc30/src/main/java/com/
trunk/client-jdbc30/src/main/java/com/metamatrix/
trunk/client-jdbc30/src/main/java/com/metamatrix/core/
trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/
trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java
Log:
TEIID-177: maven project that can create a client jar file which woks with JDK1.5 and supports JDBC 3.0
Copied: trunk/client-jdbc30 (from rev 806, branches/jdbc30-jdk15/client-jdbc30)
Property changes on: trunk/client-jdbc30
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
Deleted: trunk/client-jdbc30/pom.xml
===================================================================
--- branches/jdbc30-jdk15/client-jdbc30/pom.xml 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/client-jdbc30/pom.xml 2009-04-21 00:10:07 UTC (rev 810)
@@ -1,191 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>6.0.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client-jdbc30</artifactId>
- <name>JDBC 3.0 Client</name>
- <version>6.0.0-SNAPSHOT</version>
- <description>JDBC 3.0 Compatible Client for JDK1.5</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/*TestCase.java</include>
- <include>**/*Test.java</include>
- <include>**/Test*.java</include>
- </includes>
- <excludes>
- <exclude>**/Abstract*TestCase.java</exclude>
- <!-- hack to prevent anonymous inner classes in Tests from being run as tests -->
- <include>**/Test*$*.java</include>
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>1.7.0</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>generate-1.5</id>
- <phase>generate-sources</phase>
- <configuration>
- <tasks>
- <copy todir="${project.build.directory}/generated-sources/main/java" overwrite="true">
- <fileset dir="${basedir}/../client-jdbc/src/main/java">
- <include name="**/*.java"/>
- </fileset>
- <fileset dir="${basedir}/../common-core/src/main/java">
- <include name="**/*.java"/>
- </fileset>
- <fileset dir="${basedir}/../client/src/main/java">
- <include name="**/*.java"/>
- </fileset>
-
- <filterset begintoken="/*## " endtoken=" ##">
- <filter token="JDBC3.0-JDK1.5-begin" value=""/>
- <filter token="JDBC3.0-JDK1.5-end" value=""/>
- </filterset>
-
- <filterset begintoken="## " endtoken=" ##*/">
- <filter token="JDBC3.0-JDK1.5-begin" value=""/>
- <filter token="JDBC3.0-JDK1.5-end" value=""/>
- </filterset>
-
- <filterset begintoken="//## " endtoken=" ##">
- <filter token="JDBC4.0-begin" value="/*"/>
- <filter token="JDBC4.0-end" value="*/"/>
- </filterset>
- </copy>
- <copy todir="${project.build.directory}/generated-sources/main/resources" overwrite="true">
- <fileset dir="${basedir}/../client-jdbc/src/main/resources">
- <include name="**/*"/>
- </fileset>
- <fileset dir="${basedir}/../common-core/src/main/resources">
- <include name="**/*"/>
- </fileset>
- <fileset dir="${basedir}/../client/src/main/resources">
- <include name="**/*"/>
- </fileset>
- </copy>
- </tasks>
- <sourceRoot>${project.build.directory}/generated-sources/main/java</sourceRoot>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <!--
- <execution>
- <id>generate-1.5-test</id>
- <phase>generate-sources</phase>
- <configuration>
- <tasks>
- <copy todir="${project.build.directory}/generated-sources/test/java" overwrite="true">
- <fileset dir="${basedir}/../client-jdbc/src/test/java">
- <include name="**/*.java"/>
- </fileset>
- <fileset dir="${basedir}/../common-core/src/test/java">
- <include name="**/*.java"/>
- </fileset>
- <fileset dir="${basedir}/../client/src/test/java">
- <include name="**/*.java"/>
- </fileset>
-
- <filterset begintoken="/*## " endtoken=" ##">
- <filter token="JDBC3.0-JDK1.5-begin" value=""/>
- <filter token="JDBC3.0-JDK1.5-end" value=""/>
- </filterset>
-
- <filterset begintoken="## " endtoken=" ##*/">
- <filter token="JDBC3.0-JDK1.5-begin" value=""/>
- <filter token="JDBC3.0-JDK1.5-end" value=""/>
- </filterset>
-
- <filterset begintoken="//## " endtoken=" ##">
- <filter token="JDBC4.0-begin" value="/*"/>
- <filter token="JDBC4.0-end" value="*/"/>
- </filterset>
- </copy>
- <copy todir="${project.build.directory}/generated-sources/test/resources" overwrite="true">
- <fileset dir="${basedir}/../client-jdbc/src/test/resources">
- <include name="**/*"/>
- </fileset>
- <fileset dir="${basedir}/../common-core/src/test/resources">
- <include name="**/*"/>
- </fileset>
- <fileset dir="${basedir}/../client/src/test/resources">
- <include name="**/*"/>
- </fileset>
- </copy>
- </tasks>
- <testSourceRoot>${project.build.directory}/generated-sources/test/java</testSourceRoot>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- -->
- </executions>
- </plugin>
- </plugins>
-
- <resources>
- <resource>
- <directory>${project.build.directory}/generated-sources/main/resources</directory>
- <filtering>false</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <!--
- <resource>
- <directory>${project.build.directory}/generated-sources/test/resources</directory>
- <filtering>false</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- -->
- </resources>
-
- </build>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.3</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: trunk/client-jdbc30/pom.xml (from rev 806, branches/jdbc30-jdk15/client-jdbc30/pom.xml)
===================================================================
--- trunk/client-jdbc30/pom.xml (rev 0)
+++ trunk/client-jdbc30/pom.xml 2009-04-21 00:10:07 UTC (rev 810)
@@ -0,0 +1,191 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>6.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client-jdbc30</artifactId>
+ <name>JDBC 3.0 Client</name>
+ <version>6.0.0-SNAPSHOT</version>
+ <description>JDBC 3.0 Compatible Client for JDK1.5</description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>false</showDeprecation>
+ <showWarnings>false</showWarnings>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ <include>**/*Test.java</include>
+ <include>**/Test*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Abstract*TestCase.java</exclude>
+ <!-- hack to prevent anonymous inner classes in Tests from being run as tests -->
+ <include>**/Test*$*.java</include>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>generate-1.5</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <tasks>
+ <copy todir="${project.build.directory}/generated-sources/main/java" overwrite="true">
+ <fileset dir="${basedir}/../client-jdbc/src/main/java">
+ <include name="**/*.java"/>
+ </fileset>
+ <fileset dir="${basedir}/../common-core/src/main/java">
+ <include name="**/*.java"/>
+ </fileset>
+ <fileset dir="${basedir}/../client/src/main/java">
+ <include name="**/*.java"/>
+ </fileset>
+
+ <filterset begintoken="/*## " endtoken=" ##">
+ <filter token="JDBC3.0-JDK1.5-begin" value=""/>
+ <filter token="JDBC3.0-JDK1.5-end" value=""/>
+ </filterset>
+
+ <filterset begintoken="## " endtoken=" ##*/">
+ <filter token="JDBC3.0-JDK1.5-begin" value=""/>
+ <filter token="JDBC3.0-JDK1.5-end" value=""/>
+ </filterset>
+
+ <filterset begintoken="//## " endtoken=" ##">
+ <filter token="JDBC4.0-begin" value="/*"/>
+ <filter token="JDBC4.0-end" value="*/"/>
+ </filterset>
+ </copy>
+ <copy todir="${project.build.directory}/generated-sources/main/resources" overwrite="true">
+ <fileset dir="${basedir}/../client-jdbc/src/main/resources">
+ <include name="**/*"/>
+ </fileset>
+ <fileset dir="${basedir}/../common-core/src/main/resources">
+ <include name="**/*"/>
+ </fileset>
+ <fileset dir="${basedir}/../client/src/main/resources">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+ </tasks>
+ <sourceRoot>${project.build.directory}/generated-sources/main/java</sourceRoot>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <!--
+ <execution>
+ <id>generate-1.5-test</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <tasks>
+ <copy todir="${project.build.directory}/generated-sources/test/java" overwrite="true">
+ <fileset dir="${basedir}/../client-jdbc/src/test/java">
+ <include name="**/*.java"/>
+ </fileset>
+ <fileset dir="${basedir}/../common-core/src/test/java">
+ <include name="**/*.java"/>
+ </fileset>
+ <fileset dir="${basedir}/../client/src/test/java">
+ <include name="**/*.java"/>
+ </fileset>
+
+ <filterset begintoken="/*## " endtoken=" ##">
+ <filter token="JDBC3.0-JDK1.5-begin" value=""/>
+ <filter token="JDBC3.0-JDK1.5-end" value=""/>
+ </filterset>
+
+ <filterset begintoken="## " endtoken=" ##*/">
+ <filter token="JDBC3.0-JDK1.5-begin" value=""/>
+ <filter token="JDBC3.0-JDK1.5-end" value=""/>
+ </filterset>
+
+ <filterset begintoken="//## " endtoken=" ##">
+ <filter token="JDBC4.0-begin" value="/*"/>
+ <filter token="JDBC4.0-end" value="*/"/>
+ </filterset>
+ </copy>
+ <copy todir="${project.build.directory}/generated-sources/test/resources" overwrite="true">
+ <fileset dir="${basedir}/../client-jdbc/src/test/resources">
+ <include name="**/*"/>
+ </fileset>
+ <fileset dir="${basedir}/../common-core/src/test/resources">
+ <include name="**/*"/>
+ </fileset>
+ <fileset dir="${basedir}/../client/src/test/resources">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+ </tasks>
+ <testSourceRoot>${project.build.directory}/generated-sources/test/java</testSourceRoot>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ -->
+ </executions>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>${project.build.directory}/generated-sources/main/resources</directory>
+ <filtering>false</filtering>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ <!--
+ <resource>
+ <directory>${project.build.directory}/generated-sources/test/resources</directory>
+ <filtering>false</filtering>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ -->
+ </resources>
+
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Copied: trunk/client-jdbc30/src (from rev 806, branches/jdbc30-jdk15/client-jdbc30/src)
Copied: trunk/client-jdbc30/src/main (from rev 806, branches/jdbc30-jdk15/client-jdbc30/src/main)
Copied: trunk/client-jdbc30/src/main/java (from rev 806, branches/jdbc30-jdk15/client-jdbc30/src/main/java)
Copied: trunk/client-jdbc30/src/main/java/com (from rev 806, branches/jdbc30-jdk15/client-jdbc30/src/main/java/com)
Copied: trunk/client-jdbc30/src/main/java/com/metamatrix (from rev 806, branches/jdbc30-jdk15/client-jdbc30/src/main/java/com/metamatrix)
Copied: trunk/client-jdbc30/src/main/java/com/metamatrix/core (from rev 806, branches/jdbc30-jdk15/client-jdbc30/src/main/java/com/metamatrix/core)
Copied: trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc (from rev 806, branches/jdbc30-jdk15/client-jdbc30/src/main/java/com/metamatrix/core/jdbc)
Deleted: trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java
===================================================================
--- branches/jdbc30-jdk15/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java 2009-04-21 00:10:07 UTC (rev 810)
@@ -1,407 +0,0 @@
-/*
- * %W% %E%
- *
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
-package com.metamatrix.core.jdbc;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-import java.sql.SQLException;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-
-/**
- * The mapping in the JavaTM programming language for the SQL XML type.
- * XML is a built-in type that stores an XML value
- * as a column value in a row of a database table.
- * By default drivers implement an SQLXML object as
- * a logical pointer to the XML data
- * rather than the data itself.
- * An SQLXML object is valid for the duration of the transaction in which it was created.
- * <p>
- * The SQLXML interface provides methods for accessing the XML value
- * as a String, a Reader or Writer, or as a Stream. The XML value
- * may also be accessed through a Source or set as a Result, which
- * are used with XML Parser APIs such as DOM, SAX, and StAX, as
- * well as with XSLT transforms and XPath evaluations.
- * <p>
- * Methods in the interfaces ResultSet, CallableStatement, and PreparedStatement,
- * such as getSQLXML allow a programmer to access an XML value.
- * In addition, this interface has methods for updating an XML value.
- * <p>
- * The XML value of the SQLXML instance may be obtained as a BinaryStream using
- * <pre>
- * SQLXML sqlxml = resultSet.getSQLXML(column);
- * InputStream binaryStream = sqlxml.getBinaryStream();
- * </pre>
- * For example, to parse an XML value with a DOM parser:
- * <pre>
- * DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- * Document result = parser.parse(binaryStream);
- * </pre>
- * or to parse an XML value with a SAX parser to your handler:
- * <pre>
- * SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
- * parser.parse(binaryStream, myHandler);
- * </pre>
- * or to parse an XML value with a StAX parser:
- * <pre>
- * XMLInputFactory factory = XMLInputFactory.newInstance();
- * XMLStreamReader streamReader = factory.createXMLStreamReader(binaryStream);
- * </pre>
- * <p>
- * Because databases may use an optimized representation for the XML,
- * accessing the value through getSource() and
- * setResult() can lead to improved processing performance
- * without serializing to a stream representation and parsing the XML.
- * <p>
- * For example, to obtain a DOM Document Node:
- * <pre>
- * DOMSource domSource = sqlxml.getSource(DOMSource.class);
- * Document document = (Document) domSource.getNode();
- * </pre>
- * or to set the value to a DOM Document Node to myNode:
- * <pre>
- * DOMResult domResult = sqlxml.setResult(DOMResult.class);
- * domResult.setNode(myNode);
- * </pre>
- * or, to send SAX events to your handler:
- * <pre>
- * SAXSource saxSource = sqlxml.getSource(SAXSource.class);
- * XMLReader xmlReader = saxSource.getXMLReader();
- * xmlReader.setContentHandler(myHandler);
- * xmlReader.parse(saxSource.getInputSource());
- * </pre>
- * or, to set the result value from SAX events:
- * <pre>
- * SAXResult saxResult = sqlxml.setResult(SAXResult.class);
- * ContentHandler contentHandler = saxResult.getXMLReader().getContentHandler();
- * contentHandler.startDocument();
- * // set the XML elements and attributes into the result
- * contentHandler.endDocument();
- * </pre>
- * or, to obtain StAX events:
- * <pre>
- * StAXSource staxSource = sqlxml.getSource(StAXSource.class);
- * XMLStreamReader streamReader = staxSource.getXMLStreamReader();
- * </pre>
- * or, to set the result value from StAX events:
- * <pre>
- * StAXResult staxResult = sqlxml.setResult(StAXResult.class);
- * XMLStreamWriter streamWriter = staxResult.getXMLStreamWriter();
- * </pre>
- * or, to perform XSLT transformations on the XML value using the XSLT in xsltFile
- * output to file resultFile:
- * <pre>
- * File xsltFile = new File("a.xslt");
- * File myFile = new File("result.xml");
- * Transformer xslt = TransformerFactory.newInstance().newTransformer(new StreamSource(xsltFile));
- * Source source = sqlxml.getSource(null);
- * Result result = new StreamResult(myFile);
- * xslt.transform(source, result);
- * </pre>
- * or, to evaluate an XPath expression on the XML value:
- * <pre>
- * XPath xpath = XPathFactory.newInstance().newXPath();
- * DOMSource domSource = sqlxml.getSource(DOMSource.class);
- * Document document = (Document) domSource.getNode();
- * String expression = "/foo/@bar";
- * String barValue = xpath.evaluate(expression, document);
- * </pre>
- * To set the XML value to be the result of an XSLT transform:
- * <pre>
- * File sourceFile = new File("source.xml");
- * Transformer xslt = TransformerFactory.newInstance().newTransformer(new StreamSource(xsltFile));
- * Source streamSource = new StreamSource(sourceFile);
- * Result result = sqlxml.setResult(null);
- * xslt.transform(streamSource, result);
- * </pre>
- * Any Source can be transformed to a Result using the identity transform
- * specified by calling newTransformer():
- * <pre>
- * Transformer identity = TransformerFactory.newInstance().newTransformer();
- * Source source = sqlxml.getSource(null);
- * File myFile = new File("result.xml");
- * Result result = new StreamResult(myFile);
- * identity.transform(source, result);
- * </pre>
- * To write the contents of a Source to standard output:
- * <pre>
- * Transformer identity = TransformerFactory.newInstance().newTransformer();
- * Source source = sqlxml.getSource(null);
- * Result result = new StreamResult(System.out);
- * identity.transform(source, result);
- * </pre>
- * To create a DOMSource from a DOMResult:
- * <pre>
- * DOMSource domSource = new DOMSource(domResult.getNode());
- * </pre>
- * <p>
- * Incomplete or invalid XML values may cause an SQLException when
- * set or the exception may occur when execute() occurs. All streams
- * must be closed before execute() occurs or an SQLException will be thrown.
- * <p>
- * Reading and writing XML values to or from an SQLXML object can happen at most once.
- * The conceptual states of readable and not readable determine if one
- * of the reading APIs will return a value or throw an exception.
- * The conceptual states of writable and not writable determine if one
- * of the writing APIs will set a value or throw an exception.
- * <p>
- * The state moves from readable to not readable once free() or any of the
- * reading APIs are called: getBinaryStream(), getCharacterStream(), getSource(), and getString().
- * Implementations may also change the state to not writable when this occurs.
- * <p>
- * The state moves from writable to not writeable once free() or any of the
- * writing APIs are called: setBinaryStream(), setCharacterStream(), setResult(), and setString().
- * Implementations may also change the state to not readable when this occurs.
- * <p>
- * <p>
- * All methods on the <code>SQLXML</code> interface must be fully implemented if the
- * JDBC driver supports the data type.
- *
- * @see javax.xml.parsers
- * @see javax.xml.stream
- * @see javax.xml.transform
- * @see javax.xml.xpath
- * @since 1.6
- */
-public interface SQLXML
-{
- /**
- * This method closes this object and releases the resources that it held.
- * The SQL XML object becomes invalid and neither readable or writeable
- * when this method is called.
- *
- * After <code>free</code> has been called, any attempt to invoke a
- * method other than <code>free</code> will result in a <code>SQLException</code>
- * being thrown. If <code>free</code> is called multiple times, the subsequent
- * calls to <code>free</code> are treated as a no-op.
- * @throws SQLException if there is an error freeing the XML value.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- void free() throws SQLException;
-
- /**
- * Retrieves the XML value designated by this SQLXML instance as a stream.
- * The bytes of the input stream are interpreted according to appendix F of the XML 1.0 specification.
- * The behavior of this method is the same as ResultSet.getBinaryStream()
- * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
- * <p>
- * The SQL XML object becomes not readable when this method is called and
- * may also become not writable depending on implementation.
- *
- * @return a stream containing the XML data.
- * @throws SQLException if there is an error processing the XML value.
- * An exception is thrown if the state is not readable.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- InputStream getBinaryStream() throws SQLException;
-
- /**
- * Retrieves a stream that can be used to write the XML value that this SQLXML instance represents.
- * The stream begins at position 0.
- * The bytes of the stream are interpreted according to appendix F of the XML 1.0 specification
- * The behavior of this method is the same as ResultSet.updateBinaryStream()
- * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
- * <p>
- * The SQL XML object becomes not writeable when this method is called and
- * may also become not readable depending on implementation.
- *
- * @return a stream to which data can be written.
- * @throws SQLException if there is an error processing the XML value.
- * An exception is thrown if the state is not writable.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- OutputStream setBinaryStream() throws SQLException;
-
- /**
- * Retrieves the XML value designated by this SQLXML instance as a java.io.Reader object.
- * The format of this stream is defined by org.xml.sax.InputSource,
- * where the characters in the stream represent the unicode code points for
- * XML according to section 2 and appendix B of the XML 1.0 specification.
- * Although an encoding declaration other than unicode may be present,
- * the encoding of the stream is unicode.
- * The behavior of this method is the same as ResultSet.getCharacterStream()
- * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
- * <p>
- * The SQL XML object becomes not readable when this method is called and
- * may also become not writable depending on implementation.
- *
- * @return a stream containing the XML data.
- * @throws SQLException if there is an error processing the XML value.
- * The getCause() method of the exception may provide a more detailed exception, for example,
- * if the stream does not contain valid characters.
- * An exception is thrown if the state is not readable.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- Reader getCharacterStream() throws SQLException;
-
- /**
- * Retrieves a stream to be used to write the XML value that this SQLXML instance represents.
- * The format of this stream is defined by org.xml.sax.InputSource,
- * where the characters in the stream represent the unicode code points for
- * XML according to section 2 and appendix B of the XML 1.0 specification.
- * Although an encoding declaration other than unicode may be present,
- * the encoding of the stream is unicode.
- * The behavior of this method is the same as ResultSet.updateCharacterStream()
- * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
- * <p>
- * The SQL XML object becomes not writeable when this method is called and
- * may also become not readable depending on implementation.
- *
- * @return a stream to which data can be written.
- * @throws SQLException if there is an error processing the XML value.
- * The getCause() method of the exception may provide a more detailed exception, for example,
- * if the stream does not contain valid characters.
- * An exception is thrown if the state is not writable.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- Writer setCharacterStream() throws SQLException;
-
- /**
- * Returns a string representation of the XML value designated by this SQLXML instance.
- * The format of this String is defined by org.xml.sax.InputSource,
- * where the characters in the stream represent the unicode code points for
- * XML according to section 2 and appendix B of the XML 1.0 specification.
- * Although an encoding declaration other than unicode may be present,
- * the encoding of the String is unicode.
- * The behavior of this method is the same as ResultSet.getString()
- * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
- * <p>
- * The SQL XML object becomes not readable when this method is called and
- * may also become not writable depending on implementation.
- *
- * @return a string representation of the XML value designated by this SQLXML instance.
- * @throws SQLException if there is an error processing the XML value.
- * The getCause() method of the exception may provide a more detailed exception, for example,
- * if the stream does not contain valid characters.
- * An exception is thrown if the state is not readable.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- String getString() throws SQLException;
-
- /**
- * Sets the XML value designated by this SQLXML instance to the given String representation.
- * The format of this String is defined by org.xml.sax.InputSource,
- * where the characters in the stream represent the unicode code points for
- * XML according to section 2 and appendix B of the XML 1.0 specification.
- * Although an encoding declaration other than unicode may be present,
- * the encoding of the String is unicode.
- * The behavior of this method is the same as ResultSet.updateString()
- * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
- * <p>
- * The SQL XML object becomes not writeable when this method is called and
- * may also become not readable depending on implementation.
- *
- * @param value the XML value
- * @throws SQLException if there is an error processing the XML value.
- * The getCause() method of the exception may provide a more detailed exception, for example,
- * if the stream does not contain valid characters.
- * An exception is thrown if the state is not writable.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- void setString(String value) throws SQLException;
-
- /**
- * Returns a Source for reading the XML value designated by this SQLXML instance.
- * Sources are used as inputs to XML parsers and XSLT transformers.
- * <p>
- * Sources for XML parsers will have namespace processing on by default.
- * The systemID of the Source is implementation dependent.
- * <p>
- * The SQL XML object becomes not readable when this method is called and
- * may also become not writable depending on implementation.
- * <p>
- * Note that SAX is a callback architecture, so a returned
- * SAXSource should then be set with a content handler that will
- * receive the SAX events from parsing. The content handler
- * will receive callbacks based on the contents of the XML.
- * <pre>
- * SAXSource saxSource = sqlxml.getSource(SAXSource.class);
- * XMLReader xmlReader = saxSource.getXMLReader();
- * xmlReader.setContentHandler(myHandler);
- * xmlReader.parse(saxSource.getInputSource());
- * </pre>
- *
- * @param sourceClass The class of the source, or null.
- * If the class is null, a vendor specifc Source implementation will be returned.
- * The following classes are supported at a minimum:
- * <pre>
- * javax.xml.transform.dom.DOMSource - returns a DOMSource
- * javax.xml.transform.sax.SAXSource - returns a SAXSource
- * javax.xml.transform.stax.StAXSource - returns a StAXSource
- * javax.xml.transform.stream.StreamSource - returns a StreamSource
- * </pre>
- * @return a Source for reading the XML value.
- * @throws SQLException if there is an error processing the XML value
- * or if this feature is not supported.
- * The getCause() method of the exception may provide a more detailed exception, for example,
- * if an XML parser exception occurs.
- * An exception is thrown if the state is not readable.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- <T extends Source> T getSource(Class<T> sourceClass) throws SQLException;
-
- /**
- * Returns a Result for setting the XML value designated by this SQLXML instance.
- * <p>
- * The systemID of the Result is implementation dependent.
- * <p>
- * The SQL XML object becomes not writeable when this method is called and
- * may also become not readable depending on implementation.
- * <p>
- * Note that SAX is a callback architecture and the returned
- * SAXResult has a content handler assigned that will receive the
- * SAX events based on the contents of the XML. Call the content
- * handler with the contents of the XML document to assign the values.
- * <pre>
- * SAXResult saxResult = sqlxml.setResult(SAXResult.class);
- * ContentHandler contentHandler = saxResult.getXMLReader().getContentHandler();
- * contentHandler.startDocument();
- * // set the XML elements and attributes into the result
- * contentHandler.endDocument();
- * </pre>
- *
- * @param resultClass The class of the result, or null.
- * If resultClass is null, a vendor specific Result implementation will be returned.
- * The following classes are supported at a minimum:
- * <pre>
- * javax.xml.transform.dom.DOMResult - returns a DOMResult
- * javax.xml.transform.sax.SAXResult - returns a SAXResult
- * javax.xml.transform.stax.StAXResult - returns a StAXResult
- * javax.xml.transform.stream.StreamResult - returns a StreamResult
- * </pre>
- * @return Returns a Result for setting the XML value.
- * @throws SQLException if there is an error processing the XML value
- * or if this feature is not supported.
- * The getCause() method of the exception may provide a more detailed exception, for example,
- * if an XML parser exception occurs.
- * An exception is thrown if the state is not writable.
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
- * @since 1.6
- */
- <T extends Result> T setResult(Class<T> resultClass) throws SQLException;
-
-}
Copied: trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java (from rev 806, branches/jdbc30-jdk15/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java)
===================================================================
--- trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java (rev 0)
+++ trunk/client-jdbc30/src/main/java/com/metamatrix/core/jdbc/SQLXML.java 2009-04-21 00:10:07 UTC (rev 810)
@@ -0,0 +1,407 @@
+/*
+ * %W% %E%
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package com.metamatrix.core.jdbc;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.sql.SQLException;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+/**
+ * The mapping in the JavaTM programming language for the SQL XML type.
+ * XML is a built-in type that stores an XML value
+ * as a column value in a row of a database table.
+ * By default drivers implement an SQLXML object as
+ * a logical pointer to the XML data
+ * rather than the data itself.
+ * An SQLXML object is valid for the duration of the transaction in which it was created.
+ * <p>
+ * The SQLXML interface provides methods for accessing the XML value
+ * as a String, a Reader or Writer, or as a Stream. The XML value
+ * may also be accessed through a Source or set as a Result, which
+ * are used with XML Parser APIs such as DOM, SAX, and StAX, as
+ * well as with XSLT transforms and XPath evaluations.
+ * <p>
+ * Methods in the interfaces ResultSet, CallableStatement, and PreparedStatement,
+ * such as getSQLXML allow a programmer to access an XML value.
+ * In addition, this interface has methods for updating an XML value.
+ * <p>
+ * The XML value of the SQLXML instance may be obtained as a BinaryStream using
+ * <pre>
+ * SQLXML sqlxml = resultSet.getSQLXML(column);
+ * InputStream binaryStream = sqlxml.getBinaryStream();
+ * </pre>
+ * For example, to parse an XML value with a DOM parser:
+ * <pre>
+ * DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ * Document result = parser.parse(binaryStream);
+ * </pre>
+ * or to parse an XML value with a SAX parser to your handler:
+ * <pre>
+ * SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+ * parser.parse(binaryStream, myHandler);
+ * </pre>
+ * or to parse an XML value with a StAX parser:
+ * <pre>
+ * XMLInputFactory factory = XMLInputFactory.newInstance();
+ * XMLStreamReader streamReader = factory.createXMLStreamReader(binaryStream);
+ * </pre>
+ * <p>
+ * Because databases may use an optimized representation for the XML,
+ * accessing the value through getSource() and
+ * setResult() can lead to improved processing performance
+ * without serializing to a stream representation and parsing the XML.
+ * <p>
+ * For example, to obtain a DOM Document Node:
+ * <pre>
+ * DOMSource domSource = sqlxml.getSource(DOMSource.class);
+ * Document document = (Document) domSource.getNode();
+ * </pre>
+ * or to set the value to a DOM Document Node to myNode:
+ * <pre>
+ * DOMResult domResult = sqlxml.setResult(DOMResult.class);
+ * domResult.setNode(myNode);
+ * </pre>
+ * or, to send SAX events to your handler:
+ * <pre>
+ * SAXSource saxSource = sqlxml.getSource(SAXSource.class);
+ * XMLReader xmlReader = saxSource.getXMLReader();
+ * xmlReader.setContentHandler(myHandler);
+ * xmlReader.parse(saxSource.getInputSource());
+ * </pre>
+ * or, to set the result value from SAX events:
+ * <pre>
+ * SAXResult saxResult = sqlxml.setResult(SAXResult.class);
+ * ContentHandler contentHandler = saxResult.getXMLReader().getContentHandler();
+ * contentHandler.startDocument();
+ * // set the XML elements and attributes into the result
+ * contentHandler.endDocument();
+ * </pre>
+ * or, to obtain StAX events:
+ * <pre>
+ * StAXSource staxSource = sqlxml.getSource(StAXSource.class);
+ * XMLStreamReader streamReader = staxSource.getXMLStreamReader();
+ * </pre>
+ * or, to set the result value from StAX events:
+ * <pre>
+ * StAXResult staxResult = sqlxml.setResult(StAXResult.class);
+ * XMLStreamWriter streamWriter = staxResult.getXMLStreamWriter();
+ * </pre>
+ * or, to perform XSLT transformations on the XML value using the XSLT in xsltFile
+ * output to file resultFile:
+ * <pre>
+ * File xsltFile = new File("a.xslt");
+ * File myFile = new File("result.xml");
+ * Transformer xslt = TransformerFactory.newInstance().newTransformer(new StreamSource(xsltFile));
+ * Source source = sqlxml.getSource(null);
+ * Result result = new StreamResult(myFile);
+ * xslt.transform(source, result);
+ * </pre>
+ * or, to evaluate an XPath expression on the XML value:
+ * <pre>
+ * XPath xpath = XPathFactory.newInstance().newXPath();
+ * DOMSource domSource = sqlxml.getSource(DOMSource.class);
+ * Document document = (Document) domSource.getNode();
+ * String expression = "/foo/@bar";
+ * String barValue = xpath.evaluate(expression, document);
+ * </pre>
+ * To set the XML value to be the result of an XSLT transform:
+ * <pre>
+ * File sourceFile = new File("source.xml");
+ * Transformer xslt = TransformerFactory.newInstance().newTransformer(new StreamSource(xsltFile));
+ * Source streamSource = new StreamSource(sourceFile);
+ * Result result = sqlxml.setResult(null);
+ * xslt.transform(streamSource, result);
+ * </pre>
+ * Any Source can be transformed to a Result using the identity transform
+ * specified by calling newTransformer():
+ * <pre>
+ * Transformer identity = TransformerFactory.newInstance().newTransformer();
+ * Source source = sqlxml.getSource(null);
+ * File myFile = new File("result.xml");
+ * Result result = new StreamResult(myFile);
+ * identity.transform(source, result);
+ * </pre>
+ * To write the contents of a Source to standard output:
+ * <pre>
+ * Transformer identity = TransformerFactory.newInstance().newTransformer();
+ * Source source = sqlxml.getSource(null);
+ * Result result = new StreamResult(System.out);
+ * identity.transform(source, result);
+ * </pre>
+ * To create a DOMSource from a DOMResult:
+ * <pre>
+ * DOMSource domSource = new DOMSource(domResult.getNode());
+ * </pre>
+ * <p>
+ * Incomplete or invalid XML values may cause an SQLException when
+ * set or the exception may occur when execute() occurs. All streams
+ * must be closed before execute() occurs or an SQLException will be thrown.
+ * <p>
+ * Reading and writing XML values to or from an SQLXML object can happen at most once.
+ * The conceptual states of readable and not readable determine if one
+ * of the reading APIs will return a value or throw an exception.
+ * The conceptual states of writable and not writable determine if one
+ * of the writing APIs will set a value or throw an exception.
+ * <p>
+ * The state moves from readable to not readable once free() or any of the
+ * reading APIs are called: getBinaryStream(), getCharacterStream(), getSource(), and getString().
+ * Implementations may also change the state to not writable when this occurs.
+ * <p>
+ * The state moves from writable to not writeable once free() or any of the
+ * writing APIs are called: setBinaryStream(), setCharacterStream(), setResult(), and setString().
+ * Implementations may also change the state to not readable when this occurs.
+ * <p>
+ * <p>
+ * All methods on the <code>SQLXML</code> interface must be fully implemented if the
+ * JDBC driver supports the data type.
+ *
+ * @see javax.xml.parsers
+ * @see javax.xml.stream
+ * @see javax.xml.transform
+ * @see javax.xml.xpath
+ * @since 1.6
+ */
+public interface SQLXML
+{
+ /**
+ * This method closes this object and releases the resources that it held.
+ * The SQL XML object becomes invalid and neither readable or writeable
+ * when this method is called.
+ *
+ * After <code>free</code> has been called, any attempt to invoke a
+ * method other than <code>free</code> will result in a <code>SQLException</code>
+ * being thrown. If <code>free</code> is called multiple times, the subsequent
+ * calls to <code>free</code> are treated as a no-op.
+ * @throws SQLException if there is an error freeing the XML value.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ void free() throws SQLException;
+
+ /**
+ * Retrieves the XML value designated by this SQLXML instance as a stream.
+ * The bytes of the input stream are interpreted according to appendix F of the XML 1.0 specification.
+ * The behavior of this method is the same as ResultSet.getBinaryStream()
+ * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
+ * <p>
+ * The SQL XML object becomes not readable when this method is called and
+ * may also become not writable depending on implementation.
+ *
+ * @return a stream containing the XML data.
+ * @throws SQLException if there is an error processing the XML value.
+ * An exception is thrown if the state is not readable.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ InputStream getBinaryStream() throws SQLException;
+
+ /**
+ * Retrieves a stream that can be used to write the XML value that this SQLXML instance represents.
+ * The stream begins at position 0.
+ * The bytes of the stream are interpreted according to appendix F of the XML 1.0 specification
+ * The behavior of this method is the same as ResultSet.updateBinaryStream()
+ * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
+ * <p>
+ * The SQL XML object becomes not writeable when this method is called and
+ * may also become not readable depending on implementation.
+ *
+ * @return a stream to which data can be written.
+ * @throws SQLException if there is an error processing the XML value.
+ * An exception is thrown if the state is not writable.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ OutputStream setBinaryStream() throws SQLException;
+
+ /**
+ * Retrieves the XML value designated by this SQLXML instance as a java.io.Reader object.
+ * The format of this stream is defined by org.xml.sax.InputSource,
+ * where the characters in the stream represent the unicode code points for
+ * XML according to section 2 and appendix B of the XML 1.0 specification.
+ * Although an encoding declaration other than unicode may be present,
+ * the encoding of the stream is unicode.
+ * The behavior of this method is the same as ResultSet.getCharacterStream()
+ * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
+ * <p>
+ * The SQL XML object becomes not readable when this method is called and
+ * may also become not writable depending on implementation.
+ *
+ * @return a stream containing the XML data.
+ * @throws SQLException if there is an error processing the XML value.
+ * The getCause() method of the exception may provide a more detailed exception, for example,
+ * if the stream does not contain valid characters.
+ * An exception is thrown if the state is not readable.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ Reader getCharacterStream() throws SQLException;
+
+ /**
+ * Retrieves a stream to be used to write the XML value that this SQLXML instance represents.
+ * The format of this stream is defined by org.xml.sax.InputSource,
+ * where the characters in the stream represent the unicode code points for
+ * XML according to section 2 and appendix B of the XML 1.0 specification.
+ * Although an encoding declaration other than unicode may be present,
+ * the encoding of the stream is unicode.
+ * The behavior of this method is the same as ResultSet.updateCharacterStream()
+ * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
+ * <p>
+ * The SQL XML object becomes not writeable when this method is called and
+ * may also become not readable depending on implementation.
+ *
+ * @return a stream to which data can be written.
+ * @throws SQLException if there is an error processing the XML value.
+ * The getCause() method of the exception may provide a more detailed exception, for example,
+ * if the stream does not contain valid characters.
+ * An exception is thrown if the state is not writable.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ Writer setCharacterStream() throws SQLException;
+
+ /**
+ * Returns a string representation of the XML value designated by this SQLXML instance.
+ * The format of this String is defined by org.xml.sax.InputSource,
+ * where the characters in the stream represent the unicode code points for
+ * XML according to section 2 and appendix B of the XML 1.0 specification.
+ * Although an encoding declaration other than unicode may be present,
+ * the encoding of the String is unicode.
+ * The behavior of this method is the same as ResultSet.getString()
+ * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
+ * <p>
+ * The SQL XML object becomes not readable when this method is called and
+ * may also become not writable depending on implementation.
+ *
+ * @return a string representation of the XML value designated by this SQLXML instance.
+ * @throws SQLException if there is an error processing the XML value.
+ * The getCause() method of the exception may provide a more detailed exception, for example,
+ * if the stream does not contain valid characters.
+ * An exception is thrown if the state is not readable.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ String getString() throws SQLException;
+
+ /**
+ * Sets the XML value designated by this SQLXML instance to the given String representation.
+ * The format of this String is defined by org.xml.sax.InputSource,
+ * where the characters in the stream represent the unicode code points for
+ * XML according to section 2 and appendix B of the XML 1.0 specification.
+ * Although an encoding declaration other than unicode may be present,
+ * the encoding of the String is unicode.
+ * The behavior of this method is the same as ResultSet.updateString()
+ * when the designated column of the ResultSet has a type java.sql.Types of SQLXML.
+ * <p>
+ * The SQL XML object becomes not writeable when this method is called and
+ * may also become not readable depending on implementation.
+ *
+ * @param value the XML value
+ * @throws SQLException if there is an error processing the XML value.
+ * The getCause() method of the exception may provide a more detailed exception, for example,
+ * if the stream does not contain valid characters.
+ * An exception is thrown if the state is not writable.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ void setString(String value) throws SQLException;
+
+ /**
+ * Returns a Source for reading the XML value designated by this SQLXML instance.
+ * Sources are used as inputs to XML parsers and XSLT transformers.
+ * <p>
+ * Sources for XML parsers will have namespace processing on by default.
+ * The systemID of the Source is implementation dependent.
+ * <p>
+ * The SQL XML object becomes not readable when this method is called and
+ * may also become not writable depending on implementation.
+ * <p>
+ * Note that SAX is a callback architecture, so a returned
+ * SAXSource should then be set with a content handler that will
+ * receive the SAX events from parsing. The content handler
+ * will receive callbacks based on the contents of the XML.
+ * <pre>
+ * SAXSource saxSource = sqlxml.getSource(SAXSource.class);
+ * XMLReader xmlReader = saxSource.getXMLReader();
+ * xmlReader.setContentHandler(myHandler);
+ * xmlReader.parse(saxSource.getInputSource());
+ * </pre>
+ *
+ * @param sourceClass The class of the source, or null.
+ * If the class is null, a vendor specifc Source implementation will be returned.
+ * The following classes are supported at a minimum:
+ * <pre>
+ * javax.xml.transform.dom.DOMSource - returns a DOMSource
+ * javax.xml.transform.sax.SAXSource - returns a SAXSource
+ * javax.xml.transform.stax.StAXSource - returns a StAXSource
+ * javax.xml.transform.stream.StreamSource - returns a StreamSource
+ * </pre>
+ * @return a Source for reading the XML value.
+ * @throws SQLException if there is an error processing the XML value
+ * or if this feature is not supported.
+ * The getCause() method of the exception may provide a more detailed exception, for example,
+ * if an XML parser exception occurs.
+ * An exception is thrown if the state is not readable.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ <T extends Source> T getSource(Class<T> sourceClass) throws SQLException;
+
+ /**
+ * Returns a Result for setting the XML value designated by this SQLXML instance.
+ * <p>
+ * The systemID of the Result is implementation dependent.
+ * <p>
+ * The SQL XML object becomes not writeable when this method is called and
+ * may also become not readable depending on implementation.
+ * <p>
+ * Note that SAX is a callback architecture and the returned
+ * SAXResult has a content handler assigned that will receive the
+ * SAX events based on the contents of the XML. Call the content
+ * handler with the contents of the XML document to assign the values.
+ * <pre>
+ * SAXResult saxResult = sqlxml.setResult(SAXResult.class);
+ * ContentHandler contentHandler = saxResult.getXMLReader().getContentHandler();
+ * contentHandler.startDocument();
+ * // set the XML elements and attributes into the result
+ * contentHandler.endDocument();
+ * </pre>
+ *
+ * @param resultClass The class of the result, or null.
+ * If resultClass is null, a vendor specific Result implementation will be returned.
+ * The following classes are supported at a minimum:
+ * <pre>
+ * javax.xml.transform.dom.DOMResult - returns a DOMResult
+ * javax.xml.transform.sax.SAXResult - returns a SAXResult
+ * javax.xml.transform.stax.StAXResult - returns a StAXResult
+ * javax.xml.transform.stream.StreamResult - returns a StreamResult
+ * </pre>
+ * @return Returns a Result for setting the XML value.
+ * @throws SQLException if there is an error processing the XML value
+ * or if this feature is not supported.
+ * The getCause() method of the exception may provide a more detailed exception, for example,
+ * if an XML parser exception occurs.
+ * An exception is thrown if the state is not writable.
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ <T extends Result> T setResult(Class<T> resultClass) throws SQLException;
+
+}
15 years, 8 months
teiid SVN: r809 - in trunk: client/src/main/java/com/metamatrix/common/comm/platform/client and 16 other directories.
by teiid-commits@lists.jboss.org
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;
15 years, 8 months
teiid SVN: r808 - in trunk/engine/src: main/java/com/metamatrix/query/optimizer/batch and 9 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-20 17:02:03 -0400 (Mon, 20 Apr 2009)
New Revision: 808
Removed:
trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/NeedsEvaluationVisitor.java
Modified:
trunk/engine/src/main/java/com/metamatrix/query/function/FunctionLibrary.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/batch/BatchedUpdatePlanner.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/parser/ParseInfo.java
trunk/engine/src/main/java/com/metamatrix/query/resolver/command/SimpleQueryResolver.java
trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluateExpressionVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/util/CommandContext.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlanCache.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestAccessNode.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestBatchedUpdateNode.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
Log:
TEIID-81, TEIID-512 updating the planning logic to promote non-session specific commands to be globally reusable
Modified: trunk/engine/src/main/java/com/metamatrix/query/function/FunctionLibrary.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/function/FunctionLibrary.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/function/FunctionLibrary.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -36,6 +36,7 @@
import com.metamatrix.query.function.metadata.FunctionParameter;
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.Function;
+import com.metamatrix.query.util.CommandContext;
import com.metamatrix.query.util.ErrorMessageKeys;
@@ -348,6 +349,11 @@
throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0002, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0002, localDescriptor.getName()));
}
}
+
+ if (fd.getDeterministic() >= FunctionMethod.SESSION_DETERMINISTIC && values.length > 0 && values[0] instanceof CommandContext) {
+ CommandContext cc = (CommandContext)values[0];
+ cc.setSessionFunctionEvaluated(true);
+ }
// Invoke the method and return the result
try {
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/batch/BatchedUpdatePlanner.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/batch/BatchedUpdatePlanner.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/batch/BatchedUpdatePlanner.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -53,7 +53,7 @@
import com.metamatrix.query.sql.lang.Update;
import com.metamatrix.query.sql.symbol.GroupSymbol;
import com.metamatrix.query.sql.util.VariableContext;
-import com.metamatrix.query.sql.visitor.NeedsEvaluationVisitor;
+import com.metamatrix.query.sql.visitor.EvaluatableVisitor;
import com.metamatrix.query.util.CommandContext;
@@ -131,7 +131,7 @@
contexts.add(allContexts.get(commandIndex));
shouldEvaluate.add(Boolean.TRUE);
} else {
- shouldEvaluate.add(NeedsEvaluationVisitor.needsEvaluation(updateCommand));
+ shouldEvaluate.add(EvaluatableVisitor.needsProcessingEvaluation(updateCommand));
}
// Find out if there are other commands called on the same physical model
// immediately and contiguously after this one
@@ -144,7 +144,7 @@
contexts.add(allContexts.get(batchIndex));
shouldEvaluate.add(Boolean.TRUE);
} else {
- shouldEvaluate.add(NeedsEvaluationVisitor.needsEvaluation(batchingCandidate));
+ shouldEvaluate.add(EvaluatableVisitor.needsProcessingEvaluation(batchingCandidate));
}
} else { // Otherwise, stop batching at this point. The next command may well be the start of a new batch
break batchLoop;
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -82,8 +82,8 @@
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.GroupSymbol;
import com.metamatrix.query.sql.util.SymbolMap;
+import com.metamatrix.query.sql.visitor.EvaluatableVisitor;
import com.metamatrix.query.sql.visitor.GroupCollectorVisitor;
-import com.metamatrix.query.sql.visitor.NeedsEvaluationVisitor;
import com.metamatrix.query.util.ErrorMessageKeys;
public class PlanToProcessConverter {
@@ -306,7 +306,7 @@
} catch (QueryMetadataException err) {
throw new MetaMatrixComponentException(err);
}
- aNode.setShouldEvaluateExpressions(NeedsEvaluationVisitor.needsEvaluation(command));
+ aNode.setShouldEvaluateExpressions(EvaluatableVisitor.needsProcessingEvaluation(command));
}
try {
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -54,7 +54,7 @@
import com.metamatrix.query.sql.symbol.Function;
import com.metamatrix.query.sql.symbol.SearchedCaseExpression;
import com.metamatrix.query.sql.visitor.ElementCollectorVisitor;
-import com.metamatrix.query.sql.visitor.EvaluateExpressionVisitor;
+import com.metamatrix.query.sql.visitor.EvaluatableVisitor;
/**
*/
@@ -228,7 +228,7 @@
public void visit(Function obj) {
try {
//if the function can be evaluated then return as it will get replaced during the final rewrite
- if (EvaluateExpressionVisitor.willBecomeConstant(obj, true)) {
+ if (EvaluatableVisitor.willBecomeConstant(obj, true)) {
return;
}
if(obj.getFunctionDescriptor().getPushdown() == FunctionMethod.CANNOT_PUSHDOWN || ! CapabilitiesUtil.supportsScalarFunction(modelID, obj, metadata, capFinder)) {
Modified: trunk/engine/src/main/java/com/metamatrix/query/parser/ParseInfo.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/parser/ParseInfo.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/parser/ParseInfo.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -44,4 +44,21 @@
public boolean allowDoubleQuotedVariable() {
return allowDoubleQuotedVariable;
}
+
+ @Override
+ public int hashCode() {
+ return allowDoubleQuotedVariable?1:0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof ParseInfo)) {
+ return false;
+ }
+ ParseInfo other = (ParseInfo)obj;
+ return this.allowDoubleQuotedVariable == other.allowDoubleQuotedVariable;
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/com/metamatrix/query/resolver/command/SimpleQueryResolver.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/resolver/command/SimpleQueryResolver.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/resolver/command/SimpleQueryResolver.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -92,7 +92,7 @@
private static final String ALL_IN_GROUP_SUFFIX = ".*"; //$NON-NLS-1$
private static Command resolveVirtualGroup(GroupSymbol virtualGroup, Command parentCommand, QueryMetadataInterface metadata, AnalysisRecord analysis)
- throws QueryMetadataException, QueryResolverException, MetaMatrixComponentException, QueryParserException {
+ throws QueryMetadataException, QueryResolverException, MetaMatrixComponentException {
QueryNode qnode = null;
Object metadataID = virtualGroup.getMetadataID();
@@ -253,7 +253,7 @@
}
private static Command convertToSubquery(QueryNode qnode, boolean nocache, QueryMetadataInterface metadata)
- throws QueryResolverException, MetaMatrixComponentException, QueryParserException {
+ throws QueryResolverException, MetaMatrixComponentException {
// Parse this node's command
Command command = qnode.getCommand();
@@ -605,8 +605,6 @@
throw new MetaMatrixRuntimeException(e);
} catch(MetaMatrixComponentException e) {
throw new MetaMatrixRuntimeException(e);
- } catch (QueryParserException e) {
- throw new MetaMatrixRuntimeException(e);
}
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -25,6 +25,8 @@
*/
package com.metamatrix.query.sql.visitor;
+import java.util.TreeSet;
+
import com.metamatrix.query.function.FunctionLibrary;
import com.metamatrix.query.function.metadata.FunctionMethod;
import com.metamatrix.query.metadata.TempMetadataID;
@@ -46,118 +48,124 @@
/**
* <p>This visitor class will traverse a language object tree, and determine
* if the current expression can be evaluated</p>
- *
- * <p>The public visit() methods should NOT be called directly.</p>
- *
- * There are three possible scenarios:
- *
- * duringPlanning | fullyEvaluatable
- * ---------------------------------
- * false | false = will become processing time constant
- * false | true = processing time evaluation possible
- * true | true = planning time evaluation possible (should always be deterministic)
- *
*/
public class EvaluatableVisitor extends LanguageVisitor {
+
+ public enum EvaluationLevel {
+ PLANNING,
+ PROCESSING,
+ PUSH_DOWN,
+ }
- protected boolean evaluationPossible = true;
-
- //TODO: there aren't really 16 states here, this should be minimized
- private boolean duringPlanning = false;
- private boolean fullyEvaluatable = false;
- private boolean deterministic = false;
- private boolean pushdown = false;
-
- public EvaluatableVisitor(boolean duringPlanning, boolean fullyEvaluatable) {
- this.duringPlanning = duringPlanning;
- this.fullyEvaluatable = fullyEvaluatable;
- }
-
+ private TreeSet<EvaluationLevel> levels = new TreeSet<EvaluationLevel>();
+ private EvaluationLevel targetLevel;
+ private int determinismLevel;
+ private boolean hasCorrelatedReferences;
+
public void visit(Function obj) {
+ this.setDeterminismLevel(obj.getFunctionDescriptor().getDeterministic());
if (obj.getFunctionDescriptor().getPushdown() == FunctionMethod.MUST_PUSHDOWN) {
- evaluationNotPossible();
- } else if (duringPlanning) {
- if (obj.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP)) {
- evaluationNotPossible();
- } else if (obj.getFunctionDescriptor().getDeterministic() >= FunctionMethod.COMMAND_DETERMINISTIC) {
- evaluationNotPossible();
- }
- } else if (deterministic && obj.getFunctionDescriptor().getDeterministic() == FunctionMethod.NONDETERMINISTIC) {
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
+ } else if (obj.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP)
+ //TODO: if we had the context here we could plan better for non-prepared requests
+ || obj.getFunctionDescriptor().getDeterministic() >= FunctionMethod.COMMAND_DETERMINISTIC) {
+ evaluationNotPossible(EvaluationLevel.PROCESSING);
}
}
- private boolean evaluationNotPossible() {
- evaluationPossible = false;
- setAbort(true);
- return evaluationPossible;
+ private void setDeterminismLevel(int value) {
+ determinismLevel = Math.max(determinismLevel, value);
}
+
+ private void evaluationNotPossible(EvaluationLevel newLevel) {
+ levels.add(newLevel);
+ EvaluationLevel level = levels.last();
+ if (targetLevel != null && level.compareTo(targetLevel) > 0) {
+ setAbort(true);
+ }
+ }
public void visit(ElementSymbol obj) {
//if the element is a variable, or an element that will have a value, it will be evaluatable at runtime
- if (duringPlanning || fullyEvaluatable) {
- evaluationNotPossible();
- } else {
- //begin hack for not having the metadata passed in
- if (obj.getGroupSymbol().getMetadataID() instanceof TempMetadataID) {
- TempMetadataID tid = (TempMetadataID)obj.getGroupSymbol().getMetadataID();
- if (tid.isScalarGroup()) {
- return;
- }
- }
- evaluationNotPossible();
- }
+ //begin hack for not having the metadata passed in
+ if (obj.getGroupSymbol().getMetadataID() instanceof TempMetadataID) {
+ TempMetadataID tid = (TempMetadataID)obj.getGroupSymbol().getMetadataID();
+ if (tid.isScalarGroup()) {
+ evaluationNotPossible(EvaluationLevel.PROCESSING);
+ return;
+ }
+ }
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
public void visit(ExpressionSymbol obj) {
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
public void visit(AggregateSymbol obj) {
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
+ /**
+ * We assume the non-push down for correlation variables,
+ * then make specific checks when correlated variables are allowed.
+ */
public void visit(Reference obj) {
- if (duringPlanning || fullyEvaluatable) {
- evaluationNotPossible();
- } else if (pushdown && obj.isCorrelated()) {
- evaluationNotPossible();
- }
+ hasCorrelatedReferences |= obj.isCorrelated();
+ evaluationNotPossible(EvaluationLevel.PROCESSING);
}
public void visit(StoredProcedure proc){
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
public void visit(ScalarSubquery obj){
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
public void visit(DependentSetCriteria obj) {
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
public void visit(ExistsCriteria obj) {
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
public void visit(SubquerySetCriteria obj) {
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
public void visit(SubqueryCompareCriteria obj) {
- evaluationNotPossible();
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
}
- public boolean isEvaluationPossible() {
- return evaluationPossible;
+ private boolean isEvaluationPossible() {
+ if (levels.isEmpty()) {
+ return true;
+ }
+ return levels.last().compareTo(targetLevel) <= 0;
}
- static final boolean isEvaluatable(LanguageObject obj, boolean duringPlanning, boolean fullyEvaluatable, boolean deterministic, boolean pushdown) {
- EvaluatableVisitor visitor = new EvaluatableVisitor(duringPlanning, fullyEvaluatable);
- visitor.deterministic = deterministic;
- visitor.pushdown = pushdown;
+ public static final boolean isEvaluatable(LanguageObject obj, EvaluationLevel target) {
+ EvaluatableVisitor visitor = new EvaluatableVisitor();
+ visitor.targetLevel = target;
PreOrderNavigator.doVisit(obj, visitor);
return visitor.isEvaluationPossible();
}
+
+ public static final boolean willBecomeConstant(LanguageObject obj, boolean pushdown) {
+ EvaluatableVisitor visitor = new EvaluatableVisitor();
+ visitor.targetLevel = EvaluationLevel.PROCESSING;
+ PreOrderNavigator.doVisit(obj, visitor);
+ if (pushdown && (visitor.hasCorrelatedReferences || visitor.determinismLevel >= FunctionMethod.NONDETERMINISTIC)) {
+ return false;
+ }
+ return visitor.isEvaluationPossible();
+ }
+
+ public static final boolean needsProcessingEvaluation(LanguageObject obj) {
+ EvaluatableVisitor visitor = new EvaluatableVisitor();
+ PreOrderNavigator.doVisit(obj, visitor);
+ return visitor.levels.contains(EvaluationLevel.PROCESSING);
+ }
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluateExpressionVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluateExpressionVisitor.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluateExpressionVisitor.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -37,6 +37,7 @@
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.Reference;
import com.metamatrix.query.sql.symbol.ScalarSubquery;
+import com.metamatrix.query.sql.visitor.EvaluatableVisitor.EvaluationLevel;
import com.metamatrix.query.util.CommandContext;
/**
@@ -74,7 +75,7 @@
*/
public Expression replaceExpression(Expression expr) {
//if the expression is a constant or is not evaluatable, just return
- if (expr instanceof Constant || expr instanceof ScalarSubquery || (!(expr instanceof Reference) && !EvaluatableVisitor.isEvaluatable(expr, false, true, false, false))) {
+ if (expr instanceof Constant || expr instanceof ScalarSubquery || (!(expr instanceof Reference) && !EvaluatableVisitor.isEvaluatable(expr, EvaluationLevel.PROCESSING))) {
return expr;
}
@@ -95,18 +96,14 @@
* evaluatable during planning
*/
public static final boolean willBecomeConstant(LanguageObject obj) {
- return willBecomeConstant(obj, false);
+ return EvaluatableVisitor.willBecomeConstant(obj, false);
}
- public static final boolean willBecomeConstant(LanguageObject obj, boolean pushdown) {
- return EvaluatableVisitor.isEvaluatable(obj, false, false, true, pushdown);
- }
-
/**
* Should be called to check if the object can fully evaluated
*/
public static final boolean isFullyEvaluatable(LanguageObject obj, boolean duringPlanning) {
- return EvaluatableVisitor.isEvaluatable(obj, duringPlanning, true, true, false);
+ return EvaluatableVisitor.isEvaluatable(obj, duringPlanning?EvaluationLevel.PLANNING:EvaluationLevel.PROCESSING);
}
public static final void replaceExpressions(LanguageObject obj, boolean deep, LookupEvaluator dataMgr, CommandContext context)
Deleted: trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/NeedsEvaluationVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/NeedsEvaluationVisitor.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/NeedsEvaluationVisitor.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.query.sql.visitor;
-
-import com.metamatrix.query.sql.LanguageObject;
-import com.metamatrix.query.sql.LanguageVisitor;
-import com.metamatrix.query.sql.lang.DependentSetCriteria;
-import com.metamatrix.query.sql.navigator.DeepPreOrderNavigator;
-import com.metamatrix.query.sql.symbol.Function;
-import com.metamatrix.query.sql.symbol.Reference;
-
-/**
- * Checks the language object for expressions or criteria that need to be evaluated at execution time
- */
-public class NeedsEvaluationVisitor extends LanguageVisitor {
-
- private boolean needsEvaluation = false;
-
- /**
- * @see com.metamatrix.query.sql.LanguageVisitor#visit(com.metamatrix.query.sql.symbol.Reference)
- */
- @Override
- public void visit(Reference obj) {
- setNeedsEvaluation();
- }
-
- /**
- * @see com.metamatrix.query.sql.LanguageVisitor#visit(com.metamatrix.query.sql.lang.DependentSetCriteria)
- */
- @Override
- public void visit(DependentSetCriteria obj) {
- setNeedsEvaluation();
- }
-
- /**
- * @see com.metamatrix.query.sql.LanguageVisitor#visit(com.metamatrix.query.sql.symbol.Function)
- */
- @Override
- public void visit(Function obj) {
- if (EvaluatableVisitor.isEvaluatable(obj, false, true, false, false)) {
- setNeedsEvaluation();
- }
- }
-
- public void setNeedsEvaluation() {
- this.needsEvaluation = true;
- setAbort(true);
- }
-
- public static boolean needsEvaluation(LanguageObject obj) {
- NeedsEvaluationVisitor visitor = new NeedsEvaluationVisitor();
- DeepPreOrderNavigator.doVisit(obj, visitor);
- return visitor.needsEvaluation;
- }
-
-}
Modified: trunk/engine/src/main/java/com/metamatrix/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/util/CommandContext.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/com/metamatrix/query/util/CommandContext.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -98,6 +98,10 @@
private VariableContext variableContext = new VariableContext();
+ private CommandContext parent;
+
+ private boolean sessionFunctionEvaluated;
+
/**
* Construct a new context.
* @param collectNodeStatistics TODO
@@ -149,11 +153,27 @@
this.planToProcessConverter = context.planToProcessConverter;
this.queryProcessorFactory = context.queryProcessorFactory;
this.variableContext = context.variableContext;
+ this.parent = context;
}
public CommandContext() {
}
+ public boolean isSessionFunctionEvaluated() {
+ if (parent != null) {
+ return parent.isSessionFunctionEvaluated();
+ }
+ return sessionFunctionEvaluated;
+ }
+
+ public void setSessionFunctionEvaluated(boolean sessionFunctionEvaluated) {
+ if (parent != null) {
+ parent.setCollectNodeStatistics(sessionFunctionEvaluated);
+ } else {
+ this.sessionFunctionEvaluated = sessionFunctionEvaluated;
+ }
+ }
+
/**
* @return
*/
@@ -301,6 +321,9 @@
}
public double getNextRand() {
+ if (parent != null) {
+ return parent.getNextRand();
+ }
if (random == null) {
random = new Random();
}
@@ -308,6 +331,9 @@
}
public double getNextRand(long seed) {
+ if (parent != null) {
+ return parent.getNextRand(seed);
+ }
if (random == null) {
random = new Random();
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -37,7 +37,6 @@
import javax.transaction.SystemException;
import javax.transaction.xa.Xid;
-import org.teiid.connector.api.CacheScope;
import org.teiid.dqp.internal.cache.CacheID;
import org.teiid.dqp.internal.cache.DQPContextCache;
import org.teiid.dqp.internal.cache.ResultSetCache;
@@ -426,8 +425,6 @@
} catch (Exception e) {
LogManager.logWarning(LogConstants.CTX_DQP, e, "Failed to remove buffered tuples for connection " + sessionId); //$NON-NLS-1$
}
- // cleanup the prepared plan cache
- this.prepPlanCache.clear(sessionId);
if (transactionService != null) {
try {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -29,6 +29,7 @@
import java.util.List;
import java.util.Map;
+import org.teiid.dqp.internal.process.PreparedPlanCache.CacheID;
import org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper;
import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -133,7 +134,7 @@
RequestWorkItem workItem = requestManager.getRequestWorkItem(requestID);
return getMetadataForCommand(workItem.getOriginalCommand());
}
- return obtainMetadataForPreparedSql(preparedSql, workContext.getConnectionID(), allowDoubleQuotedVariable);
+ return obtainMetadataForPreparedSql(preparedSql, workContext, allowDoubleQuotedVariable);
}
// For each projected symbol, construct a metadata map
@@ -204,17 +205,18 @@
return columnMetadata;
}
- private MetadataResult obtainMetadataForPreparedSql(String sql, String sessionId, boolean isDoubleQuotedVariablesAllowed) throws QueryParserException, QueryResolverException, MetaMatrixComponentException {
+ private MetadataResult obtainMetadataForPreparedSql(String sql, DQPWorkContext workContext, boolean isDoubleQuotedVariablesAllowed) throws QueryParserException, QueryResolverException, MetaMatrixComponentException {
Command command = null;
- PreparedPlanCache.PreparedPlan plan = planCache.getPreparedPlan(sessionId, sql);
+ ParseInfo info = new ParseInfo();
+ // Defect 19747 - the parser needs the following connection property to decide whether to treat double-quoted strings as variable names
+ info.allowDoubleQuotedVariable = isDoubleQuotedVariablesAllowed;
+ CacheID id = new PreparedPlanCache.CacheID(workContext, info, sql);
+ PreparedPlanCache.PreparedPlan plan = planCache.getPreparedPlan(id);
if(plan != null) {
command = plan.getCommand();
} else {
QueryParser parser = QueryParser.getQueryParser();
- ParseInfo info = new ParseInfo();
- // Defect 19747 - the parser needs the following connection property to decide whether to treat double-quoted strings as variable names
- info.allowDoubleQuotedVariable = isDoubleQuotedVariablesAllowed;
command = parser.parseCommand(sql, info);
QueryResolver.resolveCommand(command, Collections.EMPTY_MAP, false, this.metadata, AnalysisRecord.createNonRecordingRecord());
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlanCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlanCache.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlanCache.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -22,15 +22,18 @@
package org.teiid.dqp.internal.process;
+import java.util.Collections;
import java.util.List;
+import java.util.Map;
-import com.metamatrix.core.util.ArgCheck;
import com.metamatrix.core.util.HashCodeUtil;
import com.metamatrix.core.util.LRUCache;
import com.metamatrix.query.analysis.AnalysisRecord;
+import com.metamatrix.query.parser.ParseInfo;
import com.metamatrix.query.processor.ProcessorPlan;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.symbol.Reference;
+import com.metamatrix.vdb.runtime.VDBKey;
/**
* This class is used to cahce plan and related objects for prepared statement
@@ -38,7 +41,8 @@
public class PreparedPlanCache {
public static final int DEFAULT_MAX_SIZE_TOTAL = 100;
- private LRUCache<CacheID, PreparedPlan> cache;
+ private Map<CacheID, PreparedPlan> cache;
+ private int maxSize;
PreparedPlanCache(){
this(DEFAULT_MAX_SIZE_TOTAL);
@@ -48,7 +52,8 @@
if(maxSize < 0){
maxSize = DEFAULT_MAX_SIZE_TOTAL;
}
- cache = new LRUCache<CacheID, PreparedPlan>(maxSize);
+ this.maxSize = maxSize;
+ cache = Collections.synchronizedMap(new LRUCache<CacheID, PreparedPlan>(maxSize));
}
/**
@@ -57,71 +62,65 @@
* @param session ClientConnection
* @return PreparedPlan for the given clientConn and SQl query. Null if not exist.
*/
- public synchronized PreparedPlan getPreparedPlan(String sessionId, String sql){
- ArgCheck.isNotNull(sessionId);
- ArgCheck.isNotNull(sql);
-
- CacheID cID = new CacheID(sessionId, sql);
-
- return cache.get(cID);
+ public PreparedPlan getPreparedPlan(CacheID id){
+ id.setSessionId(id.originalSessionId);
+ PreparedPlan result = cache.get(id);
+ if (result == null) {
+ id.setSessionId(null);
+ }
+ return cache.get(id);
}
/**
* Create PreparedPlan for the given clientConn and SQl query
*/
- public synchronized PreparedPlan createPreparedPlan(String sessionId, String sql){
- ArgCheck.isNotNull(sessionId);
- ArgCheck.isNotNull(sql);
-
- CacheID cID = new CacheID(sessionId, sql);
- PreparedPlan preparedPlan = cache.get(cID);
- if(preparedPlan == null){
- preparedPlan = new PreparedPlan();
- cache.put(cID, preparedPlan);
+ public void putPreparedPlan(CacheID id, boolean sessionSpecific, PreparedPlan plan){
+ if (sessionSpecific) {
+ id.setSessionId(id.originalSessionId);
+ } else {
+ id.setSessionId(null);
}
- return preparedPlan;
+ this.cache.put(id, plan);
}
/**
- * Clear the cahced plans for the given clientConn
+ * Clear all the cached plans for all the clientConns
* @param clientConn ClientConnection
*/
- public synchronized void clear(String sessionId){
- ArgCheck.isNotNull(sessionId);
- //do not do anything
- }
-
- /**
- * Clear all the cahced plans for all the clientConns
- * @param clientConn ClientConnection
- */
- public synchronized void clearAll(){
+ public void clearAll(){
cache.clear();
}
static class CacheID{
- private String sessionId;
private String sql;
- int hashCode;
- private boolean isPreparedBatchUpdate;
-
- CacheID(String sessionId, String sql){
- this.sessionId = sessionId;
+ private VDBKey vdbInfo;
+ private ParseInfo pi;
+ private String sessionId;
+ private String originalSessionId;
+ private int hashCode;
+
+ CacheID(DQPWorkContext context, ParseInfo pi, String sql){
this.sql = sql;
- hashCode = HashCodeUtil.hashCode(HashCodeUtil.hashCode(0, sessionId), sql);
+ this.vdbInfo = new VDBKey(context.getVdbName(), context.getVdbVersion());
+ this.pi = pi;
+ this.originalSessionId = context.getConnectionID();
}
+ private void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ hashCode = HashCodeUtil.hashCode(HashCodeUtil.hashCode(HashCodeUtil.hashCode(HashCodeUtil.hashCode(0, vdbInfo), sql), pi), sessionId);
+ }
+
public boolean equals(Object obj){
if(obj == this) {
return true;
- } else if(obj == null || ! (obj instanceof CacheID)) {
+ }
+ if(! (obj instanceof CacheID)) {
return false;
- } else {
- CacheID that = (CacheID)obj;
- return this.sessionId.equals(that.sessionId)
- && this.isPreparedBatchUpdate == that.isPreparedBatchUpdate
- && this.sql.equals(that.sql);
- }
+ }
+ CacheID that = (CacheID)obj;
+ return this.pi.equals(that.pi) && this.vdbInfo.equals(that.vdbInfo) && this.sql.equals(that.sql)
+ && ((this.sessionId == null && that.sessionId == null) || this.sessionId.equals(that.sessionId));
}
public int hashCode() {
@@ -207,7 +206,7 @@
return cache.size();
}
int getSpaceAllowed() {
- return cache.getSpaceLimit();
+ return maxSize;
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -26,6 +26,8 @@
import java.util.LinkedList;
import java.util.List;
+import org.teiid.dqp.internal.process.PreparedPlanCache.CacheID;
+
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.ExpressionEvaluationException;
import com.metamatrix.api.exception.query.QueryMetadataException;
@@ -138,12 +140,12 @@
* @see org.teiid.dqp.internal.process.Request#generatePlan()
*/
protected Command generatePlan() throws QueryPlannerException, QueryParserException, QueryResolverException, QueryValidatorException, MetaMatrixComponentException {
-
String sqlQuery = requestMsg.getCommands()[0];
- prepPlan = prepPlanCache.getPreparedPlan(this.workContext.getConnectionID(), sqlQuery);
+ CacheID id = new PreparedPlanCache.CacheID(this.workContext, Request.createParseInfo(this.requestMsg), sqlQuery);
+ prepPlan = prepPlanCache.getPreparedPlan(id);
if (prepPlan == null) {
//if prepared plan does not exist, create one
- prepPlan = prepPlanCache.createPreparedPlan(this.workContext.getConnectionID(), sqlQuery);
+ prepPlan = new PreparedPlanCache.PreparedPlan();
LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Query does not exist in cache: ", sqlQuery}); //$NON-NLS-1$
}
@@ -153,10 +155,11 @@
if (cachedPlan == null) {
prepPlan.setRewritenCommand(super.generatePlan());
- if (!this.addedLimit) { //TODO: this is a little problematic
+ if (!this.addedLimit) { //TODO: this is a little problematic
// Defect 13751: Clone the plan in its current state (i.e. before processing) so that it can be used for later queries
prepPlan.setPlan((ProcessorPlan)processPlan.clone());
prepPlan.setAnalysisRecord(analysisRecord);
+ this.prepPlanCache.putPreparedPlan(id, this.context.isSessionFunctionEvaluated(), prepPlan);
}
command = prepPlan.getCommand();
} else {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -335,8 +335,7 @@
private Command parseCommand() throws QueryParserException {
String[] commands = requestMsg.getCommands();
- ParseInfo parseInfo = new ParseInfo();
- parseInfo.allowDoubleQuotedVariable = requestMsg.isDoubleQuotedVariableAllowed();
+ ParseInfo parseInfo = createParseInfo(this.requestMsg);
if (!requestMsg.isBatchedUpdate()) {
String commandStr = commands[0];
return QueryParser.getQueryParser().parseCommand(commandStr, parseInfo);
@@ -349,6 +348,12 @@
return new BatchedUpdateCommand(parsedCommands);
}
+ public static ParseInfo createParseInfo(RequestMessage requestMsg) {
+ ParseInfo parseInfo = new ParseInfo();
+ parseInfo.allowDoubleQuotedVariable = requestMsg.isDoubleQuotedVariableAllowed();
+ return parseInfo;
+ }
+
public static void validateWithVisitor(
AbstractValidationVisitor visitor,
QueryMetadataInterface metadata,
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestAccessNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestAccessNode.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestAccessNode.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -31,6 +31,7 @@
import com.metamatrix.common.buffer.TupleSource;
import com.metamatrix.query.parser.QueryParser;
import com.metamatrix.query.processor.ProcessorDataManager;
+import com.metamatrix.query.resolver.TestResolver;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.CompoundCriteria;
import com.metamatrix.query.sql.lang.IsNullCriteria;
@@ -40,6 +41,7 @@
import com.metamatrix.query.sql.symbol.Constant;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.GroupSymbol;
+import com.metamatrix.query.unittest.FakeMetadataFactory;
import com.metamatrix.query.util.CommandContext;
@@ -66,7 +68,7 @@
}
public void testOpen_Defect16059() throws Exception {
- Query query = (Query)QueryParser.getQueryParser().parseCommand("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5 AND ? IS NULL"); //$NON-NLS-1$
+ Query query = (Query)TestResolver.helpResolve("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5 AND ? IS NULL", FakeMetadataFactory.example1Cached(), null); //$NON-NLS-1$
IsNullCriteria nullCrit = (IsNullCriteria)((CompoundCriteria)query.getCriteria()).getCriteria(1);
nullCrit.setExpression(new Constant(null));
@@ -74,7 +76,7 @@
}
public void testOpen_Defect16059_2() throws Exception {
- Query query = (Query)QueryParser.getQueryParser().parseCommand("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5 AND ? IS NOT NULL"); //$NON-NLS-1$
+ Query query = (Query)TestResolver.helpResolve("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5 AND ? IS NOT NULL", FakeMetadataFactory.example1Cached(), null); //$NON-NLS-1$
IsNullCriteria nullCrit = (IsNullCriteria)((CompoundCriteria)query.getCriteria()).getCriteria(1);
nullCrit.setExpression(new Constant(null));
@@ -84,7 +86,7 @@
public void testExecCount()throws Exception{
// Setup
AccessNode node = new AccessNode(1);
- Query query = (Query)QueryParser.getQueryParser().parseCommand("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5"); //$NON-NLS-1$
+ Query query = (Query)TestResolver.helpResolve("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5", FakeMetadataFactory.example1Cached(), null); //$NON-NLS-1$
node.setCommand(query);
CommandContext context = new CommandContext();
context.setProcessorID("processorID"); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestBatchedUpdateNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestBatchedUpdateNode.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestBatchedUpdateNode.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -41,7 +41,7 @@
import com.metamatrix.query.processor.ProcessorDataManager;
import com.metamatrix.query.sql.lang.BatchedUpdateCommand;
import com.metamatrix.query.sql.lang.Command;
-import com.metamatrix.query.sql.visitor.NeedsEvaluationVisitor;
+import com.metamatrix.query.sql.visitor.EvaluatableVisitor;
import com.metamatrix.query.unittest.FakeMetadataFactory;
import com.metamatrix.query.util.CommandContext;
@@ -55,7 +55,7 @@
List<Command> commands = TestBatchedUpdatePlanner.helpGetCommands(sql, md);
List<Boolean> shouldEvaluate = new ArrayList<Boolean>(commands.size());
for (Command command : commands) {
- shouldEvaluate.add(NeedsEvaluationVisitor.needsEvaluation(command));
+ shouldEvaluate.add(EvaluatableVisitor.needsProcessingEvaluation(command));
}
BatchedUpdateNode node = new BatchedUpdateNode(1, commands, null, shouldEvaluate, "myModelName"); //$NON-NLS-1$
CommandContext context = new CommandContext();
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -26,46 +26,56 @@
import java.util.HashMap;
import java.util.Map;
+import static org.junit.Assert.*;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
import org.teiid.dqp.internal.process.PreparedPlanCache;
+import org.teiid.dqp.internal.process.PreparedPlanCache.CacheID;
-import junit.framework.TestCase;
-
import com.metamatrix.api.exception.query.QueryParserException;
import com.metamatrix.query.analysis.AnalysisRecord;
+import com.metamatrix.query.parser.ParseInfo;
import com.metamatrix.query.parser.QueryParser;
import com.metamatrix.query.processor.relational.ProjectNode;
import com.metamatrix.query.processor.relational.RelationalPlan;
import com.metamatrix.query.sql.lang.Command;
-
-public class TestPreparedPlanCache extends TestCase{
+public class TestPreparedPlanCache {
private static final String EXAMPLE_QUERY = "SELECT * FROM table"; //$NON-NLS-1$
- private final static String token = "1"; //$NON-NLS-1$
- private final static String token2 = "2"; //$NON-NLS-1$
-
- public TestPreparedPlanCache(String name) {
- super(name);
- }
+ private final static DQPWorkContext token = new DQPWorkContext();
+ private final static DQPWorkContext token2 = new DQPWorkContext();
+
+ private final static ParseInfo pi = new ParseInfo();
+
+ @BeforeClass public static void setUpOnce() {
+ token.setVdbName("foo"); //$NON-NLS-1$
+ token.setVdbVersion("1"); //$NON-NLS-1$
+ token2.setVdbName("foo"); //$NON-NLS-1$
+ token2.setVdbVersion("2"); //$NON-NLS-1$
+ }
//====Tests====//
- public void testCreatePreparedPlan(){
+ @Test public void testPutPreparedPlan(){
PreparedPlanCache cache = new PreparedPlanCache();
+ CacheID id = new PreparedPlanCache.CacheID(token, pi, EXAMPLE_QUERY + 1);
+
//No PreparedPlan at the begining
- assertNull(cache.getPreparedPlan(token, EXAMPLE_QUERY + 1));
+ assertNull(cache.getPreparedPlan(id));
//create one
- cache.createPreparedPlan(token, EXAMPLE_QUERY + 1);
+ cache.putPreparedPlan(id, true, new PreparedPlanCache.PreparedPlan());
//should have one now
- assertNotNull("Unable to get prepared plan from cache", cache.getPreparedPlan(token, EXAMPLE_QUERY + 1)); //$NON-NLS-1$
+ assertNotNull("Unable to get prepared plan from cache", cache.getPreparedPlan(id)); //$NON-NLS-1$
}
- public void testGetPreparedPlan(){
+ @Test public void testGetPreparedPlan(){
PreparedPlanCache cache = new PreparedPlanCache();
- helpCreatePreparedPlans(cache, token, 0, 10);
- helpCreatePreparedPlans(cache, token2, 0, 15);
+ helpPutPreparedPlans(cache, token, 0, 10);
+ helpPutPreparedPlans(cache, token2, 0, 15);
//read an entry for session2 (token2)
- PreparedPlanCache.PreparedPlan pPlan = cache.getPreparedPlan(token2, EXAMPLE_QUERY + 12);
+ PreparedPlanCache.PreparedPlan pPlan = cache.getPreparedPlan(new PreparedPlanCache.CacheID(token2, pi, EXAMPLE_QUERY + 12));
assertNotNull("Unable to get prepared plan from cache", pPlan); //$NON-NLS-1$
assertEquals("Error getting plan from cache", new RelationalPlan(new ProjectNode(12)).toString(), pPlan.getPlan().toString()); //$NON-NLS-1$
assertEquals("Error getting command from cache", EXAMPLE_QUERY + 12, pPlan.getCommand().toString()); //$NON-NLS-1$
@@ -73,55 +83,55 @@
assertEquals("Error gettting reference from cache", "ref12", pPlan.getReferences().get(0)); //$NON-NLS-1$ //$NON-NLS-2$
}
- public void testClearAll(){
+ @Test public void testClearAll(){
PreparedPlanCache cache = new PreparedPlanCache();
//create one for each session token
- cache.createPreparedPlan(token, EXAMPLE_QUERY + 1);
- cache.createPreparedPlan(token2, EXAMPLE_QUERY + 1);
+ helpPutPreparedPlans(cache, token, 1, 1);
+ helpPutPreparedPlans(cache, token2, 1, 1);
//should have one
- assertNotNull("Unable to get prepared plan from cache for token", cache.getPreparedPlan(token, EXAMPLE_QUERY + 1)); //$NON-NLS-1$
+ assertNotNull("Unable to get prepared plan from cache for token", cache.getPreparedPlan(new PreparedPlanCache.CacheID(token, pi, EXAMPLE_QUERY + 1))); //$NON-NLS-1$
cache.clearAll();
//should not exist for token
- assertNull("Failed remove from cache", cache.getPreparedPlan(token, EXAMPLE_QUERY + 1)); //$NON-NLS-1$
+ assertNull("Failed remove from cache", cache.getPreparedPlan(new PreparedPlanCache.CacheID(token, pi, EXAMPLE_QUERY + 1))); //$NON-NLS-1$
//should not exist for token2
- assertNull("Unable to get prepared plan from cache for token2", cache.getPreparedPlan(token2, EXAMPLE_QUERY + 1)); //$NON-NLS-1$
+ assertNull("Unable to get prepared plan from cache for token2", cache.getPreparedPlan(new PreparedPlanCache.CacheID(token2, pi, EXAMPLE_QUERY + 1))); //$NON-NLS-1$
}
- public void testMaxSize(){
+ @Test public void testMaxSize(){
PreparedPlanCache cache = new PreparedPlanCache(100);
- helpCreatePreparedPlans(cache, token, 0, 101);
+ helpPutPreparedPlans(cache, token, 0, 101);
//the first one should be gone because the max size is 100
- assertNull(cache.getPreparedPlan(token, EXAMPLE_QUERY + 0));
+ assertNull(cache.getPreparedPlan(new PreparedPlanCache.CacheID(token, pi, EXAMPLE_QUERY + 0)));
- assertNotNull(cache.getPreparedPlan(token, EXAMPLE_QUERY + 12));
- helpCreatePreparedPlans(cache, token, 102, 50);
+ assertNotNull(cache.getPreparedPlan(new PreparedPlanCache.CacheID(token, pi, EXAMPLE_QUERY + 12)));
+ helpPutPreparedPlans(cache, token, 102, 50);
//"sql12" should still be there based on lru policy
- assertNotNull(cache.getPreparedPlan(token, EXAMPLE_QUERY + 12));
+ assertNotNull(cache.getPreparedPlan(new PreparedPlanCache.CacheID(token, pi, EXAMPLE_QUERY + 12)));
- helpCreatePreparedPlans(cache, token2, 0, 121);
- helpCreatePreparedPlans(cache, token, 0, 50);
+ helpPutPreparedPlans(cache, token2, 0, 121);
+ helpPutPreparedPlans(cache, token, 0, 50);
assertTrue(cache.getSpaceUsed() <= 100);
}
- public void testZeroSizeCache() {
+ @Test public void testZeroSizeCache() {
// Create with 0 size cache
PreparedPlanCache cache = new PreparedPlanCache(0);
assertEquals(0, cache.getSpaceAllowed());
// Add 1 plan and verify it is not in the cache
- helpCreatePreparedPlans(cache, token, 0, 1);
- assertNull(cache.getPreparedPlan(token, EXAMPLE_QUERY + 0));
+ helpPutPreparedPlans(cache, token, 0, 1);
+ assertNull(cache.getPreparedPlan(new PreparedPlanCache.CacheID(token, pi, EXAMPLE_QUERY + 0)));
assertEquals(0, cache.getSpaceUsed());
// Add another plan and verify it is not in the cache
- helpCreatePreparedPlans(cache, token, 1, 1);
- assertNull(cache.getPreparedPlan(token, EXAMPLE_QUERY + 1));
+ helpPutPreparedPlans(cache, token, 1, 1);
+ assertNull(cache.getPreparedPlan(new PreparedPlanCache.CacheID(token, pi, EXAMPLE_QUERY + 1)));
assertEquals(0, cache.getSpaceUsed());
}
// set init size to negative number, which should default to 100 (default)
- public void testNegativeSizeCacheUsesDefault() {
+ @Test public void testNegativeSizeCacheUsesDefault() {
PreparedPlanCache negativeSizedCache = new PreparedPlanCache(-1000);
PreparedPlanCache defaultSizedCache = new PreparedPlanCache();
@@ -130,15 +140,18 @@
}
//====Help methods====//
- private void helpCreatePreparedPlans(PreparedPlanCache cache, String token, int start, int count){
- for(int i=start; i<count; i++){
+ private void helpPutPreparedPlans(PreparedPlanCache cache, DQPWorkContext session, int start, int count){
+ for(int i=0; i<count; i++){
Command dummy;
try {
- dummy = QueryParser.getQueryParser().parseCommand(EXAMPLE_QUERY + i);
+ dummy = QueryParser.getQueryParser().parseCommand(EXAMPLE_QUERY + (start + i));
} catch (QueryParserException e) {
throw new RuntimeException(e);
}
- PreparedPlanCache.PreparedPlan pPlan = cache.createPreparedPlan(token, dummy.toString());
+ CacheID id = new PreparedPlanCache.CacheID(session, pi, dummy.toString());
+
+ PreparedPlanCache.PreparedPlan pPlan = new PreparedPlanCache.PreparedPlan();
+ cache.putPreparedPlan(id, true, pPlan);
pPlan.setCommand(dummy);
pPlan.setPlan(new RelationalPlan(new ProjectNode(i)));
Map props = new HashMap();
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2009-04-20 20:41:11 UTC (rev 807)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2009-04-20 21:02:03 UTC (rev 808)
@@ -27,13 +27,10 @@
import java.util.HashMap;
import java.util.List;
-import org.teiid.dqp.internal.process.DQPWorkContext;
-import org.teiid.dqp.internal.process.PreparedPlanCache;
-import org.teiid.dqp.internal.process.PreparedStatementRequest;
+import junit.framework.TestCase;
+
import org.teiid.dqp.internal.process.TestRequest.FakeApplicationEnvironment;
-import junit.framework.TestCase;
-
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryParserException;
import com.metamatrix.api.exception.query.QueryPlannerException;
@@ -52,7 +49,6 @@
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
import com.metamatrix.query.processor.FakeDataManager;
import com.metamatrix.query.processor.ProcessorDataManager;
-import com.metamatrix.query.processor.ProcessorPlan;
import com.metamatrix.query.processor.TestProcessor;
import com.metamatrix.query.unittest.FakeMetadataFacade;
import com.metamatrix.query.unittest.FakeMetadataFactory;
@@ -68,14 +64,14 @@
int hitCount;
@Override
- public synchronized PreparedPlan getPreparedPlan(
- String clientConn, String sql) {
- PreparedPlan plan = super.getPreparedPlan(clientConn, sql);
- if (plan != null && plan.getPlan() != null) {
+ public PreparedPlan getPreparedPlan(CacheID id) {
+ PreparedPlan result = super.getPreparedPlan(id);
+ if (result != null) {
hitCount++;
}
- return plan;
+ return result;
}
+
}
public TestPreparedStatement(String name) {
@@ -89,8 +85,12 @@
helpTestProcessing(preparedSql, values, expected, dataManager, metadata, callableStatement);
}
-
+
static void helpTestProcessing(String preparedSql, List values, List[] expected, ProcessorDataManager dataManager, QueryMetadataInterface metadata, boolean callableStatement) throws Exception {
+ helpTestProcessing(preparedSql, values, expected, dataManager, metadata, callableStatement, false);
+ }
+
+ static void helpTestProcessing(String preparedSql, List values, List[] expected, ProcessorDataManager dataManager, QueryMetadataInterface metadata, boolean callableStatement, boolean differentPlan) throws Exception {
TestablePreparedPlanCache prepPlan = new TestablePreparedPlanCache();
//Create plan
PreparedStatementRequest plan = TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, new DefaultCapabilitiesFinder(), metadata, prepPlan, SESSION_ID, callableStatement, false);
@@ -110,7 +110,7 @@
//get the plan again with a new connection
assertNotNull(TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, new DefaultCapabilitiesFinder(), metadata, prepPlan, 7, callableStatement, false));
- assertEquals("new connection should not have used the same plan", 1, prepPlan.hitCount); //$NON-NLS-1$
+ assertEquals(differentPlan?1:2, prepPlan.hitCount);
}
public void testWhere() throws Exception {
@@ -129,6 +129,23 @@
helpTestProcessing(preparedSql, values, expected, FakeMetadataFactory.example1Cached(), false);
}
+ public void testSessionSpecificFunction() throws Exception {
+ // Create query
+ String preparedSql = "SELECT user(), e2, pm1.g1.e3 as a, e4 as b FROM pm1.g1 WHERE e2=?"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "foo", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "foo", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ List values = new ArrayList();
+ values.add(new Short((short)0));
+ FakeDataManager dataManager = new FakeDataManager();
+ TestProcessor.sampleData1(dataManager);
+ helpTestProcessing(preparedSql, values, expected, dataManager, FakeMetadataFactory.example1Cached(), false, true);
+ }
+
public void testFunctionWithReferencePushDown() throws Exception {
// Create query
String preparedSql = "SELECT pm1.g1.e1 FROM pm1.g1, pm1.g2 WHERE pm1.g1.e1 = pm1.g2.e1 and pm1.g1.e2+2=?"; //$NON-NLS-1$
15 years, 8 months
teiid SVN: r807 - in trunk: common-internal/src/main/java/com/metamatrix/core/event and 11 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-20 16:41:11 -0400 (Mon, 20 Apr 2009)
New Revision: 807
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java
trunk/common-internal/src/main/java/com/metamatrix/core/event/AsynchEventBroker.java
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java
trunk/connector-api/src/main/java/org/teiid/connector/internal/ConnectorPropertyNames.java
trunk/console/src/main/java/com/metamatrix/console/ui/layout/WorkspaceController.java
trunk/engine/src/main/java/com/metamatrix/dqp/service/CustomizableTrackingService.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditManager.java
trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
Log:
TEIID-510: Removing the thread keep alive references from all the thread pool creations, this defaults to 2 mins.
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -356,7 +356,7 @@
* @param numThreads the maximum number of worker threads allowed
* @return
*/
- public static WorkerPool newWorkerPool(String name, int numThreads, long keepAlive) {
+ public static WorkerPool newWorkerPool(String name, int numThreads) {
return new StatsCapturingSharedThreadPoolExecutor(name, numThreads);
}
Modified: trunk/common-internal/src/main/java/com/metamatrix/core/event/AsynchEventBroker.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/core/event/AsynchEventBroker.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/common-internal/src/main/java/com/metamatrix/core/event/AsynchEventBroker.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -31,7 +31,7 @@
import com.metamatrix.core.MetaMatrixRuntimeException;
public class AsynchEventBroker extends AbstractEventBroker {
- private WorkerPool workerPool = WorkerPoolFactory.newWorkerPool("AsyncEventBroker", 1, 120000); //$NON-NLS-1$
+ private WorkerPool workerPool = WorkerPoolFactory.newWorkerPool("AsyncEventBroker", 1); //$NON-NLS-1$
private static final String DEFAULT_NAME = CorePlugin.Util.getString("AsynchEventBroker.DefaultName"); //$NON-NLS-1$
private static final long SHUTDOWN_TIMEOUT_MILLIS = 10000; // 10 seconds
Modified: trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java
===================================================================
--- trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -42,7 +42,7 @@
final int WORK_ITEMS = 10;
final int MAX_THREADS = 5;
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", MAX_THREADS, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", MAX_THREADS); //$NON-NLS-1$
for(int i=0; i<WORK_ITEMS; i++) {
pool.execute(new FakeWorkItem(SINGLE_WAIT));
@@ -60,7 +60,7 @@
final long SINGLE_WAIT = 50;
final long NUM_THREADS = 5;
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5); //$NON-NLS-1$
for(int i=0; i<NUM_THREADS; i++) {
pool.execute(new FakeWorkItem(SINGLE_WAIT));
@@ -80,13 +80,13 @@
}
@Test(expected=RejectedExecutionException.class) public void testShutdown() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5); //$NON-NLS-1$
pool.shutdown();
pool.execute(new FakeWorkItem(1));
}
@Test public void testScheduleCancel() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5); //$NON-NLS-1$
ScheduledFuture<?> future = pool.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
@@ -97,7 +97,7 @@
}
@Test public void testSchedule() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5); //$NON-NLS-1$
final ArrayList<String> result = new ArrayList<String>();
ScheduledFuture<?> future = pool.schedule(new Runnable() {
@Override
@@ -121,7 +121,7 @@
}
@Test(expected=ExecutionException.class) public void testScheduleException() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5); //$NON-NLS-1$
ScheduledFuture<?> future = pool.schedule(new Runnable() {
@Override
public void run() {
@@ -135,7 +135,7 @@
* Here each execution exceeds the period
*/
@Test public void testScheduleRepeated() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5); //$NON-NLS-1$
final ArrayList<String> result = new ArrayList<String>();
ScheduledFuture<?> future = pool.scheduleAtFixedRate(new Runnable() {
@Override
@@ -154,7 +154,7 @@
}
@Test public void testFailingWork() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5); //$NON-NLS-1$
final AtomicInteger count = new AtomicInteger();
pool.execute(new Runnable() {
@Override
Modified: trunk/connector-api/src/main/java/org/teiid/connector/internal/ConnectorPropertyNames.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/internal/ConnectorPropertyNames.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/connector-api/src/main/java/org/teiid/connector/internal/ConnectorPropertyNames.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -36,12 +36,6 @@
*/
public static final String MAX_THREADS = "ConnectorMaxThreads"; //$NON-NLS-1$
- /**
- * The environment property name whose value defines the maximum length of time
- * a processor thread may live idle. This property is required and is in milliseconds.
- */
- public static final String THREAD_TTL = "ConnectorThreadTTL"; //$NON-NLS-1$
-
/**
* This property can be used to specify the maximum number of rows to be returned
* from the datasource of this connector. The connector should stop adding records
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/layout/WorkspaceController.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/layout/WorkspaceController.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/layout/WorkspaceController.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -100,7 +100,7 @@
super();
workspace = ws;
- workerPool = WorkerPoolFactory.newWorkerPool("WorkspaceControllerQueue", 1, 1000); //$NON-NLS-1$
+ workerPool = WorkerPoolFactory.newWorkerPool("WorkspaceControllerQueue", 1); //$NON-NLS-1$
}
public static void createInstance(Workspace workspace) {
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/CustomizableTrackingService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/CustomizableTrackingService.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/CustomizableTrackingService.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -69,21 +69,10 @@
* Whether to log source command. Defaults to false.
*/
public static final String SYSTEM_TXN_STORE_SRCCMD = "metamatrix.transaction.log.storeSRCCMD"; //$NON-NLS-1$
-
- /**
- * The name of the System property that contains the time to live (in milliseconds) for threads
- * in the LogManager. The time to live is simply the period of thread inactivity
- * that determines when a thread may be expired. This is an optional property
- * that defaults to '600000' milliseconds (or 10 minutes).
- */
- public static final String SYSTEM_LOG_THREAD_TTL = "metamatrix.transaction.log.threadTTL"; //$NON-NLS-1$
- protected static final long DEFAULT_LOG_THREAD_TTL = 600000; // 10 minute default
-
private CommandLoggerSPI commandLogger;
private boolean recordUserCommands;
private boolean recordSourceCommands;
- private long workerTTL;
private WorkerPool logQueue;
@@ -224,8 +213,6 @@
if(propvalue != null){
recordSourceCommands = Boolean.valueOf(propvalue).booleanValue();
}
-
- workerTTL = PropertiesUtils.getLongProperty(props, SYSTEM_LOG_THREAD_TTL, DEFAULT_LOG_THREAD_TTL);
}
/**
@@ -233,8 +220,7 @@
*/
public void start(ApplicationEnvironment environment) throws ApplicationLifecycleException {
logQueue = WorkerPoolFactory.newWorkerPool("CustomTracker", //$NON-NLS-1$
- 1, // Use only a single thread
- workerTTL);
+ 1);
}
/**
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -97,7 +97,6 @@
public class ConnectorManager implements ApplicationService {
public static final int DEFAULT_MAX_PROCESSOR_THREADS = 15;
- public static final int DEFAULT_PROCESSOR_TREAD_TTL = 120000;
private static final String DEFAULT_MAX_RESULTSET_CACHE_SIZE = "20"; //$NON-NLS-1$
private static final String DEFAULT_MAX_RESULTSET_CACHE_AGE = "3600000"; //$NON-NLS-1$
@@ -307,9 +306,8 @@
}
int maxThreads = PropertiesUtils.getIntProperty(props, ConnectorPropertyNames.MAX_THREADS, DEFAULT_MAX_PROCESSOR_THREADS);
- int threadTTL = PropertiesUtils.getIntProperty(props, ConnectorPropertyNames.THREAD_TTL, DEFAULT_PROCESSOR_TREAD_TTL);
- connectorWorkerPool = WorkerPoolFactory.newWorkerPool(connectorName, maxThreads, threadTTL);
+ connectorWorkerPool = WorkerPoolFactory.newWorkerPool(connectorName, maxThreads);
// Create the Connector env
Properties clonedProps = PropertiesUtils.clone(props);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -117,7 +117,6 @@
private static final int DEFAULT_MAX_CODE_TABLES = 20;
private static final int DEFAULT_PROCESSOR_TIMESLICE = 2000;
private static final String PROCESS_PLAN_QUEUE_NAME = "QueryProcessorQueue"; //$NON-NLS-1$
- private static final String DEAFULT_PROCESS_WORKER_TIMEOUT = "120000"; //$NON-NLS-1$
private static final int DEFAULT_MAX_PROCESS_WORKERS = 15;
private static final String DEFAULT_MAX_RESULTSET_CACHE_SIZE = "50"; //$NON-NLS-1$
private static final String DEFAULT_MAX_RESULTSET_CACHE_AGE = "3600000"; //$NON-NLS-1$
@@ -623,8 +622,7 @@
metadataService = (MetadataService) env.findService(DQPServiceNames.METADATA_SERVICE);
// Create the worker pools to tie the queues together
- processWorkerPool = WorkerPoolFactory.newWorkerPool(PROCESS_PLAN_QUEUE_NAME, PropertiesUtils.getIntProperty(props, DQPConfigSource.PROCESS_POOL_MAX_THREADS, DEFAULT_MAX_PROCESS_WORKERS),
- Integer.parseInt(props.getProperty(DQPConfigSource.PROCESS_POOL_THREAD_TTL, DEAFULT_PROCESS_WORKER_TIMEOUT)));
+ processWorkerPool = WorkerPoolFactory.newWorkerPool(PROCESS_PLAN_QUEUE_NAME, PropertiesUtils.getIntProperty(props, DQPConfigSource.PROCESS_POOL_MAX_THREADS, DEFAULT_MAX_PROCESS_WORKERS));
tempTableStoresHolder = new TempTableStoresHolder(bufferManager);
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -51,7 +51,7 @@
private ConnectionPool userIDPool;
private ConnectionPool singleIDPool;
private static ArrayList<Exception> EXCEPTIONS = new ArrayList<Exception>();
- private static WorkerPool pool = WorkerPoolFactory.newWorkerPool(TestConnectionPool.class.getSimpleName(), 1, 1000);
+ private static WorkerPool pool = WorkerPoolFactory.newWorkerPool(TestConnectionPool.class.getSimpleName(), 1);
@AfterClass public static void tearDownOnce() {
pool.shutdownNow();
Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -80,7 +80,7 @@
}
this.server = server;
- this.workerPool = WorkerPoolFactory.newWorkerPool("SocketWorker", maxWorkers, 120000); //$NON-NLS-1$
+ this.workerPool = WorkerPoolFactory.newWorkerPool("SocketWorker", maxWorkers); //$NON-NLS-1$
this.nettyPool = Executors.newCachedThreadPool();
if (LogManager.isMessageToBeRecorded(SocketVMController.SOCKET_CONTEXT, MessageLevel.DETAIL)) {
LogManager.logDetail(SocketVMController.SOCKET_CONTEXT, "server = " + this.server + "binding to port:" + port); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditManager.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditManager.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditManager.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -117,14 +117,8 @@
*/
public static final String SYSTEM_AUDIT_CONSOLE_PROPERTY_NAME = "metamatrix.audit.console"; //$NON-NLS-1$
- /**
- * The name of the configuration property that contains the time to live (in milliseconds) for threads
- * in the AuditManager. The time to live is simply the period of thread inactivity
- * that determines when a thread may be expired. This is an optional property
- * that defaults to '600000' milliseconds (or 10 minutes).
- */
- public static final String SYSTEM_AUDIT_THREAD_TTL = "metamatrix.audit.threadTTL"; //$NON-NLS-1$
+
protected static final String DEFAULT_AUDIT_MAX_THREADS = "1"; //$NON-NLS-1$
protected static final String DEFAULT_AUDIT_THREAD_TTL = "600000"; //$NON-NLS-1$
@@ -228,12 +222,7 @@
private void initializeQueueWorkers() {
try {
- // Create the worker pool
- String threadTTLString = System.getProperty(SYSTEM_AUDIT_THREAD_TTL, DEFAULT_AUDIT_THREAD_TTL);
- this.workerPool = WorkerPoolFactory.newWorkerPool(
- "AuditQueue", //$NON-NLS-1$
- 1,
- Integer.parseInt(threadTTLString));
+ this.workerPool = WorkerPoolFactory.newWorkerPool("AuditQueue",1);//$NON-NLS-1$
} catch ( Exception e ) {
LogManager.logError(LogSecurityConstants.CTX_AUDIT, PlatformPlugin.Util.getString(ErrorMessageKeys.SEC_AUDIT_0007, e));
}
Modified: trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -56,7 +56,7 @@
* Thread that updates the service instances of the service selection policies
* when notification of a Registry change event has occurred.
*/
- private WorkerPool updatePool = WorkerPoolFactory.newWorkerPool("RegistryUpdate", 1, 60000); //$NON-NLS-1$
+ private WorkerPool updatePool = WorkerPoolFactory.newWorkerPool("RegistryUpdate", 1); //$NON-NLS-1$
ClusteredRegistryState registry;
Modified: trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-04-20 19:01:03 UTC (rev 806)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-04-20 20:41:11 UTC (rev 807)
@@ -121,8 +121,7 @@
public final static String SERVICE_ID = "Service"; //$NON-NLS-1$
public static final String STARTER_MAX_THREADS = "vm.starter.maxThreads"; //$NON-NLS-1$
- /**Time-to-live for threads used to start services (ms)*/
- public static final String STARTER_TIMETOLIVE = "vm.starter.timetolive"; //$NON-NLS-1$
+
/**Interval to check the state of services (ms)*/
public static final String SERVICE_MONITOR_INTERVAL = "metamatrix.server.serviceMonitorInterval"; //$NON-NLS-1$
@@ -177,9 +176,8 @@
Properties configProps = CurrentConfiguration.getInstance().getProperties();
int maxThreads = PropertiesUtils.getIntProperty(configProps, STARTER_MAX_THREADS, DEFAULT_STARTER_MAX_THREADS);
- int timeToLive = PropertiesUtils.getIntProperty(configProps, STARTER_TIMETOLIVE, DEFAULT_STARTER_TIMETOLIVE);
- this.startServicePool = WorkerPoolFactory.newWorkerPool("StartServiceQueue", maxThreads, timeToLive); //$NON-NLS-1$
+ this.startServicePool = WorkerPoolFactory.newWorkerPool("StartServiceQueue", maxThreads); //$NON-NLS-1$
initVMProperties();
15 years, 8 months
teiid SVN: r806 - in trunk/connectors: connector-jdbc/src/assembly and 12 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-20 15:01:03 -0400 (Mon, 20 Apr 2009)
New Revision: 806
Modified:
trunk/connectors/connector-jdbc/pom.xml
trunk/connectors/connector-jdbc/src/assembly/bundle.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-ldap/src/assembly/bundle.xml
trunk/connectors/connector-loopback/pom.xml
trunk/connectors/connector-loopback/src/assembly/bundle.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-salesforce/src/assembly/bundle.xml
trunk/connectors/connector-text/pom.xml
trunk/connectors/connector-text/src/assembly/bundle.xml
trunk/connectors/connector-xml-common/pom.xml
trunk/connectors/connector-xml-common/src/assembly/bundle.xml
trunk/connectors/connector-xml/pom.xml
trunk/connectors/connector-xml/src/assembly/bundle.xml
Log:
TEIID-488: connector build was using 'dependency' plugin to build the classpath and 'assembly' plugin to build the dependency jars, however they both do not resolve to correct path always. Dependency plug-in is more accurate, so moving to use the "dependency" plugin for both classpath and jar building and using the assembly for creating the zip file.
Modified: trunk/connectors/connector-jdbc/pom.xml
===================================================================
--- trunk/connectors/connector-jdbc/pom.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-jdbc/pom.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -59,6 +59,25 @@
<!-- bundles all its dependencies in a single zip file -->
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeTransitive>false</excludeTransitive>
+ <includeScope>runtime</includeScope>
+ <excludeTypes>pom</excludeTypes>
+ <outputDirectory>target/dependency</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
<configuration>
Modified: trunk/connectors/connector-jdbc/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-jdbc/src/assembly/bundle.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-jdbc/src/assembly/bundle.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -15,20 +15,10 @@
<includes><include>${project.artifactId}.xml</include></includes>
<outputDirectory>/</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>target/dependency</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
</fileSets>
-
- <dependencySets>
- <dependencySet>
- <useProjectArtifact>true</useProjectArtifact>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <useTransitiveFiltering>false</useTransitiveFiltering>
- <useDefaultExcludes>true</useDefaultExcludes>
- <unpack>false</unpack>
-
- <excludes>
- <exclude>teiid:*</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-ldap/pom.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -56,6 +56,25 @@
<!-- bundles all its dependencies in a single zip file -->
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeTransitive>false</excludeTransitive>
+ <includeScope>runtime</includeScope>
+ <excludeTypes>pom</excludeTypes>
+ <outputDirectory>target/dependency</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
<configuration>
Modified: trunk/connectors/connector-ldap/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-ldap/src/assembly/bundle.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-ldap/src/assembly/bundle.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -15,20 +15,10 @@
<includes><include>${project.artifactId}.xml</include></includes>
<outputDirectory>/</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>target/dependency</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
</fileSets>
-
- <dependencySets>
- <dependencySet>
- <useProjectArtifact>true</useProjectArtifact>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <useTransitiveFiltering>false</useTransitiveFiltering>
- <useDefaultExcludes>true</useDefaultExcludes>
- <unpack>false</unpack>
-
- <excludes>
- <exclude>teiid:*</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-loopback/pom.xml
===================================================================
--- trunk/connectors/connector-loopback/pom.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-loopback/pom.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -59,6 +59,25 @@
<!-- bundles all its dependencies in a single zip file -->
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeTransitive>false</excludeTransitive>
+ <includeScope>runtime</includeScope>
+ <excludeTypes>pom</excludeTypes>
+ <outputDirectory>target/dependency</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
<configuration>
Modified: trunk/connectors/connector-loopback/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-loopback/src/assembly/bundle.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-loopback/src/assembly/bundle.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -15,20 +15,10 @@
<includes><include>${project.artifactId}.xml</include></includes>
<outputDirectory>/</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>target/dependency</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
</fileSets>
-
- <dependencySets>
- <dependencySet>
- <useProjectArtifact>true</useProjectArtifact>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <useTransitiveFiltering>false</useTransitiveFiltering>
- <useDefaultExcludes>true</useDefaultExcludes>
- <unpack>false</unpack>
-
- <excludes>
- <exclude>teiid:*</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-salesforce/pom.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -69,6 +69,25 @@
<!-- bundles all its dependencies in a single zip file -->
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeTransitive>false</excludeTransitive>
+ <includeScope>runtime</includeScope>
+ <excludeTypes>pom</excludeTypes>
+ <outputDirectory>target/dependency</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
<configuration>
Modified: trunk/connectors/connector-salesforce/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-salesforce/src/assembly/bundle.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-salesforce/src/assembly/bundle.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -15,21 +15,9 @@
<includes><include>${project.artifactId}.xml</include></includes>
<outputDirectory>/</outputDirectory>
</fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <useProjectArtifact>true</useProjectArtifact>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <useTransitiveFiltering>false</useTransitiveFiltering>
- <useDefaultExcludes>true</useDefaultExcludes>
- <unpack>false</unpack>
-
- <excludes>
- <exclude>teiid:*</exclude>
- <exclude>*:pom</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-
+ <fileSet>
+ <directory>target/dependency</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ </fileSets>
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-text/pom.xml
===================================================================
--- trunk/connectors/connector-text/pom.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-text/pom.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -55,6 +55,25 @@
<!-- bundles all its dependencies in a single zip file -->
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeTransitive>false</excludeTransitive>
+ <includeScope>runtime</includeScope>
+ <excludeTypes>pom</excludeTypes>
+ <outputDirectory>target/dependency</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
<configuration>
Modified: trunk/connectors/connector-text/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-text/src/assembly/bundle.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-text/src/assembly/bundle.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -15,21 +15,9 @@
<includes><include>${project.artifactId}.xml</include></includes>
<outputDirectory>/</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>target/dependency</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
</fileSets>
-
-
- <dependencySets>
- <dependencySet>
- <useProjectArtifact>true</useProjectArtifact>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <useTransitiveFiltering>false</useTransitiveFiltering>
- <useDefaultExcludes>true</useDefaultExcludes>
- <unpack>false</unpack>
-
- <excludes>
- <exclude>teiid:*</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-xml/pom.xml
===================================================================
--- trunk/connectors/connector-xml/pom.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-xml/pom.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -70,6 +70,25 @@
<!-- bundles all its dependencies in a single zip file -->
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeTransitive>false</excludeTransitive>
+ <includeScope>runtime</includeScope>
+ <excludeTypes>pom</excludeTypes>
+ <outputDirectory>target/dependency</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
<configuration>
Modified: trunk/connectors/connector-xml/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-xml/src/assembly/bundle.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-xml/src/assembly/bundle.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -15,21 +15,9 @@
<includes><include>${project.artifactId}.xml</include></includes>
<outputDirectory>/</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>target/dependency</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
</fileSets>
-
- <dependencySets>
- <dependencySet>
- <useProjectArtifact>true</useProjectArtifact>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <useTransitiveFiltering>false</useTransitiveFiltering>
- <useDefaultExcludes>true</useDefaultExcludes>
- <unpack>false</unpack>
-
- <excludes>
- <exclude>teiid:*</exclude>
- <exclude>*:pom</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-xml-common/pom.xml
===================================================================
--- trunk/connectors/connector-xml-common/pom.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-xml-common/pom.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -115,6 +115,25 @@
<!-- bundles all its dependencies in a single zip file -->
<build>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeTransitive>false</excludeTransitive>
+ <includeScope>runtime</includeScope>
+ <excludeTypes>pom</excludeTypes>
+ <outputDirectory>target/dependency</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
Modified: trunk/connectors/connector-xml-common/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-xml-common/src/assembly/bundle.xml 2009-04-20 18:21:26 UTC (rev 805)
+++ trunk/connectors/connector-xml-common/src/assembly/bundle.xml 2009-04-20 19:01:03 UTC (rev 806)
@@ -9,18 +9,11 @@
<includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <useProjectArtifact>false</useProjectArtifact>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <useTransitiveFiltering>false</useTransitiveFiltering>
- <useDefaultExcludes>true</useDefaultExcludes>
- <unpack>false</unpack>
-
- <excludes>
- <exclude>teiid:*</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
+ <fileSets>
+ <fileSet>
+ <directory>target/dependency</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ </fileSets>
</assembly>
\ No newline at end of file
15 years, 8 months
teiid SVN: r805 - in trunk/server/src/main/java/com/metamatrix/server: query/service and 1 other directory.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-04-20 14:21:26 -0400 (Mon, 20 Apr 2009)
New Revision: 805
Modified:
trunk/server/src/main/java/com/metamatrix/server/dqp/config/PlatformConfigSource.java
trunk/server/src/main/java/com/metamatrix/server/query/service/QueryServicePropertyNames.java
Log:
Teiid - 510 - removed the 2 properties that are no longer used and change the statics to reference DQPConfigSource
Modified: trunk/server/src/main/java/com/metamatrix/server/dqp/config/PlatformConfigSource.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/dqp/config/PlatformConfigSource.java 2009-04-20 18:20:52 UTC (rev 804)
+++ trunk/server/src/main/java/com/metamatrix/server/dqp/config/PlatformConfigSource.java 2009-04-20 18:21:26 UTC (rev 805)
@@ -51,7 +51,6 @@
import com.metamatrix.server.dqp.service.PlatformTransactionService;
import com.metamatrix.server.dqp.service.PlatformVDBService;
import com.metamatrix.server.dqp.service.tracker.DatabaseCommandLogger;
-import com.metamatrix.server.query.service.QueryServicePropertyNames;
/**
*/
@@ -66,21 +65,7 @@
public PlatformConfigSource(Properties queryServiceProps, Properties currentConfiguration, Object clientId, Host host, String processName) {
dqpProps = PropertiesUtils.clone(queryServiceProps, currentConfiguration, true);
- dqpProps.setProperty(DQPConfigSource.PROCESS_POOL_MAX_THREADS, queryServiceProps.getProperty(QueryServicePropertyNames.PROCESS_POOL_MAX_THREADS));
- dqpProps.setProperty(DQPConfigSource.PROCESS_POOL_THREAD_TTL, queryServiceProps.getProperty(QueryServicePropertyNames.PROCESS_POOL_THREAD_TTL));
- dqpProps.setProperty(DQPConfigSource.MIN_FETCH_SIZE, queryServiceProps.getProperty(QueryServicePropertyNames.MIN_FETCH_SIZE));
- dqpProps.setProperty(DQPConfigSource.MAX_FETCH_SIZE, queryServiceProps.getProperty(QueryServicePropertyNames.MAX_FETCH_SIZE));
- dqpProps.setProperty(DQPConfigSource.MAX_CODE_TABLE_RECORDS, queryServiceProps.getProperty(QueryServicePropertyNames.MAX_CODE_TABLE_RECORDS));
- dqpProps.setProperty(DQPConfigSource.MAX_CODE_TABLES, queryServiceProps.getProperty(QueryServicePropertyNames.MAX_CODE_TABLES));
- dqpProps.setProperty(DQPConfigSource.PROCESSOR_TIMESLICE, queryServiceProps.getProperty(QueryServicePropertyNames.PROCESSOR_TIMESLICE));
- dqpProps.setProperty(DQPConfigSource.USE_RESULTSET_CACHE, queryServiceProps.getProperty(QueryServicePropertyNames.USE_RESULTSET_CACHE));
- dqpProps.setProperty(DQPConfigSource.MAX_RESULTSET_CACHE_SIZE, queryServiceProps.getProperty(QueryServicePropertyNames.MAX_RESULTSET_CACHE_SIZE));
- dqpProps.setProperty(DQPConfigSource.MAX_RESULTSET_CACHE_AGE, queryServiceProps.getProperty(QueryServicePropertyNames.MAX_RESULTSET_CACHE_AGE));
- dqpProps.setProperty(DQPConfigSource.RESULTSET_CACHE_SCOPE, queryServiceProps.getProperty(QueryServicePropertyNames.RESULTSET_CACHE_SCOPE));
-
- dqpProps.setProperty(DQPConfigSource.MAX_PLAN_CACHE_SIZE, queryServiceProps.getProperty(QueryServicePropertyNames.MAX_PLAN_CACHE_SIZE));
-
String procDebugStr = currentConfiguration.getProperty(PROC_DEBUG_ALLOWED);
if(procDebugStr != null) {
dqpProps.setProperty(DQPConfigSource.PROCESSOR_DEBUG_ALLOWED, procDebugStr);
Modified: trunk/server/src/main/java/com/metamatrix/server/query/service/QueryServicePropertyNames.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/query/service/QueryServicePropertyNames.java 2009-04-20 18:20:52 UTC (rev 804)
+++ trunk/server/src/main/java/com/metamatrix/server/query/service/QueryServicePropertyNames.java 2009-04-20 18:21:26 UTC (rev 805)
@@ -22,30 +22,29 @@
package com.metamatrix.server.query.service;
+import com.metamatrix.common.application.DQPConfigSource;
+
public class QueryServicePropertyNames {
- public static final String PROCESS_POOL_MAX_THREADS = "ProcessPoolMaxThreads"; //$NON-NLS-1$
- public static final String PROCESS_POOL_THREAD_TTL = "ProcessPoolThreadTTL"; //$NON-NLS-1$
+ public static final String PROCESS_POOL_MAX_THREADS = DQPConfigSource.PROCESS_POOL_MAX_THREADS;
- public static final String MIN_FETCH_SIZE = "MinFetchSize"; //$NON-NLS-1$
- public static final String MAX_FETCH_SIZE = "MaxFetchSize"; //$NON-NLS-1$
+ public static final String MAX_FETCH_SIZE = DQPConfigSource.MAX_FETCH_SIZE;
- public static final String MAX_CODE_TABLE_RECORDS = "MaxCodeTableRecords"; //$NON-NLS-1$
- public static final String MAX_CODE_TABLES = "MaxCodeTables"; //$NON-NLS-1$
+ public static final String MAX_CODE_TABLE_RECORDS = DQPConfigSource.MAX_CODE_TABLE_RECORDS;
+
+ public static final String MAX_CODE_TABLES = DQPConfigSource.MAX_CODE_TABLES;
- public static final String PROCESSOR_TIMESLICE = "ProcessorTimeslice"; //$NON-NLS-1$
+ public static final String PROCESSOR_TIMESLICE = DQPConfigSource.PROCESSOR_TIMESLICE;
public static final String UDF_SOURCE = "UDFSource"; //$NON-NLS-1$
-
-// public static final String SOCKET_WORKER_POOL_MAX_THREADS = "SocketWorkerPoolMaxThreads"; //$NON-NLS-1$
-// public static final String SOCKET_WORKER_POOL_THREAD_TTL = "SocketWorkerPoolThreadTTL"; //$NON-NLS-1$
-//
-// public static final String SOCKET_PORT = "SocketPort"; //$NON-NLS-1$
- public static final String USE_RESULTSET_CACHE = "ResultSetCacheEnabled"; //$NON-NLS-1$
- public static final String MAX_RESULTSET_CACHE_SIZE = "ResultSetCacheMaxSize"; //$NON-NLS-1$
- public static final String MAX_RESULTSET_CACHE_AGE = "ResultSetCacheMaxAge"; //$NON-NLS-1$
- public static final String RESULTSET_CACHE_SCOPE = "ResultSetCacheScope"; //$NON-NLS-1$
+ public static final String USE_RESULTSET_CACHE = DQPConfigSource.USE_RESULTSET_CACHE;
- public static final String MAX_PLAN_CACHE_SIZE = "MaxPlanCacheSize"; //$NON-NLS-1$
+ public static final String MAX_RESULTSET_CACHE_SIZE = DQPConfigSource.MAX_RESULTSET_CACHE_SIZE;
+
+ public static final String MAX_RESULTSET_CACHE_AGE = DQPConfigSource.MAX_RESULTSET_CACHE_AGE;
+
+ public static final String RESULTSET_CACHE_SCOPE = DQPConfigSource.RESULTSET_CACHE_SCOPE;
+
+ public static final String MAX_PLAN_CACHE_SIZE = DQPConfigSource.MAX_PLAN_CACHE_SIZE;
}
15 years, 8 months
teiid SVN: r804 - trunk/engine/src/main/java/com/metamatrix/common/application.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-04-20 14:20:52 -0400 (Mon, 20 Apr 2009)
New Revision: 804
Modified:
trunk/engine/src/main/java/com/metamatrix/common/application/DQPConfigSource.java
Log:
Teiid - 510 - removed the 2 properties that are no longer used
Modified: trunk/engine/src/main/java/com/metamatrix/common/application/DQPConfigSource.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/application/DQPConfigSource.java 2009-04-20 16:37:50 UTC (rev 803)
+++ trunk/engine/src/main/java/com/metamatrix/common/application/DQPConfigSource.java 2009-04-20 18:20:52 UTC (rev 804)
@@ -32,7 +32,6 @@
*/
public interface DQPConfigSource {
- public static final String MIN_FETCH_SIZE = "MinFetchSize"; //$NON-NLS-1$
public static final String MAX_FETCH_SIZE = "MaxFetchSize"; //$NON-NLS-1$
public static final String MAX_CODE_TABLE_RECORDS = "MaxCodeTableRecords"; //$NON-NLS-1$
public static final String MAX_CODE_TABLES = "MaxCodeTables"; //$NON-NLS-1$
@@ -43,7 +42,7 @@
public static final String USE_RESULTSET_CACHE = "ResultSetCacheEnabled"; //$NON-NLS-1$
public static final String RESULTSET_CACHE_SCOPE = "ResultSetCacheScope"; //$NON-NLS-1$
public static final String STREAMING_BATCH_SIZE = "metamatrix.server.streamingBatchSize"; //$NON-NLS-1$
- public static final String PROCESS_POOL_THREAD_TTL = "ProcessPoolThreadTTL"; //$NON-NLS-1$
+
public static final String PROCESS_POOL_MAX_THREADS = "ProcessPoolMaxThreads"; //$NON-NLS-1$
public static final String PROCESSOR_DEBUG_ALLOWED = "ProcessorDebugAllowed"; //$NON-NLS-1$
public static final String COMMAND_LOGGER_CLASSNAME = "metamatrix.server.commandLoggerClassname"; //$NON-NLS-1$
15 years, 8 months
teiid SVN: r803 - in trunk/adminshell/src/main: resources/commands and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-20 12:37:50 -0400 (Mon, 20 Apr 2009)
New Revision: 803
Modified:
trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java
trunk/adminshell/src/main/resources/commands/makeWorkspace.bsh
trunk/adminshell/src/main/resources/commands/printBanner.bsh
Log:
TEIID-398
Modified: trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java
===================================================================
--- trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java 2009-04-20 16:16:47 UTC (rev 802)
+++ trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java 2009-04-20 16:37:50 UTC (rev 803)
@@ -60,7 +60,8 @@
if (Capabilities.haveSwing() && gui) {
//bsh.util.Util.startSplashScreen();
- interpreter.eval("desktop()"); //$NON-NLS-1$
+ interpreter.eval("desktop()"); //$NON-NLS-1$
+ interpreter.getOut().flush();
} else {
interpreter.run();
}
Modified: trunk/adminshell/src/main/resources/commands/makeWorkspace.bsh
===================================================================
--- trunk/adminshell/src/main/resources/commands/makeWorkspace.bsh 2009-04-20 16:16:47 UTC (rev 802)
+++ trunk/adminshell/src/main/resources/commands/makeWorkspace.bsh 2009-04-20 16:37:50 UTC (rev 803)
@@ -31,6 +31,7 @@
SimpleParser mmparser = new SimpleParser();
this.console.setParser(mmparser);
interpreter.eval("importCommands(\"commands\")");
+ interpreter.eval("load(\"server\")"); //$NON-NLS-1$
mmparser.setInterpreter(this.interpreter);
// Ramesh Changes done
Modified: trunk/adminshell/src/main/resources/commands/printBanner.bsh
===================================================================
--- trunk/adminshell/src/main/resources/commands/printBanner.bsh 2009-04-20 16:16:47 UTC (rev 802)
+++ trunk/adminshell/src/main/resources/commands/printBanner.bsh 2009-04-20 16:37:50 UTC (rev 803)
@@ -30,6 +30,6 @@
print(" Note: Every comand MUST end with semi-colon [;] and are ");
print(" always in form 'command([param]*?);'");
print("**********************************************************************");
- print(" ");
+ print("\n\n");
}
}
15 years, 8 months