trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject [08/10] incubator-trafodion git commit: Merge branch 'master' of https://github.com/apache/incubator-trafodion
Date Thu, 15 Dec 2016 08:51:30 GMT
Merge branch 'master' of https://github.com/apache/incubator-trafodion


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/b4c7c814
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/b4c7c814
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/b4c7c814

Branch: refs/heads/master
Commit: b4c7c81488c5e6f867d3c3d8c5b9108209eee714
Parents: 0d467ca a61e6bc
Author: Eason <hfutmkby@gmail.com>
Authored: Fri Dec 9 12:39:57 2016 +0800
Committer: Eason <hfutmkby@gmail.com>
Committed: Fri Dec 9 12:39:57 2016 +0800

----------------------------------------------------------------------
 .rat-excludes                                   |    3 +-
 core/Makefile                                   |    6 +-
 core/conn/odbc/src/odbc/Common/QSData.cpp       |   17 +
 core/conn/odbc/src/odbc/Common/QSData.h         |   33 +
 core/conn/trafci/.gitignore                     |    6 +
 core/conn/trafci/Makefile                       |   37 +
 core/conn/trafci/install/Installer.java         | 3389 --------------
 core/conn/trafci/install/Installer.java-tmpl    | 3389 ++++++++++++++
 core/conn/trafci/installer_pom.xml              |  106 +
 core/conn/trafci/pom.xml                        |  114 +
 .../org/trafodion/ci/AWTExceptionHandler.java   |   36 +
 .../main/java/org/trafodion/ci/CSVDisplay.java  |   90 +
 .../src/main/java/org/trafodion/ci/Column.java  |  131 +
 .../java/org/trafodion/ci/ConditionalQuery.java |  435 ++
 .../trafodion/ci/ConditionalQueryException.java |   43 +
 .../trafodion/ci/ConditionalSyntaxError.java    |  123 +
 .../java/org/trafodion/ci/ConsoleReader.java    |  218 +
 .../java/org/trafodion/ci/ConsoleWriter.java    |  130 +
 .../java/org/trafodion/ci/DatabaseQuery.java    | 1804 ++++++++
 .../src/main/java/org/trafodion/ci/Display.java |   68 +
 .../trafodion/ci/DuplicateParamException.java   |   40 +
 .../main/java/org/trafodion/ci/ErrorObject.java |  103 +
 .../src/main/java/org/trafodion/ci/FCQuery.java |  334 ++
 .../main/java/org/trafodion/ci/FileReader.java  |  176 +
 .../main/java/org/trafodion/ci/FileWriter.java  |   80 +
 .../main/java/org/trafodion/ci/HTMLDisplay.java |   80 +
 .../main/java/org/trafodion/ci/HTMLObject.java  |  628 +++
 .../main/java/org/trafodion/ci/HelpIndexer.java |  134 +
 .../src/main/java/org/trafodion/ci/Helper.java  |  225 +
 .../main/java/org/trafodion/ci/HostQuery.java   |  289 ++
 .../main/java/org/trafodion/ci/IDisplay.java    |   28 +
 .../main/java/org/trafodion/ci/IndexStruct.java |   55 +
 .../java/org/trafodion/ci/InterfaceQuery.java   | 4378 ++++++++++++++++++
 .../trafodion/ci/InterfaceQueryException.java   |   35 +
 .../org/trafodion/ci/InterfaceSyntaxError.java  |   83 +
 .../trafodion/ci/InvalidNumberOfArguments.java  |   35 +
 .../main/java/org/trafodion/ci/JDBCVproc.java   |   38 +
 .../java/org/trafodion/ci/LFProperties.java     |  130 +
 .../java/org/trafodion/ci/MaskingThread.java    |   73 +
 .../java/org/trafodion/ci/MultiByteUtils.java   |   56 +
 .../org/trafodion/ci/NullKeyWordException.java  |   35 +
 .../org/trafodion/ci/OutputColumnAttribute.java |   47 +
 .../java/org/trafodion/ci/OutputContents.java   |  144 +
 .../main/java/org/trafodion/ci/ParallelRun.java | 1320 ++++++
 .../org/trafodion/ci/ParamStringObject.java     |  256 +
 .../java/org/trafodion/ci/ParseArguments.java   |  660 +++
 .../src/main/java/org/trafodion/ci/Parser.java  | 1195 +++++
 .../ci/ParserMissingParamException.java         |   42 +
 .../trafciDefaultLookAndFeel.properties         |   60 +
 .../main/java/org/trafodion/ci/PrunSummary.java |  119 +
 .../org/trafodion/ci/PrunUserInterruption.java  |   34 +
 .../java/org/trafodion/ci/PythonInterface.java  |  180 +
 .../src/main/java/org/trafodion/ci/Query.java   |  188 +
 .../main/java/org/trafodion/ci/QueryUtils.java  |   37 +
 .../java/org/trafodion/ci/QueryWrapper.java     |  700 +++
 .../main/java/org/trafodion/ci/RawDisplay.java  |  189 +
 .../src/main/java/org/trafodion/ci/Reader.java  |  286 ++
 .../java/org/trafodion/ci/RepObjInterface.java  |   27 +
 .../java/org/trafodion/ci/ReplacementObj.java   |   39 +
 .../org/trafodion/ci/ScriptSectionNotFound.java |   34 +
 .../java/org/trafodion/ci/ScriptsInterface.java |  153 +
 .../src/main/java/org/trafodion/ci/Session.java | 1908 ++++++++
 .../java/org/trafodion/ci/SessionDefaults.java  |  342 ++
 .../java/org/trafodion/ci/SessionError.java     |  181 +
 .../java/org/trafodion/ci/SessionInterface.java | 1487 ++++++
 .../org/trafodion/ci/SessionTimeoutTask.java    |   93 +
 .../src/main/java/org/trafodion/ci/SqlEnum.java |   83 +
 .../java/org/trafodion/ci/StatusThread.java     |  100 +
 .../org/trafodion/ci/TerminalProcessBridge.java |  246 +
 .../trafodion/ci/UnKnownInterfaceCommand.java   |   34 +
 .../java/org/trafodion/ci/UserInterface.java    |  421 ++
 .../java/org/trafodion/ci/UserInterruption.java |   36 +
 .../src/main/java/org/trafodion/ci/Utils.java   |  381 ++
 .../java/org/trafodion/ci/ValidateQuery.java    |  412 ++
 .../org/trafodion/ci/ValidationException.java   |   39 +
 .../main/java/org/trafodion/ci/Vproc.java-tmpl  |   36 +
 .../main/java/org/trafodion/ci/WCIUtils.java    |  122 +
 .../src/main/java/org/trafodion/ci/Writer.java  |  418 ++
 .../main/java/org/trafodion/ci/XMLDisplay.java  |   75 +
 .../main/java/org/trafodion/ci/XMLObject.java   |  607 +++
 .../org/trafodion/ci/help/common_common.help    |  457 ++
 .../java/org/trafodion/ci/help/help_file.idx    |   30 +
 .../java/org/trafodion/ci/help/sql_common.help  |  376 ++
 .../org/trafodion/ci/pwdencrypt/ArgMap.java     |   61 +
 .../org/trafodion/ci/pwdencrypt/ArgsDef.java    |   74 +
 .../trafodion/ci/pwdencrypt/EncryptUtil.java    |  249 +
 .../java/org/trafodion/ci/pwdencrypt/JCE.java   |  414 ++
 .../trafodion/ci/pwdencrypt/PasswordOpts.java   |  292 ++
 .../org/trafodion/ci/pwdencrypt/RefLookup.java  |  127 +
 .../org/trafodion/ci/pwdencrypt/WorkTypes.java  |   55 +
 .../trafci/src/main/resources/install_jar.xml   |   71 +
 .../trafci/src/main/resources/install_tar.xml   |   51 +
 .../trafci/src/main/resources/trafci.properties |    5 +
 .../org/trafodion/ci/AWTExceptionHandler.java   |   36 -
 .../trafci/src/org/trafodion/ci/CSVDisplay.java |   90 -
 .../trafci/src/org/trafodion/ci/Column.java     |  131 -
 .../src/org/trafodion/ci/ConditionalQuery.java  |  435 --
 .../trafodion/ci/ConditionalQueryException.java |   43 -
 .../trafodion/ci/ConditionalSyntaxError.java    |  123 -
 .../src/org/trafodion/ci/ConsoleReader.java     |  218 -
 .../src/org/trafodion/ci/ConsoleWriter.java     |  130 -
 .../src/org/trafodion/ci/DatabaseQuery.java     | 1804 --------
 .../trafci/src/org/trafodion/ci/Display.java    |   68 -
 .../trafodion/ci/DuplicateParamException.java   |   40 -
 .../src/org/trafodion/ci/ErrorObject.java       |  103 -
 .../trafci/src/org/trafodion/ci/FCQuery.java    |  334 --
 .../trafci/src/org/trafodion/ci/FileReader.java |  176 -
 .../trafci/src/org/trafodion/ci/FileWriter.java |   80 -
 .../src/org/trafodion/ci/HTMLDisplay.java       |   80 -
 .../trafci/src/org/trafodion/ci/HTMLObject.java |  628 ---
 .../src/org/trafodion/ci/HelpIndexer.java       |  134 -
 .../trafci/src/org/trafodion/ci/Helper.java     |  225 -
 .../trafci/src/org/trafodion/ci/HostQuery.java  |  289 --
 .../trafci/src/org/trafodion/ci/IDisplay.java   |   28 -
 .../src/org/trafodion/ci/IndexStruct.java       |   55 -
 .../src/org/trafodion/ci/InterfaceQuery.java    | 4378 ------------------
 .../trafodion/ci/InterfaceQueryException.java   |   35 -
 .../org/trafodion/ci/InterfaceSyntaxError.java  |   83 -
 .../trafodion/ci/InvalidNumberOfArguments.java  |   35 -
 .../trafci/src/org/trafodion/ci/JDBCVproc.java  |   38 -
 .../src/org/trafodion/ci/LFProperties.java      |  130 -
 .../src/org/trafodion/ci/MaskingThread.java     |   73 -
 .../src/org/trafodion/ci/MultiByteUtils.java    |   56 -
 .../org/trafodion/ci/NullKeyWordException.java  |   35 -
 .../org/trafodion/ci/OutputColumnAttribute.java |   47 -
 .../src/org/trafodion/ci/OutputContents.java    |  144 -
 .../src/org/trafodion/ci/ParallelRun.java       | 1320 ------
 .../src/org/trafodion/ci/ParamStringObject.java |  256 -
 .../src/org/trafodion/ci/ParseArguments.java    |  660 ---
 .../trafci/src/org/trafodion/ci/Parser.java     | 1195 -----
 .../ci/ParserMissingParamException.java         |   42 -
 .../trafciDefaultLookAndFeel.properties         |   60 -
 .../src/org/trafodion/ci/PrunSummary.java       |  119 -
 .../org/trafodion/ci/PrunUserInterruption.java  |   34 -
 .../src/org/trafodion/ci/PythonInterface.java   |  180 -
 .../conn/trafci/src/org/trafodion/ci/Query.java |  188 -
 .../trafci/src/org/trafodion/ci/QueryUtils.java |   37 -
 .../src/org/trafodion/ci/QueryWrapper.java      |  700 ---
 .../trafci/src/org/trafodion/ci/RawDisplay.java |  189 -
 .../trafci/src/org/trafodion/ci/Reader.java     |  286 --
 .../src/org/trafodion/ci/RepObjInterface.java   |   27 -
 .../src/org/trafodion/ci/ReplacementObj.java    |   39 -
 .../org/trafodion/ci/ScriptSectionNotFound.java |   34 -
 .../src/org/trafodion/ci/ScriptsInterface.java  |  153 -
 .../trafci/src/org/trafodion/ci/Session.java    | 1908 --------
 .../src/org/trafodion/ci/SessionDefaults.java   |  342 --
 .../src/org/trafodion/ci/SessionError.java      |  181 -
 .../src/org/trafodion/ci/SessionInterface.java  | 1487 ------
 .../org/trafodion/ci/SessionTimeoutTask.java    |   93 -
 .../trafci/src/org/trafodion/ci/SqlEnum.java    |   83 -
 .../src/org/trafodion/ci/StatusThread.java      |  100 -
 .../org/trafodion/ci/TerminalProcessBridge.java |  246 -
 .../trafodion/ci/UnKnownInterfaceCommand.java   |   34 -
 .../src/org/trafodion/ci/UserInterface.java     |  421 --
 .../src/org/trafodion/ci/UserInterruption.java  |   36 -
 .../conn/trafci/src/org/trafodion/ci/Utils.java |  381 --
 .../src/org/trafodion/ci/ValidateQuery.java     |  412 --
 .../org/trafodion/ci/ValidationException.java   |   39 -
 .../conn/trafci/src/org/trafodion/ci/Vproc.java |   36 -
 .../trafci/src/org/trafodion/ci/WCIUtils.java   |  122 -
 .../trafci/src/org/trafodion/ci/Writer.java     |  418 --
 .../trafci/src/org/trafodion/ci/XMLDisplay.java |   75 -
 .../trafci/src/org/trafodion/ci/XMLObject.java  |  607 ---
 .../org/trafodion/ci/help/common_common.help    |  457 --
 .../src/org/trafodion/ci/help/help_file.idx     |   30 -
 .../src/org/trafodion/ci/help/sql_common.help   |  376 --
 .../src/org/trafodion/ci/pwdencrypt/ArgMap.java |   61 -
 .../org/trafodion/ci/pwdencrypt/ArgsDef.java    |   74 -
 .../trafodion/ci/pwdencrypt/EncryptUtil.java    |  249 -
 .../src/org/trafodion/ci/pwdencrypt/JCE.java    |  414 --
 .../trafodion/ci/pwdencrypt/PasswordOpts.java   |  292 --
 .../org/trafodion/ci/pwdencrypt/RefLookup.java  |  127 -
 .../org/trafodion/ci/pwdencrypt/WorkTypes.java  |   55 -
 .../org/trafodion/ci/UserInterfaceTest.java     |  116 +
 core/sqf/sql/scripts/analyzeMessageGuide.py     |  656 +++
 core/sqf/src/seatrans/hbase-trx/pp.awk          |  152 +-
 .../sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp |  212 +-
 .../tm/hbasetmlib2/javaobjectinterfacetm.cpp    |  103 +-
 .../tm/hbasetmlib2/javaobjectinterfacetm.h      |   11 +-
 core/sqf/src/tm/macros.gmk                      |    2 +-
 core/sqf/sysinstall/etc/init.d/trafodion        |  131 +
 core/sql/bin/SqlciErrors.txt                    |   28 +-
 core/sql/common/ComJSON.cpp                     | 1175 +++++
 core/sql/common/ComJSON.h                       |  159 +
 core/sql/common/ComJSONFuncs.cpp                |  793 ++++
 core/sql/common/ComJSONStringInfo.cpp           |  297 ++
 core/sql/common/ComJSONStringInfo.h             |  176 +
 core/sql/common/NAString.cpp                    |    1 +
 core/sql/common/OperTypeEnum.h                  |    2 +
 core/sql/exp/ExpErrorEnums.h                    |   16 +
 core/sql/exp/ExpPackDefs.cpp                    |    6 +
 core/sql/exp/exp_clause.cpp                     |    9 +
 core/sql/exp/exp_clause.h                       |    3 +-
 core/sql/exp/exp_function.cpp                   |  105 +
 core/sql/exp/exp_function.h                     |   22 +
 core/sql/generator/GenItemFunc.cpp              |    7 +
 core/sql/nskgmake/common/Makefile               |    3 +
 core/sql/optimizer/BindItemExpr.cpp             |    5 +-
 core/sql/optimizer/ItemExpr.cpp                 |   14 +-
 core/sql/optimizer/SynthType.cpp                |   24 +
 core/sql/parser/ParKeyWords.cpp                 |    3 +-
 core/sql/parser/sqlparser.y                     |    7 +
 core/sql/sqlcomp/CmpDDLCatErrorCodes.h          |   12 +-
 dcs/src/test/odbc/README.txt                    |   47 +
 dcs/src/test/odbc/build/Makefile                |   43 +
 dcs/src/test/odbc/build/odbc.vcxproj            |  157 +
 dcs/src/test/odbc/build/odbc.vcxproj.filters    |   40 +
 dcs/src/test/odbc/src/Main.cpp                  |   57 +
 dcs/src/test/odbc/src/common/Global.cpp         |  116 +
 dcs/src/test/odbc/src/common/Global.h           |   60 +
 dcs/src/test/odbc/src/common/TestBase.cpp       |  263 ++
 dcs/src/test/odbc/src/common/TestBase.h         |   55 +
 .../src/test/varchar32k/LargeVarcharCol.cpp     | 2639 +++++++++++
 .../odbc/src/test/varchar32k/LargeVarcharCol.h  |   52 +
 .../src/asciidoc/_chapters/ddl_msgs.adoc        |  181 +-
 install/python-installer/traf_setup.py          |    3 +
 licenses/lic-server-src                         |   29 +-
 217 files changed, 36511 insertions(+), 28666 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b4c7c814/core/Makefile
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b4c7c814/core/conn/trafci/src/main/java/org/trafodion/ci/UserInterface.java
----------------------------------------------------------------------
diff --cc core/conn/trafci/src/main/java/org/trafodion/ci/UserInterface.java
index 0000000,ac22141..0638b79
mode 000000,100644..100644
--- a/core/conn/trafci/src/main/java/org/trafodion/ci/UserInterface.java
+++ b/core/conn/trafci/src/main/java/org/trafodion/ci/UserInterface.java
@@@ -1,0 -1,421 +1,421 @@@
+ // @@@ 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 org.trafodion.ci;
+ 
+ import java.io.File;
+ import java.io.FileInputStream;
+ import java.io.FileNotFoundException;
+ import java.io.IOException;
+ import java.net.UnknownHostException;
+ import java.sql.SQLException;
+ import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Enumeration;
+ import java.util.List;
+ import java.util.Properties;
+ 
+ import org.trafodion.ci.pwdencrypt.RefLookup;
+ 
+ 
+ public class UserInterface {
+ 
+ 	static String[] myArgs = null;
+ 
+ 	/**
+ 	 * Main program called when the user logins using the windows/*nux wrapper
+ 	 * scripts. Creates a console reader & console write for interactive
+ 	 * input/output from the user.
+ 	 */
+ 	public static void main(String[] args) {
+ 		// create the console reader and writer objects
+ 		// for interactive session
+ 		ConsoleReader crObj = null;
+ 		ConsoleWriter cwObj = null;
+ 		myArgs = args;
+ 		int exitCode = 0;
+ 		boolean doTrace = Boolean.getBoolean(SessionDefaults.PROP_TRACE);
 -		String mySQRoot = System.getenv("MY_SQROOT");
++		String mySQRoot = System.getenv("TRAF_HOME");
+ 		
+ 
+ 
+ 		/* handle AWT exceptions */
+ 		try {
+ 			Class.forName("org.trafodion.ci.AWTExceptionHandler");
+ 			System.setProperty("sun.awt.exception.handler",
+ 					AWTExceptionHandler.class.getName());
+ 		} catch (Throwable t) {
+ 			if (doTrace)
+ 				t.printStackTrace();
+ 		}
+ 
+ 		cwObj = new ConsoleWriter();
+ 
+ 		try {
+ 			cwObj.initialize();
+ 		} catch (IOException e1) {
+ 			System.out.println(SessionError.CONSOLE_WRITER_ERR.errorMessage()
+ 					+ e1);
+ 			if (doTrace)
+ 				e1.printStackTrace();
+ 			System.exit(SessionDefaults.abruptExit);
+ 		}
+ 		crObj = new ConsoleReader();
+ 
+ 		try {
+ 			crObj.initialize();
+ 		} catch (IOException e1) {
+ 			System.out.println(SessionError.CONSOLE_READER_ERR.errorMessage()
+ 					+ e1);
+ 			if (doTrace)
+ 				e1.printStackTrace();
+ 			System.exit(SessionDefaults.abruptExit);
+ 		}
+ 
+ 		banner();
+         
+ 		// parse the arguments
+ 		ParseArguments paObj = new ParseArguments(crObj, cwObj);
+ 
+ 		// set default value to rolename
+ 		paObj.roleName = "";
+ 
+ 		paObj.setDefaults(SessionDefaults.dsnName, SessionDefaults.portNumber);
+ 
+ 		
+ 		if ( args.length %2 == 0 && mySQRoot != null && new File(mySQRoot).exists())
{
+ 			String uname=null, passwd = null, hostname = null, portNumber = null;
+ 			//EncryptUtil eu = new EncryptUtil();
+ 			Properties p = new Properties();
+ 			String matchedValue = null;
+ 			List<String> argsList= new ArrayList<String>(Arrays.asList(args));
+ 			int argLength=argsList.size();
+ 
+ 			for (int i=0;i < argLength; i++)
+ 		    {
+ 		         String option=args[i++].trim();
+ 		         String value=args[i].trim();
+ 		         
+ 		         if (option.equalsIgnoreCase("-u")|| option.equalsIgnoreCase("-user"))
+ 		         {
+ 		            uname=value;
+ 		         }
+ 		         else if (option.equalsIgnoreCase("-p")|| option.equalsIgnoreCase("-password"))
+ 		         {
+ 		            passwd=value;
+ 		         }
+ 		         else if (option.equalsIgnoreCase("-h")|| option.equalsIgnoreCase("-host"))
+ 		         {
+ 		            String[] hostAddr=value.split(":");
+ 		            if (hostAddr.length > 0)
+ 		            	hostname=hostAddr[0];
+ 		            
+ 		            String portValue="";
+ 
+ 		            for (int j=1; j < hostAddr.length;j++)
+ 		            {
+ 		               portValue+=":"+hostAddr[j];
+ 		            }
+ 		            if (portValue.length() > 0)
+ 		            {
+ 		               portNumber=portValue;
+ 		            }
+ 
+ 		         }
+ 		    }
+ 			
+ 			try 
+ 			{
+ 				
+ 				if (uname != null)
+ 				{
+ 					paObj.userName = uname;
+ 				}
+ 				else
+ 				{
+ 					paObj.userName = System.getProperty("user.name");
+ 				}
+ 				
+ 				if (passwd != null)
+ 				{
+ 					paObj.password = passwd;
+ 				}
+ 				else
+ 				{
+ 					String userHome =  System.getenv("USERHOME");//System.getProperty("user.dir");				
+ 					if (userHome != null)
+ 					{					
+ 						File f = new File(userHome + "/.trafciconf/encprops.txt");
+ 						if (f.exists())
+ 						{
+ 							try
+ 							{
+ 								p.load(new FileInputStream(f));
+ 								Enumeration<?> enumKeys = p.keys();
+ 								while (enumKeys.hasMoreElements())
+ 							      {
+ 									uname=enumKeys.nextElement().toString();
+ 									if (uname.equals(paObj.userName)){
+ 										matchedValue = p.getProperty(uname);
+ 										if (matchedValue != null)
+ 										{
+ 											passwd = RefLookup.resolve(uname+" = "+matchedValue);
+ 											break;
+ 										}
+ 									}
+ 							      }
+ 								
+ 								paObj.password = passwd;
+ 							}
+ 							catch(Exception e)
+ 							{
+ 								System.out.println("Error looking up user's password.");
+ 								if (doTrace)
+ 								{
+ 									System.out.println(e.getMessage());
+ 								}
+ 							}
+ 						}
+ 					}
+ 				}
+ 				
+ 				if (hostname != null)
+ 				{
+ 					paObj.serverName = hostname;
+ 				}
+ 				else
+ 				{
+ 					String serverName =  System.getenv("TRAFCI_SERVERNAME");										
+ 					if (serverName == null)
+ 					{					
+ 						//System.out.println("Can't obtain hostname, please enter hostname:port");
+ 						//System.exit(SessionDefaults.abruptExit);
+ 					}
+ 					else		
+ 						paObj.serverName = serverName;
+ 				}
+ 				
+ 				if (portNumber != null)
+ 				{
+ 					paObj.portNumber = portNumber;
+ 				}
+ 				else
+ 				{
+ 					String portName = System.getenv("TRAFCI_PORT");					
+ 					if (portName == null)
+ 					{					
+ 						//System.out.println("Can't obtain port number, please enter hostname:port");
+ 						//System.exit(SessionDefaults.abruptExit);
+ 					}		
+ 					paObj.portNumber = portName;
+ 				}
+ 					
+ 				if (paObj.serverName != null && paObj.portNumber != null)
+ 					System.out.println("Host Name/IP Address: "+paObj.serverName+paObj.portNumber);
+ 				if (paObj.userName != null)
+ 					System.out.println("User Name: "+paObj.userName);
+ 				
+          	} catch (Exception e)
+ 			{
+ 				e.printStackTrace();
+ 			}
+          	
+ 		}
+ 		
+ 		while (paObj.retryCnt > 0) {
+ 
+ 			try {
+ 				// validate the user credentials
+ 				myArgs = paObj.validateArgs(myArgs, true);
+ 			} catch (UserInterruption ui) {
+ 				System.exit(SessionDefaults.abruptExit);
+ 			} catch (InvalidNumberOfArguments e) {
+ 				System.out.println(e);
+ 				if (doTrace)
+ 					e.printStackTrace();
+ 				System.exit(SessionDefaults.abruptExit);
+ 			} catch (UnknownHostException e) {
+ 				if (doTrace)
+ 					e.printStackTrace();
+ 				System.exit(SessionDefaults.abruptExit);
+ 			} catch (IOException e) {
+ 				System.out.println(e);
+ 				if (doTrace)
+ 					e.printStackTrace();
+ 				System.exit(SessionDefaults.abruptExit);
+ 			}
+ 
+ 			// create a new session
+ 			// pass the required credentials details and caller id
+ 			// for this user interface the caller id will be USERI
+ 			// A session object is returned by SessionInterface
+ 			// with the required DB connection, writer and reader objects
+ 			SessionInterface siObj = new SessionInterface(crObj, cwObj);
+ 			Session sessObj = null;
+ 			try {
+ 				// set the script file if -script option is specified
+ 				siObj.setScriptFile(paObj.fileName);
+ 				sessObj = siObj.createSession(paObj.userName,
+ 						paObj.roleName, paObj.password, paObj.serverName,
+ 						paObj.portNumber, paObj.dsnName, SessionDefaults.USERI,
+ 						paObj.noConnectOption);
+ 
+ 				// DFM MXCI Migration Settings
+ 				if (paObj.dfm) {
+ 					sessObj.setSessView(SessionDefaults.MXCI_VIEW);
+ 					sessObj.setSessionPrompt(">>");
+ 					sessObj.setCmdEcho(true);
+ 				}
+ 
+ 				// All credentials are valid, do not prompt for login params
+ 				// again.
+ 				paObj.retryCnt = 0;
+ 
+ 				// set the mode to query mode if the -sql|-q is option is
+ 				// specified
+ 				// show the welcome banner only when the session is interactive
+ 				// mode ( non-query mode)
+ 				if (paObj.queryStr != null) {
+ 					siObj.setQueryOptions(true, paObj.queryStr);
+ 				} else {
+ 					System.out.println();
+ 					if (paObj.noConnectOption)
+ 						System.out.println("Not connected.");
+ 					else
+ 						System.out.println("Connected to " + sessObj.getDatabaseEdition());
+ 
+ 				}
+ 
+ 				// call the session
+ 				exitCode = siObj.invokeSession(sessObj);
+ 				siObj = null;
+ 			} catch (FileNotFoundException e) {
+ 				// thrown when the script file specified in the command line is
+ 				// not found
+ 				System.out.println();
+ 				System.out.println(SessionError.SCRIPT_FILE_NOT_FOUND);
+ 				if (doTrace)
+ 					e.printStackTrace();
+ 				System.exit(SessionDefaults.abruptExit);
+ 			} catch (SQLException sqle) {
+ 				if (doTrace) {
+ 					System.out.println("Caught a SQL exception. Error code = "
+ 							+ sqle.getErrorCode() + ", msg="
+ 							+ sqle.getMessage());
+ 					sqle.printStackTrace();
+ 				}
+ 
+ 				System.out.println();
+ 
+ 				// catch the known errors report them with an user friendly text
+ 				if (sqle.getErrorCode() == SessionDefaults.SQL_ERR_CONN_MAX_LIMIT) {
+ 					System.out.println(SessionError.CONN_MAX_LIMIT_ERR);
+ 					if (doTrace)
+ 						sqle.printStackTrace();
+ 					System.exit(SessionDefaults.abruptExit);
+ 				} else {
+ 					int errCode = sqle.getErrorCode();
+ 					String errStr = sqle.toString();
+ 
+ 					if (errStr.indexOf("org.trafodion.jdbc") != -1)
+ 						errStr = errStr.substring(errStr.indexOf(":") + 1)
+ 								.trim();
+ 
+ 					if (errStr.startsWith("***"))
+ 						System.out.println(errStr
+ 								+ SessionDefaults.lineSeperator);
+ 					else
+ 						System.out.println(SessionError.ERROR_CODE_PREFIX
+ 								+ Math.abs(errCode)
+ 								+ SessionError.ERROR_CODE_SUFFIX + " " + errStr
+ 								+ SessionDefaults.lineSeperator);
+ 
+ 					// identify those args that caused the exception
+ 					if (SessionDefaults.SQL_ERR_INVALID_AUTH == errCode
+ 							|| SessionDefaults.SQL_ERR_CLI_AUTH == errCode) {
+ 						paObj.userName = null;
+ 						paObj.password = null;
+ 						paObj.roleName = null;
+ 					} else if (SessionDefaults.NDCS_ERR_DSN_NOT_AVAILABLE == errCode) {
+ 						paObj.dsnName = null;
+ 					} else {
+ 						paObj.serverName = null;
+ 					}
+ 
+ 					// rebuild args list and remove only those that caused the
+ 					// exception
+ 					myArgs = paObj.rebuildArgList(myArgs);
+ 
+ 					if (--paObj.retryCnt == 0) {
+ 						if (doTrace)
+ 							sqle.printStackTrace();
+ 						System.exit(SessionDefaults.abruptExit);
+ 					}
+ 				}
+ 
+ 			} // end SQLException
+ 			catch (InstantiationException e) {
+ 				System.out.println(SessionError.DRIVER_INIT_ERR);
+ 				if (doTrace)
+ 					e.printStackTrace();
+ 				System.exit(SessionDefaults.abruptExit);
+ 			} catch (IllegalAccessException e) {
+ 				System.out.println(SessionError.DRIVER_INIT_ILLEGAL_ERR);
+ 				if (doTrace)
+ 					e.printStackTrace();
+ 				System.exit(SessionDefaults.abruptExit);
+ 			} catch (ClassNotFoundException e) {
+ 				System.out.println(SessionError.DRIVER_CLASS_ERR);
+ 				if (doTrace)
+ 					e.printStackTrace();
+ 				System.exit(SessionDefaults.abruptExit);
+ 			} catch (IOException e) {
+ 				System.out.println(e);
+ 				if (doTrace)
+ 					e.printStackTrace();
+ 				System.exit(SessionDefaults.abruptExit);
+ 			} catch (Exception e) {
+ 				System.out.println(e);
+ 				//if (doTrace)
+ 					e.printStackTrace();
+ 			} finally {
+ 				if (sessObj != null && sessObj.getConnObj() != null) {
+ 					try {
+ 						sessObj.getConnObj().close();
+ 					} catch (SQLException e) {
+ 					}
+ 				}
+ 			}
+ 
+ 			siObj = null;
+ 		} // end while
+ 
+ 		System.exit(exitCode);
+ 
+ 	}
+ 
+ 	private static void banner() {
+ 		System.out.println("\nWelcome to " + SessionDefaults.PROD_NAME);
+ 		String copyright_str = "Copyright (c) "+System.getenv("PRODUCT_COPYRIGHT_HEADER");
+ 		System.out.println(copyright_str);
+ 		System.out.println();
+ 	}
+ }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b4c7c814/core/sqf/src/tm/macros.gmk
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b4c7c814/install/python-installer/traf_setup.py
----------------------------------------------------------------------


Mime
View raw message