You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/05/02 18:12:18 UTC
[39/60] incubator-trafodion git commit: including the missing files
in previous commit
including the missing files in previous commit
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/500d2076
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/500d2076
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/500d2076
Branch: refs/heads/master
Commit: 500d20767fad083cc0fda1c1ef9d895b295ed412
Parents: 5ac5a9f
Author: Anuradha Hegde <an...@esgyn.com>
Authored: Mon Apr 18 16:35:58 2016 +0000
Committer: Anuradha Hegde <an...@esgyn.com>
Committed: Mon Apr 18 16:35:58 2016 +0000
----------------------------------------------------------------------
core/conn/jdbcT4/.gitignore | 2 +
core/conn/jdbcT4/Makefile | 38 +
core/conn/jdbcT4/pom.xml | 170 ++++
core/conn/jdbcT4/src/assembly/all.xml | 56 ++
.../CallableStatementSample.java | 83 ++
.../CallableStatementSample/IntegerSPJ.java | 28 +
.../main/samples/CallableStatementSample/README | 42 +
.../main/samples/DBMetaSample/DBMetaSample.java | 132 +++
.../jdbcT4/src/main/samples/DBMetaSample/README | 904 +++++++++++++++++++
.../PreparedStatementSample.java | 151 ++++
.../main/samples/PreparedStatementSample/README | 232 +++++
core/conn/jdbcT4/src/main/samples/README | 47 +
.../src/main/samples/ResultSetSample/README | 91 ++
.../ResultSetSample/ResultSetSample.java | 104 +++
.../src/main/samples/StatementSample/README | 92 ++
.../StatementSample/StatementSample.java | 104 +++
.../src/main/samples/common/sampleUtils.java | 268 ++++++
.../jdbcT4/src/main/samples/t4jdbc.properties | 26 +
.../java/org/trafodion/jdbc/t4/AppTest.java | 38 +
19 files changed, 2608 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/.gitignore
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/.gitignore b/core/conn/jdbcT4/.gitignore
new file mode 100644
index 0000000..6d90c7e
--- /dev/null
+++ b/core/conn/jdbcT4/.gitignore
@@ -0,0 +1,2 @@
+/target/
+build_jdbct4.log
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/Makefile
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/Makefile b/core/conn/jdbcT4/Makefile
new file mode 100644
index 0000000..b6c23d7
--- /dev/null
+++ b/core/conn/jdbcT4/Makefile
@@ -0,0 +1,38 @@
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+
+# This Makefile is just a thin shell to Maven, which is used to do the real build
+
+include ../../macros.gmk #top level
+
+all: build_all
+
+build_all:
+ echo "$(MAVEN) package -DskipTests"
+ set -o pipefail && $(MAVEN) package -DskipTests | tee build_jdbct4.log | grep --line-buffered -E -e '^\[[^WId]' -e '^\[INFO\] B[Uu][Ii][Ll][Dd]' -e 'to compile'
+ cp target/jdbcT4-${TRAFODION_VER}.jar ${MY_SQROOT}/export/lib/jdbcT4.jar
+ mkdir -p ../clients
+ mv target/jdbcT4-${TRAFODION_VER}.zip ../clients
+
+
+clean:
+ -$(MAVEN) clean | grep ERROR
+ $(RM) build_jdbct4.log ${MY_SQROOT}/export/lib/jdbcT4.jar
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/pom.xml
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/pom.xml b/core/conn/jdbcT4/pom.xml
new file mode 100644
index 0000000..e46ffd5
--- /dev/null
+++ b/core/conn/jdbcT4/pom.xml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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">
+
+<!--
+ @@@ START COPYRIGHT @@@
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+ @@@ END COPYRIGHT @@@
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.trafodion.jdbc.t4</groupId>
+ <artifactId>jdbcT4</artifactId>
+ <packaging>jar</packaging>
+ <version>${env.TRAFODION_VER}</version>
+ <name>Trafodion JDBC Type4 Driver</name>
+ <url>http://wiki.trafodion.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include> **/*.properties</include>
+ </includes>
+ </resource>
+ </resources>
+
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <configuration>
+ <tasks>
+ <copy file="src/main/java/org/trafodion/jdbc/t4/Vproc.java-tmpl" tofile="src/main/java/org/trafodion/jdbc/t4/Vproc.java"/>
+ <replace token= "@@@@"
+ value="Traf_JDBC_Type4_Build_${mvngit.commit.abbrev}"
+ file="src/main/java/org/trafodion/jdbc/t4/Vproc.java">
+ </replace>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.github.koraktor</groupId>
+ <artifactId>mavanagaiata</artifactId>
+ <version>0.7.2</version>
+ <configuration>
+ <dirtyFlag>false</dirtyFlag>
+ <dirtyIgnoreUntracked>false</dirtyIgnoreUntracked>
+ <gitDir>${project.base.dir}/../../../../.git</gitDir>
+ <dateFormat>ddMMMyyyy</dateFormat>
+ </configuration>
+ <executions>
+ <execution>
+ <id>git-commit</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>commit</goal>
+ <goal>branch</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.trafodion.jdbc.t4.Vproc</mainClass>
+ <classpathPrefix>dependency-jars/</classpathPrefix>
+ </manifest>
+ <manifestEntries>
+ <!-- <Implementation-Version-1>${TRAFODION_VER_PROD}</Implementation-Version-1> -->
+ <Implementation-Version-1>Version ${project.version}</Implementation-Version-1>
+ <Implementation-Version-2>Release ${project.version}</Implementation-Version-2>
+ <Implementation-Version-3>Build release</Implementation-Version-3>
+ <Implementation-Version-4>[${user.name}]</Implementation-Version-4>
+ <Implementation-Version-5>branch ${mvngit.commit.abbrev}-${mvngit.branch}</Implementation-Version-5>
+ <Implementation-Version-6>date ${maven.build.timestamp}</Implementation-Version-6>
+ <Product-Name>${project.name}</Product-Name>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.5.3</version>
+ <configuration>
+ <descriptor>src/assembly/all.xml</descriptor>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ <executions>
+ <execution>
+ <id>create-archive</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.5.1</version>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/dependency-jars/
+ </outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <maven.build.timestamp.format>ddMMMyy</maven.build.timestamp.format>
+ <buildDate>${maven.build.timestamp}</buildDate>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/assembly/all.xml
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/assembly/all.xml b/core/conn/jdbcT4/src/assembly/all.xml
new file mode 100644
index 0000000..5358510
--- /dev/null
+++ b/core/conn/jdbcT4/src/assembly/all.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+
+<!--
+ @@@ START COPYRIGHT @@@
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ @@@ END COPYRIGHT @@@
+-->
+ <!--This 'all' id is not appended to the produced bundle because we do this:
+ http://maven.apache.org/plugins/maven-assembly-plugin/faq.html#required-classifiers
+ -->
+ <id>all</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>${project.basedir}/NOTICE</include>
+ <include>${project.basedir}/LICENSE</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory>lib</outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+ <fileSet>
+ <directory>src/main/samples</directory>
+ <outputDirectory>samples</outputDirectory>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+ </fileSets>
+</assembly>
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/CallableStatementSample/CallableStatementSample.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/CallableStatementSample/CallableStatementSample.java b/core/conn/jdbcT4/src/main/samples/CallableStatementSample/CallableStatementSample.java
new file mode 100755
index 0000000..d96864d
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/CallableStatementSample/CallableStatementSample.java
@@ -0,0 +1,83 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+import common.*;
+
+import java.sql.*;
+public class CallableStatementSample
+{
+ public static void main(String args[]) throws Exception
+ {
+ try
+ {
+ Connection conn = sampleUtils.getPropertiesConnection();
+ Statement stmt = conn.createStatement();
+
+ try
+ {
+ String st = "drop procedure CallableStatementSample";
+ try {
+ stmt.executeUpdate(st);
+ } catch (Exception e) {}
+
+ st = "drop library qaspj";
+ try {
+ stmt.executeUpdate(st);
+ } catch (Exception e) {}
+
+
+ String path = System.getProperty("serverJarPath");
+
+ st = "create library qaspj file '" + path + "/qaspj.jar'";
+ stmt.executeUpdate(st);
+
+ st = "create procedure CallableStatementSample(out OUT_PARAM INTEGER) EXTERNAL NAME 'IntegerSPJ.Integer_Proc(int[])' LANGUAGE JAVA PARAMETER STYLE JAVA NO ISOLATE LIBRARY QASPJ";
+ stmt.executeUpdate(st);
+ stmt.close();
+ }
+ catch (SQLException e)
+ {
+ e.printStackTrace();
+ System.exit(0);
+ }
+
+
+ // get the CallableStatement object
+ CallableStatement cstmt = conn.prepareCall("{call CallableStatementSample(?)}");
+ //System.out.println("The Callable Statement " + cstmt);
+
+ //register the output parameters
+ cstmt.registerOutParameter(1, java.sql.Types.VARCHAR);
+
+ //execute the procedure
+ cstmt.execute();
+
+ //invoke getInt method
+ int nRetVal = cstmt.getInt(1);
+
+ System.out.println("Out parameter is " + cstmt.getInt(1));
+ }
+ catch(Exception ex)
+ {
+ System.err.println("Unexpected Exception" + ex.getMessage());
+ throw new Exception("Call to getWarnings is Failed!");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/CallableStatementSample/IntegerSPJ.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/CallableStatementSample/IntegerSPJ.java b/core/conn/jdbcT4/src/main/samples/CallableStatementSample/IntegerSPJ.java
new file mode 100755
index 0000000..1b64ee9
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/CallableStatementSample/IntegerSPJ.java
@@ -0,0 +1,28 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+public class IntegerSPJ
+{
+ public static void Integer_Proc (int[] out_param)
+ {
+
+ out_param[0] = 100;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/CallableStatementSample/README
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/CallableStatementSample/README b/core/conn/jdbcT4/src/main/samples/CallableStatementSample/README
new file mode 100755
index 0000000..3fdfa2b
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/CallableStatementSample/README
@@ -0,0 +1,42 @@
+This sample demonstrates the invocation of a stored procedure in Java (SPJ).
+
+
+Statement
+===========================================
+ "/tmp" is a server-side path where the SPJ jar files are located.
+
+
+Generate the jar file by running build.xml, which is located in the samples directory.
+===========================================
+ ant build.xml
+
+Copy the jar file to the system where your instance is running.
+===========================================
+ cp samples/target/qaspj.jar /tmp
+Note:
+ 1.The sample will create and drop the SPJ via the CREATE/DROP PROCEDURE statement by indirectly using qaspj.jar.
+ 2.The jar file must be copied to all nodes in a cluster environment.
+
+Compiling the Java files
+===========================================
+ On Windows Platform:
+ cd samples\CallableStatementSample
+ %JAVA_HOME%\bin\javac -classpath ..\..\lib\jdbcT4.jar *.java ..\common\*.java
+ On Linux:
+ cd samples/CallableStatementSample
+ $JAVA_HOME/bin/javac -classpath ../../lib/jdbcT4.jar *.java ../common/*.java
+Note: Make sure there are no compilation errors displayed on the screen.
+
+Executing CallableStatementSample
+===========================================
+ On Windows Platform:
+ cd samples\CallableStatementSample
+ %JAVA_HOME%\bin\java -classpath ..\..\lib\jdbcT4.jar;..;. -Dt4jdbc.properties=..\t4jdbc.properties -DserverJarPath=/tmp CallableStatementSample
+ On Linux:
+ cd samples/CallableStatementSample
+ $JAVA_HOME/bin/java -classpath ../../lib/jdbcT4.jar:..:. -Dt4jdbc.properties=../t4jdbc.properties -DserverJarPath=/tmp CallableStatementSample
+
+ A successful execution of the sample will produce output similar to the following:
+ <DATE, TIME> common.sampleUtils getPropertiesConnection
+ INFO: DriverManager.getConnection(url, props) passed
+ Out parameter is 100
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/DBMetaSample/DBMetaSample.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/DBMetaSample/DBMetaSample.java b/core/conn/jdbcT4/src/main/samples/DBMetaSample/DBMetaSample.java
new file mode 100755
index 0000000..8f0a2b7
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/DBMetaSample/DBMetaSample.java
@@ -0,0 +1,132 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+import common.*;
+
+import java.sql.*;
+import java.math.BigDecimal;
+
+public class DBMetaSample
+{
+ public static void main(String args[])
+ {
+
+ Connection connection;
+ Statement stmt;
+ PreparedStatement pStmt;
+ ResultSet rs;
+ DatabaseMetaData dbMeta;
+ int rowNo;
+ String table = "DBMETASAMPLE";
+
+ try
+ {
+ connection = sampleUtils.getPropertiesConnection();
+ sampleUtils.dropTable(connection, table);
+ sampleUtils.initialData(connection, table);
+ sampleUtils.initialCurrentData(connection, table);
+
+
+ System.out.println("");
+
+
+ for (int i = 0; i < 6; i++)
+ {
+ switch (i)
+ {
+ case 0:
+ System.out.println("");
+ System.out.println("getTypeInfo() ");
+ dbMeta = connection.getMetaData();
+ rs = dbMeta.getTypeInfo();
+ break;
+ case 2:
+ System.out.println("");
+ System.out.println("getCatalogs()");
+ dbMeta = connection.getMetaData();
+ rs = dbMeta.getCatalogs();
+ break;
+ case 3:
+ System.out.println("");
+ System.out.println("getTables() ");
+ dbMeta = connection.getMetaData();
+ rs = dbMeta.getTables(connection.getCatalog(), sampleUtils.props.getProperty("schema"), "DBMETASAMPLE", null);
+ break;
+ case 4:
+ System.out.println("");
+ System.out.println("getColumns()");
+ dbMeta = connection.getMetaData();
+ rs = dbMeta.getColumns(connection.getCatalog(), sampleUtils.props.getProperty("schema"), "DBMETASAMPLE", "C1");
+ break;
+ case 5:
+ System.out.println("");
+ System.out.println("getProcedures()");
+ dbMeta = connection.getMetaData();
+ rs = dbMeta.getProcedures(connection.getCatalog(), sampleUtils.props.getProperty("schema"), "Integer_Proc");
+ break;
+ default:
+ rs = null;
+ continue;
+ }
+
+ ResultSetMetaData rsMD = rs.getMetaData();
+ System.out.println("");
+ System.out.println("Printing ResultSetMetaData ...");
+ System.out.println("No. of Columns " + rsMD.getColumnCount());
+ for (int j = 1; j <= rsMD.getColumnCount(); j++)
+ {
+ System.out.println("Column " + j + " Data Type: " + rsMD.getColumnTypeName(j) + " Name: " + rsMD.getColumnName(j));
+ }
+ System.out.println("");
+ System.out.println("Fetching rows...");
+ rowNo = 0;
+ while (rs.next())
+ {
+ rowNo++;
+ System.out.println("");
+ System.out.println("Printing Row " + rowNo + " using getString(), getObject()");
+ for (int j=1; j <= rsMD.getColumnCount(); j++)
+ {
+ System.out.println("Column " + j + " - " + rs.getString(j) + "," + rs.getObject(j));
+ }
+
+ }
+ System.out.println("");
+ System.out.println("End of Data");
+ rs.close();
+ }
+
+ sampleUtils.dropTable(connection, table);
+ connection.close();
+ }
+ catch (SQLException e)
+ {
+ SQLException nextException;
+
+ nextException = e;
+ do
+ {
+ System.out.println(nextException.getMessage());
+ System.out.println("SQLState " + nextException.getSQLState());
+ System.out.println("Error Code " + nextException.getErrorCode());
+ } while ((nextException = nextException.getNextException()) != null);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/DBMetaSample/README
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/DBMetaSample/README b/core/conn/jdbcT4/src/main/samples/DBMetaSample/README
new file mode 100755
index 0000000..77dc3a3
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/DBMetaSample/README
@@ -0,0 +1,904 @@
+Compiling the Java files
+========================
+On Windows Platform:
+%JAVA_HOME%\bin\javac -classpath ..\..\lib\jdbcT4.jar *.java ..\common\*.java
+
+On Linux:
+$JAVA_HOME/bin/javac -classpath ../../lib/jdbcT4.jar *.java ../common/*.java
+
+Note: Make sure there are no compilation errors displayed on
+ the screen.
+
+
+Executing DBMetaSample
+======================
+On Windows Platform:
+%JAVA_HOME%\bin\java -classpath ..\..\lib\jdbcT4.jar;..;. -Dt4jdbc.properties=..\t4jdbc.properties DBMetaSample
+
+On Linux:
+$JAVA_HOME/bin/java -classpath ../../lib/jdbcT4.jar:..:. -Dt4jdbc.properties=../t4jdbc.properties DBMetaSample
+
+
+Output of the execution would look like:
+========================================
+<DATE, TIME> common.sampleUtils getPropertiesConnection
+INFO: DriverManager.getConnection(url, props) passed
+
+Inserting TimeStamp
+
+INFO: DriverManager.getConnection(url, props) passed
+
+Inserting TimeStamp
+
+
+getTypeInfo()
+
+Printing ResultSetMetaData ...
+No. of Columns 19
+Column 1 Data Type: VARCHAR Name: TYPE_NAME
+Column 2 Data Type: SMALLINT Name: DATA_TYPE
+Column 3 Data Type: INTEGER Name: PRECISION
+Column 4 Data Type: VARCHAR Name: LITERAL_PREFIX
+Column 5 Data Type: VARCHAR Name: LITERAL_SUFFIX
+Column 6 Data Type: VARCHAR Name: CREATE_PARAMS
+Column 7 Data Type: SMALLINT Name: NULLABLE
+Column 8 Data Type: SMALLINT Name: CASE_SENSITIVE
+Column 9 Data Type: SMALLINT Name: SEARCHABLE
+Column 10 Data Type: SMALLINT Name: UNSIGNED_ATTRIBUTE
+Column 11 Data Type: SMALLINT Name: FIXED_PREC_SCALE
+Column 12 Data Type: SMALLINT Name: AUTO_INCREMENT
+Column 13 Data Type: VARCHAR Name: LOCAL_TYPE_NAME
+Column 14 Data Type: SMALLINT Name: MINIMUM_SCALE
+Column 15 Data Type: SMALLINT Name: MAXIMUM_SCALE
+Column 16 Data Type: SMALLINT Name: SQL_DATA_TYPE
+Column 17 Data Type: SMALLINT Name: SQL_DATETIME_SUB
+Column 18 Data Type: SMALLINT Name: NUM_PREC_RADIX
+Column 19 Data Type: SMALLINT Name: INTERVAL_PRECISION
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - BIGINT,BIGINT
+Column 2 - -5,-5
+Column 3 - 19,19
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - LARGEINT,LARGEINT
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - -402,-402
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 2 using getString(), getObject()
+Column 1 - BIGINT SIGNED,BIGINT SIGNED
+Column 2 - -5,-5
+Column 3 - 19,19
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - LARGEINT,LARGEINT
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - -402,-402
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 3 using getString(), getObject()
+Column 1 - CHAR,CHAR
+Column 2 - 1,1
+Column 3 - 32000,32000
+Column 4 - ','
+Column 5 - ','
+Column 6 - max length,max length
+Column 7 - 1,1
+Column 8 - 1,1
+Column 9 - 3,3
+Column 10 - null,null
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - CHARACTER,CHARACTER
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 1,1
+Column 17 - null,null
+Column 18 - null,null
+Column 19 - null,null
+
+Printing Row 4 using getString(), getObject()
+Column 1 - NUMERIC,NUMERIC
+Column 2 - 2,2
+Column 3 - 128,128
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - precision,scale,precision,scale
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - NUMERIC,NUMERIC
+Column 14 - 0,0
+Column 15 - 128,128
+Column 16 - 2,2
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 5 using getString(), getObject()
+Column 1 - NUMERIC SIGNED,NUMERIC SIGNED
+Column 2 - 2,2
+Column 3 - 128,128
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - precision,scale,precision,scale
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - NUMERIC,NUMERIC
+Column 14 - 0,0
+Column 15 - 128,128
+Column 16 - 2,2
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 6 using getString(), getObject()
+Column 1 - NUMERIC UNSIGNED,NUMERIC UNSIGNED
+Column 2 - 2,2
+Column 3 - 128,128
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - precision,scale,precision,scale
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 1,1
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - NUMERIC,NUMERIC
+Column 14 - 0,0
+Column 15 - 128,128
+Column 16 - 2,2
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 7 using getString(), getObject()
+Column 1 - DECIMAL,DECIMAL
+Column 2 - 3,3
+Column 3 - 18,18
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - precision,scale,precision,scale
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - DECIMAL,DECIMAL
+Column 14 - 0,0
+Column 15 - 18,18
+Column 16 - 3,3
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 8 using getString(), getObject()
+Column 1 - DECIMAL SIGNED,DECIMAL SIGNED
+Column 2 - 3,3
+Column 3 - 18,18
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - precision,scale,precision,scale
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - DECIMAL,DECIMAL
+Column 14 - 0,0
+Column 15 - 18,18
+Column 16 - 3,3
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 9 using getString(), getObject()
+Column 1 - DECIMAL UNSIGNED,DECIMAL UNSIGNED
+Column 2 - 3,3
+Column 3 - 18,18
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - precision,scale,precision,scale
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 1,1
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - DECIMAL,DECIMAL
+Column 14 - 0,0
+Column 15 - 18,18
+Column 16 - -301,-301
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 10 using getString(), getObject()
+Column 1 - INTEGER,INTEGER
+Column 2 - 4,4
+Column 3 - 10,10
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - INTEGER,INTEGER
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 4,4
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 11 using getString(), getObject()
+Column 1 - INTEGER SIGNED,INTEGER SIGNED
+Column 2 - 4,4
+Column 3 - 10,10
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - INTEGER,INTEGER
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 4,4
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 12 using getString(), getObject()
+Column 1 - INTEGER UNSIGNED,INTEGER UNSIGNED
+Column 2 - 4,4
+Column 3 - 10,10
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 1,1
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - INTEGER,INTEGER
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - -401,-401
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 13 using getString(), getObject()
+Column 1 - SMALLINT,SMALLINT
+Column 2 - 5,5
+Column 3 - 5,5
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - SMALLINT,SMALLINT
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 5,5
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 14 using getString(), getObject()
+Column 1 - SMALLINT SIGNED,SMALLINT SIGNED
+Column 2 - 5,5
+Column 3 - 5,5
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - SMALLINT,SMALLINT
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 5,5
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 15 using getString(), getObject()
+Column 1 - SMALLINT UNSIGNED,SMALLINT UNSIGNED
+Column 2 - 5,5
+Column 3 - 5,5
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 1,1
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - SMALLINT,SMALLINT
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - -502,-502
+Column 17 - null,null
+Column 18 - 10,10
+Column 19 - null,null
+
+Printing Row 16 using getString(), getObject()
+Column 1 - FLOAT,FLOAT
+Column 2 - 6,6
+Column 3 - 15,15
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - FLOAT,FLOAT
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 6,6
+Column 17 - null,null
+Column 18 - 2,2
+Column 19 - null,null
+
+Printing Row 17 using getString(), getObject()
+Column 1 - REAL,REAL
+Column 2 - 7,7
+Column 3 - 7,7
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - REAL,REAL
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 7,7
+Column 17 - null,null
+Column 18 - 2,2
+Column 19 - null,null
+
+Printing Row 18 using getString(), getObject()
+Column 1 - DOUBLE PRECISION,DOUBLE PRECISION
+Column 2 - 8,8
+Column 3 - 15,15
+Column 4 - null,null
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - 0,0
+Column 13 - DOUBLE,DOUBLE
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 8,8
+Column 17 - null,null
+Column 18 - 2,2
+Column 19 - null,null
+
+Printing Row 19 using getString(), getObject()
+Column 1 - VARCHAR,VARCHAR
+Column 2 - 12,12
+Column 3 - 32000,32000
+Column 4 - ','
+Column 5 - ','
+Column 6 - max length,max length
+Column 7 - 1,1
+Column 8 - 1,1
+Column 9 - 3,3
+Column 10 - null,null
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - VARCHAR,VARCHAR
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 12,12
+Column 17 - null,null
+Column 18 - null,null
+Column 19 - null,null
+
+Printing Row 20 using getString(), getObject()
+Column 1 - DATE,DATE
+Column 2 - 91,91
+Column 3 - 10,10
+Column 4 - {d ',{d '
+Column 5 - '},'}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - null,null
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - DATE,DATE
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 9,9
+Column 17 - 1,1
+Column 18 - null,null
+Column 19 - null,null
+
+Printing Row 21 using getString(), getObject()
+Column 1 - TIME,TIME
+Column 2 - 92,92
+Column 3 - 8,8
+Column 4 - {t ',{t '
+Column 5 - '},'}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - null,null
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - TIME,TIME
+Column 14 - null,null
+Column 15 - null,null
+Column 16 - 9,9
+Column 17 - 2,2
+Column 18 - null,null
+Column 19 - null,null
+
+Printing Row 22 using getString(), getObject()
+Column 1 - TIMESTAMP,TIMESTAMP
+Column 2 - 93,93
+Column 3 - 26,26
+Column 4 - {ts ',{ts '
+Column 5 - '},'}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - null,null
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - TIMESTAMP,TIMESTAMP
+Column 14 - 0,0
+Column 15 - 6,6
+Column 16 - 9,9
+Column 17 - 3,3
+Column 18 - null,null
+Column 19 - null,null
+
+Printing Row 23 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 101,101
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' YEAR},' YEAR}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 1,1
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 24 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 102,102
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' MONTH},' MONTH}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 2,2
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 25 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 103,103
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' DAY},' DAY}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 3,3
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 26 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 104,104
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' HOUR},' HOUR}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 4,4
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 27 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 105,105
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' MINUTE},' MINUTE}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 5,5
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 28 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 106,106
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' SECOND},' SECOND}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 6,6
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 29 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 107,107
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' YEAR TO MONTH},' YEAR TO MONTH}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 7,7
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 30 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 108,108
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' DAY TO HOUR},' DAY TO HOUR}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 8,8
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 31 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 109,109
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' DAY TO MINUTE},' DAY TO MINUTE}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 9,9
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 32 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 110,110
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' DAY TO SECOND},' DAY TO SECOND}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 10,10
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 33 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 111,111
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' HOUR TO MINUTE},' HOUR TO MINUTE}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 11,11
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 34 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 112,112
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' HOUR TO SECOND},' HOUR TO SECOND}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 12,12
+Column 18 - null,null
+Column 19 - 2,2
+
+Printing Row 35 using getString(), getObject()
+Column 1 - INTERVAL,INTERVAL
+Column 2 - 113,113
+Column 3 - 0,0
+Column 4 - {INTERVAL ',{INTERVAL '
+Column 5 - ' MINUTE TO SECOND},' MINUTE TO SECOND}
+Column 6 - null,null
+Column 7 - 1,1
+Column 8 - 0,0
+Column 9 - 2,2
+Column 10 - 0,0
+Column 11 - 0,0
+Column 12 - null,null
+Column 13 - INTERVAL,INTERVAL
+Column 14 - 0,0
+Column 15 - 0,0
+Column 16 - 100,100
+Column 17 - 13,13
+Column 18 - null,null
+Column 19 - 2,2
+
+End of Data
+
+getCatalogs()
+
+Printing ResultSetMetaData ...
+No. of Columns 1
+Column 1 Data Type: VARCHAR Name: TABLE_CAT
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - TRAFODION,TRAFODION
+
+End of Data
+
+getTables()
+
+Printing ResultSetMetaData ...
+No. of Columns 10
+Column 1 Data Type: VARCHAR Name: TABLE_CAT
+Column 2 Data Type: VARCHAR Name: TABLE_SCHEM
+Column 3 Data Type: VARCHAR Name: TABLE_NAME
+Column 4 Data Type: VARCHAR Name: TABLE_TYPE
+Column 5 Data Type: VARCHAR Name: REMARKS
+Column 6 Data Type: VARCHAR Name: TYPE_CAT
+Column 7 Data Type: VARCHAR Name: TYPE_SCHEM
+Column 8 Data Type: VARCHAR Name: TYPE_NAME
+Column 9 Data Type: VARCHAR Name: SELF_REFERENCING_COL_NAME
+Column 10 Data Type: VARCHAR Name: REF_GENERATION
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - TRAFODION,TRAFODION
+Column 2 - SEABASE,SEABASE
+Column 3 - DBMETASAMPLE,DBMETASAMPLE
+Column 4 - TABLE,TABLE
+Column 5 - null,null
+Column 6 - null,null
+Column 7 - null,null
+Column 8 - null,null
+Column 9 - null,null
+Column 10 - null,null
+
+End of Data
+
+getColumns()
+
+Printing ResultSetMetaData ...
+No. of Columns 18
+Column 1 Data Type: VARCHAR Name: TABLE_CAT
+Column 2 Data Type: VARCHAR Name: TABLE_SCHEM
+Column 3 Data Type: VARCHAR Name: TABLE_NAME
+Column 4 Data Type: VARCHAR Name: COLUMN_NAME
+Column 5 Data Type: SMALLINT Name: DATA_TYPE
+Column 6 Data Type: VARCHAR Name: TYPE_NAME
+Column 7 Data Type: INTEGER Name: COLUMN_SIZE
+Column 8 Data Type: INTEGER Name: BUFFER_LENGTH
+Column 9 Data Type: SMALLINT Name: DECIMAL_DIGITS
+Column 10 Data Type: SMALLINT Name: NUM_PREC_RADIX
+Column 11 Data Type: SMALLINT Name: NULLABLE
+Column 12 Data Type: VARCHAR Name: REMARKS
+Column 13 Data Type: VARCHAR Name: COLUMN_DEF
+Column 14 Data Type: SMALLINT Name: SQL_DATA_TYPE
+Column 15 Data Type: SMALLINT Name: SQL_DATETIME_SUB
+Column 16 Data Type: INTEGER Name: CHAR_OCTET_LENGTH
+Column 17 Data Type: INTEGER Name: ORDINAL_POSITION
+Column 18 Data Type: VARCHAR Name: IS_NULLABLE
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - TRAFODION,TRAFODION
+Column 2 - SEABASE,SEABASE
+Column 3 - DBMETASAMPLE,DBMETASAMPLE
+Column 4 - C1,C1
+Column 5 - 1,1
+Column 6 - CHAR,CHAR
+Column 7 - 20,20
+Column 8 - 20,20
+Column 9 - 0,0
+Column 10 - null,null
+Column 11 - 2,2
+Column 12 - null,null
+Column 13 - ,
+Column 14 - 1,1
+Column 15 - null,null
+Column 16 - 20,20
+Column 17 - 1,1
+Column 18 - YES,YES
+
+End of Data
+
+getProcedures()
+
+Printing ResultSetMetaData ...
+No. of Columns 8
+Column 1 Data Type: VARCHAR Name: PROCEDURE_CAT
+Column 2 Data Type: VARCHAR Name: PROCEDURE_SCHEM
+Column 3 Data Type: VARCHAR Name: PROCEDURE_NAME
+Column 4 Data Type: SMALLINT Name: NUM_INPUT_PARAMS
+Column 5 Data Type: SMALLINT Name: NUM_OUTPUT_PARAMS
+Column 6 Data Type: SMALLINT Name: NUM_RESULT_SETS
+Column 7 Data Type: VARCHAR Name: REMARKS
+Column 8 Data Type: SMALLINT Name: PROCEDURE_TYPE
+
+Fetching rows...
+
+End of Data
+=======================================================
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/PreparedStatementSample/PreparedStatementSample.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/PreparedStatementSample/PreparedStatementSample.java b/core/conn/jdbcT4/src/main/samples/PreparedStatementSample/PreparedStatementSample.java
new file mode 100755
index 0000000..b086103
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/PreparedStatementSample/PreparedStatementSample.java
@@ -0,0 +1,151 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+import common.*;
+
+import java.sql.*;
+import java.math.BigDecimal;
+
+public class PreparedStatementSample
+{
+ public static void main(String args[])
+ {
+
+ Connection connection;
+ Statement stmt;
+ PreparedStatement pStmt;
+ ResultSet rs;
+ DatabaseMetaData dbMeta;
+ int rowNo;
+ String table = "PreparedStatementSample";
+
+ try
+ {
+ connection = sampleUtils.getPropertiesConnection();
+ sampleUtils.dropTable(connection, table);
+ sampleUtils.initialData(connection, table);
+ sampleUtils.initialCurrentData(connection, table);
+
+
+ for (int i = 0; i < 7; i++)
+ {
+ switch (i)
+ {
+ case 0:
+ System.out.println("");
+ System.out.println("Simple Select ");
+ stmt = connection.createStatement();
+ rs = stmt.executeQuery("select * from " + table);
+ break;
+ case 1:
+ System.out.println("");
+ System.out.println("Parameterized Select - CHAR");
+ pStmt = connection.prepareStatement("select c1, c2 from " + table + " where c1 = ?");
+ pStmt.setString(1, "Selva");
+ rs = pStmt.executeQuery();
+ break;
+ case 2:
+ System.out.println("");
+ System.out.println("Parameterized Select - INT");
+ pStmt = connection.prepareStatement("select c1, c2, c3 from " + table + " where c2 = ? or c2 = ?");
+ pStmt.setInt(1, 100);
+ pStmt.setInt(2, -100);
+ rs = pStmt.executeQuery();
+ break;
+ case 3:
+ System.out.println("");
+ System.out.println("Parameterized Select - TIMESTAMP");
+ pStmt = connection.prepareStatement("select c1, c2, c3, c10 from " + table + " where c10 = ?");
+ pStmt.setTimestamp(1, Timestamp.valueOf("2000-05-06 10:11:12.0"));
+ rs = pStmt.executeQuery();
+ break;
+ case 4:
+ System.out.println("");
+ System.out.println("Parameterized Select - DECIMAL");
+ pStmt = connection.prepareStatement("select c1, c2, c3, c7 from " + table + " where c7 = ? or c7 = ?");
+ pStmt.setBigDecimal(1, new BigDecimal("100.12"));
+ pStmt.setBigDecimal(2, new BigDecimal("-100.12"));
+ rs = pStmt.executeQuery();
+ break;
+ case 5:
+ System.out.println("");
+ System.out.println("Parameterized Select - NUMERIC");
+ pStmt = connection.prepareStatement("select c1, c2, c3, c6 from " + table + " where c6 = ? or c6 = ?");
+ pStmt.setBigDecimal(1, new BigDecimal("100.12"));
+ pStmt.setBigDecimal(2, new BigDecimal("-100.12"));
+ rs = pStmt.executeQuery();
+ break;
+ case 6:
+ System.out.println("");
+ System.out.println("Parameterized Select - DATE");
+ pStmt = connection.prepareStatement(
+ "select c11, c12 from " + table + " where c8 = ?");
+ pStmt.setDate(1, Date.valueOf("2000-05-06"));
+ rs = pStmt.executeQuery();
+ break;
+ default:
+ rs = null;
+ continue;
+ }
+
+ ResultSetMetaData rsMD = rs.getMetaData();
+ System.out.println("");
+ System.out.println("Printing ResultSetMetaData ...");
+ System.out.println("No. of Columns " + rsMD.getColumnCount());
+ for (int j = 1; j <= rsMD.getColumnCount(); j++)
+ {
+ System.out.println("Column " + j + " Data Type: " + rsMD.getColumnTypeName(j) + " Name: " + rsMD.getColumnName(j));
+ }
+ System.out.println("");
+ System.out.println("Fetching rows...");
+ rowNo = 0;
+ while (rs.next())
+ {
+ rowNo++;
+ System.out.println("");
+ System.out.println("Printing Row " + rowNo + " using getString(), getObject()");
+ for (int j=1; j <= rsMD.getColumnCount(); j++)
+ {
+ System.out.println("Column " + j + " - " + rs.getString(j) + "," + rs.getObject(j));
+ }
+
+ }
+ System.out.println("");
+ System.out.println("End of Data");
+ rs.close();
+ }
+
+ sampleUtils.dropTable(connection, table);
+ connection.close();
+ }
+ catch (SQLException e)
+ {
+ SQLException nextException;
+
+ nextException = e;
+ do
+ {
+ System.out.println(nextException.getMessage());
+ System.out.println("SQLState " + nextException.getSQLState());
+ System.out.println("Error Code " + nextException.getErrorCode());
+ } while ((nextException = nextException.getNextException()) != null);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/PreparedStatementSample/README
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/PreparedStatementSample/README b/core/conn/jdbcT4/src/main/samples/PreparedStatementSample/README
new file mode 100755
index 0000000..55c7252
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/PreparedStatementSample/README
@@ -0,0 +1,232 @@
+
+Compiling the Java files
+========================
+On Windows Platform:
+%JAVA_HOME%\bin\javac -classpath ..\..\lib\jdbcT4.jar *.java ..\common\*.java
+
+On Linux:
+$JAVA_HOME/bin/javac -classpath ../../lib/jdbcT4.jar *.java ../common/*.java
+
+Note: Make sure there are no compilation errors displayed on
+ the screen.
+
+
+Executing PreparedStatementSample
+=========================
+On Windows Platform:
+%JAVA_HOME%\bin\java -classpath ..\..\lib\jdbcT4.jar;..;. -Dt4jdbc.properties=..\t4jdbc.properties PreparedStatementSample
+
+On Linux:
+$JAVA_HOME/bin/java -classpath ../../lib/jdbcT4.jar:..:. -Dt4jdbc.properties=../t4jdbc.properties PreparedStatementSample
+
+
+Output of the execution would look like:
+========================================
+<DATE, TITME> common.sampleUtils getPropertiesConnection
+INFO: DriverManager.getConnection(url, props) passed
+
+Inserting TimeStamp
+
+Simple Select
+
+Printing ResultSetMetaData ...
+No. of Columns 12
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+Column 3 Data Type: INTEGER Name: C3
+Column 4 Data Type: BIGINT Name: C4
+Column 5 Data Type: VARCHAR Name: C5
+Column 6 Data Type: NUMERIC Name: C6
+Column 7 Data Type: DECIMAL Name: C7
+Column 8 Data Type: DATE Name: C8
+Column 9 Data Type: TIME Name: C9
+Column 10 Data Type: TIMESTAMP Name: C10
+Column 11 Data Type: REAL Name: C11
+Column 12 Data Type: DOUBLE PRECISION Name: C12
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - Row1 ,Row1
+Column 2 - 100,100
+Column 3 - 12345678,12345678
+Column 4 - 123456789012,123456789012
+Column 5 - Selva,Selva
+Column 6 - 100.12,100.12
+Column 7 - 100.12,100.12
+Column 8 - 2000-05-06,2000-05-06
+Column 9 - 10:11:12,10:11:12
+Column 10 - 2000-05-06 10:11:12.0,2000-05-06 10:11:12.0
+Column 11 - 100.12,100.12
+Column 12 - 100.12,100.12
+
+Printing Row 2 using getString(), getObject()
+Column 1 - Row2 ,Row2
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -123456789012,-123456789012
+Column 5 - Selva,Selva
+Column 6 - -100.12,-100.12
+Column 7 - -100.12,-100.12
+Column 8 - 2000-05-16,2000-05-16
+Column 9 - 10:11:12,10:11:12
+Column 10 - 2000-05-06 10:11:12.0,2000-05-06 10:11:12.0
+Column 11 - -100.12,-100.12
+Column 12 - -100.12,-100.12
+
+Printing Row 3 using getString(), getObject()
+Column 1 - TimeStamp ,TimeStamp
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -123456789012,-123456789012
+Column 5 - Selva,Selva
+Column 6 - -100.12,-100.12
+Column 7 - -100.12,-100.12
+Column 8 - 2004-04-14,2004-04-14
+Column 9 - 17:46:02,17:46:02
+Column 10 - 2004-04-14 17:46:02.74,2004-04-14 17:46:02.74
+Column 11 - -100.12,-100.12
+Column 12 - -100.12,-100.12
+
+End of Data
+
+Parameterized Select - CHAR
+
+Printing ResultSetMetaData ...
+No. of Columns 2
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+
+Fetching rows...
+
+End of Data
+
+Parameterized Select - INT
+
+Printing ResultSetMetaData ...
+No. of Columns 3
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+Column 3 Data Type: INTEGER Name: C3
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - Row1 ,Row1
+Column 2 - 100,100
+Column 3 - 12345678,12345678
+
+Printing Row 2 using getString(), getObject()
+Column 1 - Row2 ,Row2
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+
+Printing Row 3 using getString(), getObject()
+Column 1 - TimeStamp ,TimeStamp
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+
+End of Data
+
+Parameterized Select - TIMESTAMP
+
+Printing ResultSetMetaData ...
+No. of Columns 4
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+Column 3 Data Type: INTEGER Name: C3
+Column 4 Data Type: TIMESTAMP Name: C10
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - Row1 ,Row1
+Column 2 - 100,100
+Column 3 - 12345678,12345678
+Column 4 - 2000-05-06 10:11:12.0,2000-05-06 10:11:12.0
+
+Printing Row 2 using getString(), getObject()
+Column 1 - Row2 ,Row2
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - 2000-05-06 10:11:12.0,2000-05-06 10:11:12.0
+
+End of Data
+
+Parameterized Select - DECIMAL
+
+Printing ResultSetMetaData ...
+No. of Columns 4
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+Column 3 Data Type: INTEGER Name: C3
+Column 4 Data Type: DECIMAL Name: C7
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - Row1 ,Row1
+Column 2 - 100,100
+Column 3 - 12345678,12345678
+Column 4 - 100.12,100.12
+
+Printing Row 2 using getString(), getObject()
+Column 1 - Row2 ,Row2
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -100.12,-100.12
+
+Printing Row 3 using getString(), getObject()
+Column 1 - TimeStamp ,TimeStamp
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -100.12,-100.12
+
+End of Data
+
+Parameterized Select - NUMERIC
+
+Printing ResultSetMetaData ...
+No. of Columns 4
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+Column 3 Data Type: INTEGER Name: C3
+Column 4 Data Type: NUMERIC Name: C6
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - Row1 ,Row1
+Column 2 - 100,100
+Column 3 - 12345678,12345678
+Column 4 - 100.12,100.12
+
+Printing Row 2 using getString(), getObject()
+Column 1 - Row2 ,Row2
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -100.12,-100.12
+
+Printing Row 3 using getString(), getObject()
+Column 1 - TimeStamp ,TimeStamp
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -100.12,-100.12
+
+End of Data
+
+Parameterized Select - DATE
+
+Printing ResultSetMetaData ...
+No. of Columns 2
+Column 1 Data Type: REAL Name: C11
+Column 2 Data Type: DOUBLE PRECISION Name: C12
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - 100.12,100.12
+Column 2 - 100.12,100.12
+
+End of Data
+===============================================
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/README
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/README b/core/conn/jdbcT4/src/main/samples/README
new file mode 100755
index 0000000..916c8d2
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/README
@@ -0,0 +1,47 @@
+This is samples README file.
+
+To setup the enviornment
+========================
+ On UNIX platform:
+ 1. export JAVA_HOME=<java home on your system>
+
+ On WINDOWS platform command windows:
+ 1. set JAVA_HOME=<java home on your system>
+
+
+To Configure samples
+====================
+ Edit t4jdbc.properties file. Set the following values to your environment.
+
+ catalog : SQL catalog - must exist on the database
+ Please refer to the SQL documentation on how to create the catalog.
+ schema : SQL schema - must exist on the database
+ Please refer to the SQL documentation on how to create the schema.
+
+ Example of creating catalog/schema:
+ >>create catalog mycat;
+ >>create schema mycat.myschema;
+
+ user : Database user name
+ password : Database text password
+ url : jdbc:t4jdbc://<Database ip or name>:<port number where DCS is running>/:
+
+ Example of a t4jdbc.properties file:
+
+ catalog = CAT
+ schema = SCH
+ url = jdbc:t4jdbc://www.mymachine.net:61234/:
+ user = software.john
+ password = abcd
+
+
+
+To run the samples
+==================
+ Follow the README file instructions in the following directories.
+ 1. StatementSample
+ 2. PreparedStatementSample
+ 3. ResultSetSample
+ 4. DBMetaSample
+
+ NOTE: All samples create, populate and drop sample tables.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/ResultSetSample/README
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/ResultSetSample/README b/core/conn/jdbcT4/src/main/samples/ResultSetSample/README
new file mode 100755
index 0000000..5a1d99e
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/ResultSetSample/README
@@ -0,0 +1,91 @@
+Compiling the Java files
+========================
+On Windows Platform:
+%JAVA_HOME%\bin\javac -classpath ..\..\lib\jdbcT4.jar *.java ..\common\*.java
+
+On Linux:
+$JAVA_HOME/bin/javac -classpath ../../lib/jdbcT4.jar *.java ../common/*.java
+
+Note: Make sure there are no compilation errors displayed on
+ the screen.
+
+
+Executing ResultSetSample
+=========================
+On Windows Platform:
+%JAVA_HOME%\bin\java -classpath ..\..\lib\jdbcT4.jar;..;. -Dt4jdbc.properties=..\t4jdbc.properties ResultSetSample
+
+On Linux:
+$JAVA_HOME/bin/java -classpath ../../lib/jdbcT4.jar:..:. -Dt4jdbc.properties=../t4jdbc.properties ResultSetSample
+
+
+Output of the execution would look like:
+========================================
+<DATE, TIME> common.sampleUtils getPropertiesConnection
+INFO: DriverManager.getConnection(url, props) passed
+
+Inserting TimeStamp
+
+Simple Select
+
+Printing ResultSetMetaData ...
+No. of Columns 12
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+Column 3 Data Type: INTEGER Name: C3
+Column 4 Data Type: BIGINT Name: C4
+Column 5 Data Type: VARCHAR Name: C5
+Column 6 Data Type: NUMERIC Name: C6
+Column 7 Data Type: DECIMAL Name: C7
+Column 8 Data Type: DATE Name: C8
+Column 9 Data Type: TIME Name: C9
+Column 10 Data Type: TIMESTAMP Name: C10
+Column 11 Data Type: REAL Name: C11
+Column 12 Data Type: DOUBLE PRECISION Name: C12
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - Row1 ,Row1
+Column 2 - 100,100
+Column 3 - 12345678,12345678
+Column 4 - 123456789012,123456789012
+Column 5 - Selva,Selva
+Column 6 - 100.12,100.12
+Column 7 - 100.12,100.12
+Column 8 - 2000-05-06,2000-05-06
+Column 9 - 10:11:12,10:11:12
+Column 10 - 2000-05-06 10:11:12.0,2000-05-06 10:11:12.0
+Column 11 - 100.12,100.12
+Column 12 - 100.12,100.12
+
+Printing Row 2 using getString(), getObject()
+Column 1 - Row2 ,Row2
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -123456789012,-123456789012
+Column 5 - Selva,Selva
+Column 6 - -100.12,-100.12
+Column 7 - -100.12,-100.12
+Column 8 - 2000-05-16,2000-05-16
+Column 9 - 10:11:12,10:11:12
+Column 10 - 2000-05-06 10:11:12.0,2000-05-06 10:11:12.0
+Column 11 - -100.12,-100.12
+Column 12 - -100.12,-100.12
+
+Printing Row 3 using getString(), getObject()
+Column 1 - TimeStamp ,TimeStamp
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -123456789012,-123456789012
+Column 5 - Selva,Selva
+Column 6 - -100.12,-100.12
+Column 7 - -100.12,-100.12
+Column 8 - 2004-04-14,2004-04-14
+Column 9 - 16:19:47,16:19:47
+Column 10 - 2004-04-14 16:19:47.003,2004-04-14 16:19:47.003
+Column 11 - -100.12,-100.12
+Column 12 - -100.12,-100.12
+
+End of Data
+========================================
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/ResultSetSample/ResultSetSample.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/ResultSetSample/ResultSetSample.java b/core/conn/jdbcT4/src/main/samples/ResultSetSample/ResultSetSample.java
new file mode 100755
index 0000000..47b0b4c
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/ResultSetSample/ResultSetSample.java
@@ -0,0 +1,104 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+import common.*;
+
+import java.sql.*;
+import java.math.BigDecimal;
+
+public class ResultSetSample
+{
+ public static void main(String args[])
+ {
+
+ Connection connection;
+ Statement stmt;
+ PreparedStatement pStmt;
+ ResultSet rs;
+ DatabaseMetaData dbMeta;
+ int rowNo;
+ String table = "ResultSetSample";
+
+ try
+ {
+ connection = sampleUtils.getPropertiesConnection();
+ sampleUtils.dropTable(connection, table);
+ sampleUtils.initialData(connection, table);
+ sampleUtils.initialCurrentData(connection, table);
+
+ for (int i = 0; i < 10; i++)
+ {
+ switch (i)
+ {
+ case 0:
+ System.out.println("");
+ System.out.println("Simple Select ");
+ stmt = connection.createStatement();
+ rs = stmt.executeQuery("select * from " + table);
+ break;
+ default:
+ rs = null;
+ continue;
+ }
+
+ ResultSetMetaData rsMD = rs.getMetaData();
+ System.out.println("");
+ System.out.println("Printing ResultSetMetaData ...");
+ System.out.println("No. of Columns " + rsMD.getColumnCount());
+ for (int j = 1; j <= rsMD.getColumnCount(); j++)
+ {
+ System.out.println("Column " + j + " Data Type: " + rsMD.getColumnTypeName(j) + " Name: " + rsMD.getColumnName(j));
+ }
+ System.out.println("");
+ System.out.println("Fetching rows...");
+ rowNo = 0;
+ while (rs.next())
+ {
+ rowNo++;
+ System.out.println("");
+ System.out.println("Printing Row " + rowNo + " using getString(), getObject()");
+ for (int j=1; j <= rsMD.getColumnCount(); j++)
+ {
+ System.out.println("Column " + j + " - " + rs.getString(j) + "," + rs.getObject(j));
+ }
+
+ }
+ System.out.println("");
+ System.out.println("End of Data");
+ rs.close();
+ }
+
+ sampleUtils.dropTable(connection, table);
+ connection.close();
+ }
+ catch (SQLException e)
+ {
+ SQLException nextException;
+
+ nextException = e;
+ do
+ {
+ System.out.println(nextException.getMessage());
+ System.out.println("SQLState " + nextException.getSQLState());
+ System.out.println("Error Code " + nextException.getErrorCode());
+ } while ((nextException = nextException.getNextException()) != null);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/StatementSample/README
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/StatementSample/README b/core/conn/jdbcT4/src/main/samples/StatementSample/README
new file mode 100755
index 0000000..159f349
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/StatementSample/README
@@ -0,0 +1,92 @@
+Compiling the Java files
+========================
+On Windows Platform:
+%JAVA_HOME%\bin\javac -classpath ..\..\lib\jdbcT4.jar *.java ..\common\*.java
+
+On Linux:
+$JAVA_HOME/bin/javac -classpath ../../lib/jdbcT4.jar *.java ../common/*.java
+
+Note: Make sure there are no compilation errors displayed on
+ the screen.
+
+
+Executing StatementSample
+=========================
+On Windows Platform:
+%JAVA_HOME%\bin\java -classpath ..\..\lib\jdbcT4.jar;..;. -Dt4jdbc.properties=..\t4jdbc.properties StatementSample
+
+On Linux:
+$JAVA_HOME/bin/java -classpath ../../lib/jdbcT4.jar:..:. -Dt4jdbc.properties=../t4jdbc.properties StatementSample
+
+
+Output of the execution would look like:
+========================================
+
+<DATE, TIME> common.sampleUtils getPropertiesConnection
+INFO: DriverManager.getConnection(url, props) passed
+
+Inserting TimeStamp
+
+Simple Select
+
+Printing ResultSetMetaData ...
+No. of Columns 12
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+Column 3 Data Type: INTEGER Name: C3
+Column 4 Data Type: BIGINT Name: C4
+Column 5 Data Type: VARCHAR Name: C5
+Column 6 Data Type: NUMERIC Name: C6
+Column 7 Data Type: DECIMAL Name: C7
+Column 8 Data Type: DATE Name: C8
+Column 9 Data Type: TIME Name: C9
+Column 10 Data Type: TIMESTAMP Name: C10
+Column 11 Data Type: REAL Name: C11
+Column 12 Data Type: DOUBLE PRECISION Name: C12
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - Row1 ,Row1
+Column 2 - 100,100
+Column 3 - 12345678,12345678
+Column 4 - 123456789012,123456789012
+Column 5 - Selva,Selva
+Column 6 - 100.12,100.12
+Column 7 - 100.12,100.12
+Column 8 - 2000-05-06,2000-05-06
+Column 9 - 10:11:12,10:11:12
+Column 10 - 2000-05-06 10:11:12.0,2000-05-06 10:11:12.0
+Column 11 - 100.12,100.12
+Column 12 - 100.12,100.12
+
+Printing Row 2 using getString(), getObject()
+Column 1 - Row2 ,Row2
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -123456789012,-123456789012
+Column 5 - Selva,Selva
+Column 6 - -100.12,-100.12
+Column 7 - -100.12,-100.12
+Column 8 - 2000-05-16,2000-05-16
+Column 9 - 10:11:12,10:11:12
+Column 10 - 2000-05-06 10:11:12.0,2000-05-06 10:11:12.0
+Column 11 - -100.12,-100.12
+Column 12 - -100.12,-100.12
+
+Printing Row 3 using getString(), getObject()
+Column 1 - TimeStamp ,TimeStamp
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -123456789012,-123456789012
+Column 5 - Selva,Selva
+Column 6 - -100.12,-100.12
+Column 7 - -100.12,-100.12
+Column 8 - 2004-04-14,2004-04-14
+Column 9 - 15:43:36,15:43:36
+Column 10 - 2004-04-14 15:43:36.167,2004-04-14 15:43:36.167
+Column 11 - -100.12,-100.12
+Column 12 - -100.12,-100.12
+
+End of Data
+-------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/StatementSample/StatementSample.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/StatementSample/StatementSample.java b/core/conn/jdbcT4/src/main/samples/StatementSample/StatementSample.java
new file mode 100755
index 0000000..765d9d4
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/StatementSample/StatementSample.java
@@ -0,0 +1,104 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+import common.*;
+
+import java.sql.*;
+import java.math.BigDecimal;
+
+public class StatementSample
+{
+ public static void main(String args[])
+ {
+
+ Connection connection;
+ Statement stmt;
+ PreparedStatement pStmt;
+ ResultSet rs;
+ DatabaseMetaData dbMeta;
+ int rowNo;
+ String table = "StatementSample";
+
+ try
+ {
+ connection = sampleUtils.getPropertiesConnection();
+ sampleUtils.dropTable(connection, table);
+ sampleUtils.initialData(connection, table);
+ sampleUtils.initialCurrentData(connection, table);
+
+ for (int i = 0; i < 1; i++)
+ {
+ switch (i)
+ {
+ case 0:
+ System.out.println("");
+ System.out.println("Simple Select ");
+ stmt = connection.createStatement();
+ rs = stmt.executeQuery("select * from " + table);
+ break;
+ default:
+ rs = null;
+ continue;
+ }
+
+ ResultSetMetaData rsMD = rs.getMetaData();
+ System.out.println("");
+ System.out.println("Printing ResultSetMetaData ...");
+ System.out.println("No. of Columns " + rsMD.getColumnCount());
+ for (int j = 1; j <= rsMD.getColumnCount(); j++)
+ {
+ System.out.println("Column " + j + " Data Type: " + rsMD.getColumnTypeName(j) + " Name: " + rsMD.getColumnName(j));
+ }
+ System.out.println("");
+ System.out.println("Fetching rows...");
+ rowNo = 0;
+ while (rs.next())
+ {
+ rowNo++;
+ System.out.println("");
+ System.out.println("Printing Row " + rowNo + " using getString(), getObject()");
+ for (int j=1; j <= rsMD.getColumnCount(); j++)
+ {
+ System.out.println("Column " + j + " - " + rs.getString(j) + "," + rs.getObject(j));
+ }
+
+ }
+ System.out.println("");
+ System.out.println("End of Data");
+ rs.close();
+ }
+
+ sampleUtils.dropTable(connection, table);
+ connection.close();
+ }
+ catch (SQLException e)
+ {
+ SQLException nextException;
+
+ nextException = e;
+ do
+ {
+ System.out.println(nextException.getMessage());
+ System.out.println("SQLState " + nextException.getSQLState());
+ System.out.println("Error Code " + nextException.getErrorCode());
+ } while ((nextException = nextException.getNextException()) != null);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/common/sampleUtils.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/common/sampleUtils.java b/core/conn/jdbcT4/src/main/samples/common/sampleUtils.java
new file mode 100755
index 0000000..f234d28
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/common/sampleUtils.java
@@ -0,0 +1,268 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+package common;
+
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.PreparedStatement;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.util.*;
+import java.io.*;
+import java.util.logging.*;
+import java.net.*;
+
+
+public class sampleUtils
+{
+ static String url;
+ static String usr;
+ static String pwd;
+ public static Properties props;
+
+ //------------------------------------------------------------------------
+ static
+ {
+ try
+ {
+ String propFile = System.getProperty("t4jdbc.properties");
+ if (propFile != null)
+ {
+ FileInputStream fs = new FileInputStream(new File(propFile));
+ props = new Properties();
+ props.load(fs);
+
+ url = props.getProperty("url");
+ usr = props.getProperty("user");
+ pwd = props.getProperty("password");
+ } else {
+ System.out.println("Error: t4jdbc.properties is not set. Exiting.");
+ System.exit(0);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.out.println(e.getMessage());
+ }
+
+ try
+ {
+ Class.forName("org.trafodion.jdbc.t4.T4Driver");
+ Logger.global.setLevel(Level.FINEST);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.out.println(e.getMessage());
+ System.exit(0);
+ }
+ }
+
+ //------------------------------------------------------------------------
+ static void checkprops() throws SQLException
+ {
+ if (props == null)
+ throw new SQLException ("Error: t4jdbc.properties is null. Exiting.");
+ }
+
+ //------------------------------------------------------------------------
+ public static Connection getUserConnection() throws SQLException
+ {
+ Connection connection = null;
+ checkprops();
+
+ Logger.global.log(Level.FINE,"DriverManager.getConnection(url, usr, pwd)");
+ connection = DriverManager.getConnection(url, usr, pwd);
+ Logger.global.log(Level.INFO, "DriverManager.getConnection(url, usr, pwd) passed");
+ Logger.global.log(Level.FINE, "==============\n\n");
+
+ return connection;
+ }
+
+
+ //------------------------------------------------------------------------
+ public static Connection getPropertiesConnection() throws SQLException
+ {
+
+ Connection connection = null;
+ checkprops();
+
+ Logger.global.log(Level.FINE, "DriverManager.getConnection(url, props)");
+ Logger.global.log(Level.FINEST, "Properties = " + props);
+ connection = DriverManager.getConnection(url, props);
+ Logger.global.log(Level.INFO, "DriverManager.getConnection(url, props) passed");
+ Logger.global.log(Level.FINE, "==============\n\n");
+
+ return connection;
+ }
+
+ //------------------------------------------------------------------------
+ public static Connection getUrlConnection() throws SQLException
+ {
+ Connection connection = null;
+ checkprops();
+
+ Logger.global.log(Level.FINE, "DriverManager.getConnection(url)");
+ connection = DriverManager.getConnection(url);
+ Logger.global.log(Level.INFO, "DriverManager.getConnection(url) passed");
+ Logger.global.log(Level.FINE, "==============\n\n");
+
+ return connection;
+ }
+
+ //------------------------------------------------------------------------
+ public static Connection getUrlConnection(String newUrl) throws SQLException
+ {
+ Connection connection = null;
+ checkprops();
+
+ Logger.global.log(Level.FINE, "DriverManager.getConnection(newUrl) newUrl = " + newUrl);
+ connection = DriverManager.getConnection(newUrl);
+ Logger.global.log(Level.INFO, "DriverManager.getConnection(newUrl) passed mewUrl = " + newUrl);
+ Logger.global.log(Level.FINE, "==============\n\n");
+
+ return connection;
+ }
+
+ //------------------------------------------------------------------------
+ public static void main(String args[])
+ {
+
+ Connection connection, connection1, connection2;
+
+ try
+ {
+ connection = getUserConnection();
+ connection1 = getPropertiesConnection();
+ connection2 = getUrlConnection();
+
+ Logger.global.log(Level.INFO, "testing valid setCatalog");
+ connection.setCatalog("Velu");
+ Logger.global.log(Level.INFO, "testing valid setCatalog done");
+
+ Logger.global.log(Level.INFO, "testing invalid setTransactionIsolation");
+ connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+ Logger.global.log(Level.INFO, "testing invalid TransactionIsolation done");
+
+ Logger.global.log(Level.FINE, "testing connection.close for (url)");
+ connection.close();
+ Logger.global.log(Level.INFO, "testing connection.close for (url) passed");
+ Logger.global.log(Level.FINE, "==============\n\n");
+
+ Logger.global.log(Level.FINE, "testing connection.close for (url, usr, pwd)");
+ connection1.close();
+ Logger.global.log(Level.INFO, "testing connection.close for (url) passed");
+ Logger.global.log(Level.FINE, "==============\n\n");
+
+ Logger.global.log(Level.FINE, "testing connection.close for (url, info)");
+ connection2.close();
+ Logger.global.log(Level.INFO, "testing connection.close for (url) passed");
+ Logger.global.log(Level.FINE, "==============\n\n");
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public static void dropTable(Connection conn, String table)
+ {
+ Statement stmt = null;
+
+ try
+ {
+ stmt = conn.createStatement();
+ stmt.executeUpdate("drop table " + table);
+ }
+ catch (SQLException e)
+ {
+ Logger.global.log(Level.FINE, "Drop table failed for = " + table);
+ Logger.global.log(Level.FINE, "==============\n\n");
+ } finally {
+ try {
+ stmt.close();
+ } catch (Exception ex) {}
+ }
+ }
+
+ public static void initialData(Connection conn, String table) throws SQLException
+ {
+ Statement stmt = null;
+
+ try
+ {
+ stmt = conn.createStatement();
+ stmt.executeUpdate("create table " + table + " (c1 char(20), c2 smallint, c3 integer, c4 largeint, c5 varchar(120), c6 numeric(10,2), c7 decimal(10,2),c8 date, c9 time, c10 timestamp, c11 real, c12 double precision) NO PARTITION");
+
+ stmt.executeUpdate("insert into " + table + " values('Row1', 100, 12345678, 123456789012, 'Selva', 100.12, 100.12, {d '2000-05-06'}, {t '10:11:12'}, {ts '2000-05-06 10:11:12.0'}, 100.12, 100.12)");
+
+ stmt.executeUpdate("insert into " + table + " values('Row2', -100, -12345678, -123456789012, 'Selva', -100.12, -100.12, {d '2000-05-16'}, {t '10:11:12'}, {ts '2000-05-06 10:11:12'}, -100.12, -100.12)");
+ stmt.close();
+
+ }
+ catch (SQLException e)
+ {
+ Logger.global.log(Level.FINE, "InitialData failed = " + e);
+ Logger.global.log(Level.FINE, "==============\n\n");
+ try {
+ stmt.close();
+ } catch (Exception ex) {}
+ throw e;
+ }
+ }
+
+ public static void initialCurrentData(Connection conn, String table) throws SQLException
+ {
+ PreparedStatement pStmt = null;
+
+ try
+ {
+ System.out.println("");
+ System.out.println("Inserting TimeStamp ");
+ pStmt = conn.prepareStatement(
+ "insert into " + table + " values('TimeStamp', -100, -12345678, -123456789012, 'Selva', -100.12, -100.12, ?, ?, ?, -100.12, -100.12)"
+ );
+
+ pStmt.setDate(1, new Date(new java.util.Date().getTime()));
+ pStmt.setTime(2, new Time(new java.util.Date().getTime()));
+ Timestamp t1 = new Timestamp( (new java.util.Date()).getTime());
+ pStmt.setTimestamp(3, t1);
+ if (pStmt.executeUpdate() != 1)
+ {
+ System.out.println("executeUpdate of TimeStamp failed");
+ }
+ pStmt.close();
+
+ }
+ catch (SQLException e)
+ {
+ Logger.global.log(Level.FINE, "InitialCurrentData failed =" + e);
+ Logger.global.log(Level.FINE, "==============\n\n");
+ try {
+ pStmt.close();
+ } catch (Exception ex) {}
+ throw e;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/500d2076/core/conn/jdbcT4/src/main/samples/t4jdbc.properties
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/samples/t4jdbc.properties b/core/conn/jdbcT4/src/main/samples/t4jdbc.properties
new file mode 100755
index 0000000..d4c1f98
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/samples/t4jdbc.properties
@@ -0,0 +1,26 @@
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+
+catalog = TRAFODION
+schema = SCH
+url = jdbc:t4jdbc://server:port/:
+user = usr
+password = pwd