You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2005/03/09 15:25:12 UTC

svn commit: r156648 - incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij

Author: kmarsden
Date: Wed Mar  9 06:24:56 2005
New Revision: 156648

URL: http://svn.apache.org/viewcvs?view=rev&rev=156648
Log:
Tests and master updates for client


Modified:
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/netxaPositive.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/testij.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users2.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
    incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java
    incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java Wed Mar  9 06:24:56 2005
@@ -23,6 +23,7 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.util.Locale;
 import java.util.Properties;
 import java.util.Vector;
 import java.util.Hashtable;
@@ -376,21 +377,27 @@
     
     public static  boolean isDB2Connection(String fm)
     {
-	return (fm.equals("DB2app") ||
-		fm.equals("DB2jcc"));
+	return (fm.toUpperCase(Locale.ENGLISH).equals("DB2APP") ||
+		fm.toUpperCase(Locale.ENGLISH).equals("DB2JCC"));
 
     }
 
 	public static boolean isNetworkServerConnection(String fm)
 	{
-		return (fm.startsWith("DerbyNet"));
+		return (fm.toUpperCase(Locale.ENGLISH).startsWith("DERBYNET"));
 	}
 
     public static boolean isClientConnection(String fm)
     {
-	return (fm.startsWith("DerbyNet") ||
-		fm.equals("DB2jcc"));
+	return (fm.toUpperCase(Locale.ENGLISH).startsWith("DERBYNET") ||
+		fm.toUpperCase(Locale.ENGLISH).equals("DB2JCC"));
     }
+
+	public static boolean isJCCConnection(String fm)
+	{
+		return fm.toUpperCase(Locale.ENGLISH).equals("DB2JCC") || 
+			fm.equals("DERBYNET");
+	}
 
     /**
      * @param fm framework name. database url from properties file

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java Wed Mar  9 06:24:56 2005
@@ -1644,13 +1644,6 @@
 			    value = NetServer.alterURL(framework,value);
 			    p.put(key, value);
 			}
-			// force messages to show
-			else if ((!key.equals("retrieveMessagesFromServerOnGetMessage")) &&
-				(!key.equals("ij.retrieveMessagesFromServerOnGetMessage")))
-			{
-				p.put("ij.retrieveMessagesFromServerOnGetMessage","true");	
-				p.put("retrieveMessagesFromServerOnGetMessage","true");	
-			}
 			else // for any other properties, just copy them
 			    p.put(key, value);
 			
@@ -1665,6 +1658,13 @@
 
 		    p.put("ij.user",user);
 		    p.put("ij.password",password);
+		}
+
+		
+		if (NetServer.isJCCConnection(framework))
+		{
+			// force messages to show
+			p.put("ij.retrieveMessagesFromServerOnGetMessage","true");	
 		}
 
 		// If this is not a known protocol for ij we

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out Wed Mar  9 06:24:56 2005
@@ -35,4 +35,8 @@
 CP connected as EDWARD
 CP connected as FRANCES
 EXPECTED SHUTDOWN DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+** checkMessageText() with retrieveMessageText= false
+PASS: Message text not retrieved
+** checkMessageText() with retrieveMessageText= true
+PASS: Message Text retrieved properly
 Completed dataSourcePermissions_net

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/netxaPositive.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/netxaPositive.out?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/netxaPositive.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/netxaPositive.out Wed Mar  9 06:24:56 2005
@@ -38,7 +38,7 @@
 ij(XA)> xa_end xa_success 0;
 ij(XA)> xa_commit xa_1phase 0;
 ij(XA)> xa_datasource 'wombat' shutdown;
-ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
 ij(XA)> ---------------------------------------------
 ----- two interleaving connections and prepare/commit prepare/rollback
 -----

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out Wed Mar  9 06:24:56 2005
@@ -77,13 +77,13 @@
 -----
 disconnect all;
 ij> connect 'wombat;user=system;password=manager;shutdown=true';
-ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
 ij> connect 'guestSchemeDB;user=system;password=manager;shutdown=true';
-ERROR 08006: guestSchemeDB08006.DDatabase 'guestSchemeDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: guestSchemeDB08006.DDatabase 'guestSchemeDB' shutdown.((server log XXX)
 ij> connect 'derbySchemeDB;user=system;password=manager;shutdown=true';
 ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
 ij> connect 'simpleSchemeDB;user=system;password=manager;shutdown=true';
-ERROR 08006: simpleSchemeDB08006.DDatabase 'simpleSchemeDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: simpleSchemeDB08006.DDatabase 'simpleSchemeDB' shutdown.((server log XXX)
 ij> disconnect all;
 ij> -- shuting down the system causes IJ to loose the protocol, therefore
 ----- we'd be doomed :(
@@ -153,7 +153,7 @@
 ERROR 25503: DDL is not permitted for a read-only connection, user or database.
 ij(CONNECTION15)> -- Invalid ones:
 connect 'simpleSchemeDB;user=Jamie;password=theHooligan';
-ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ERROR 04501: DERBY SQL error: SQLCODE: -1, SQLSTATE: 04501, SQLERRMC: 04501.CDatabase connection refused.((server log XXX)
 ij(CONNECTION15)> connect 'simpleSchemeDB;user=dan;password=makeItFaster';
 ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
 ij(CONNECTION15)> connect 'simpleSchemeDB;user=francois;password=corsica';
@@ -186,13 +186,13 @@
 No connections available.
 ij> -- Database shutdown - check user - should succeed
 connect 'wombat;user=jeff;password=homeRun;shutdown=true';
-ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
 ij> connect 'guestSchemeDB;user=kreg;password=IwasBornReady;shutdown=true';
-ERROR 08006: guestSchemeDB08006.DDatabase 'guestSchemeDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: guestSchemeDB08006.DDatabase 'guestSchemeDB' shutdown.((server log XXX)
 ij> connect 'derbySchemeDB;user=mamta;password=ieScape;shutdown=true';
-ERROR 08006: derbySchemeDB08006.DDatabase 'derbySchemeDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: derbySchemeDB08006.DDatabase 'derbySchemeDB' shutdown.((server log XXX)
 ij> connect 'simpleSchemeDB;user=jeff;password=homeRun;shutdown=true';
-ERROR 08006: simpleSchemeDB08006.DDatabase 'simpleSchemeDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: simpleSchemeDB08006.DDatabase 'simpleSchemeDB' shutdown.((server log XXX)
 ij> show connections;
 No connections available.
 ij> -- Derby system shutdown - check user - should fail
@@ -201,5 +201,5 @@
 ij> disconnect all;
 ij> -- Derby system shutdown - check user - should succeed
 connect ';user=system;password=manager;shutdown=true';
-ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ERROR XJ015: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ015, SQLERRMC: XJ015.MDerby system shutdown.((server log XXX)
 ij> 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out Wed Mar  9 06:24:56 2005
@@ -28,7 +28,7 @@
 -----
 disconnect all;
 ij> connect 'ldapSchemeDB;user=system;password=manager;shutdown=true';
-ERROR 08006: ldapSchemeDB08006.DDatabase 'ldapSchemeDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: ldapSchemeDB08006.DDatabase 'ldapSchemeDB' shutdown.((server log XXX)
 ij> disconnect all;
 ij> connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
 ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
@@ -37,5 +37,5 @@
 ij> disconnect all;
 ij> -- Derby system shutdown - check user - should succeed
 connect ';user=system;password=manager;shutdown=true';
-ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ERROR XJ015: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ015, SQLERRMC: XJ015.MDerby system shutdown.((server log XXX)
 ij> 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/testij.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/testij.out?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/testij.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/testij.out Wed Mar  9 06:24:56 2005
@@ -2,7 +2,7 @@
 org.apache.derby.tools.ij extin/testclientij.sql 
 ij> driver 'org.apache.derby.jdbc.ClientDriver';
 ij> --Bug 4632  Make the db italian to make sure string selects  are working
-connect 'jdbc:derby://localhost:1527/wombat;create=true;territory=it:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadmin';
+connect 'jdbc:derby://localhost:1527/wombat;create=true;territory=it:' USER 'dbadmin' PASSWORD 'dbadmin';
 ij> connect 'jdbc:derby://localhost:1527/wombat' USER 'dbadmin' PASSWORD 'dbadbmin';
 ij(CONNECTION1)> -- this is a comment, a comment in front of a select should not cause an error
 select * from sys.systables where 1=0;
@@ -17,22 +17,31 @@
 1 row selected
 ij(CONNECTION1)> -- Try some URL attributes
 disconnect all;
-ij> connect 'jdbc:derby://localhost:1527/junk;create=true:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadbmin';
+ij> connect 'jdbc:derby://localhost:1527/junk;create=true:' USER 'dbadmin' PASSWORD 'dbadbmin';
 ij> select * from APP.notthere;
 ERROR 42X05: Table 'APP.NOTTHERE' does not exist.
 ij> -- examples from the docs
-connect 'jdbc:derby://localhost:1527/wombat;create=true:user=judy;password=judy;retrieveMessagesFromServerOnGetMessage=true;';
-ij(CONNECTION1)> connect 'jdbc:derby://localhost:1527/"./wombat":user=judy;password=judy;retrieveMessagesFromServerOnGetMessage=true;';
-ij(CONNECTION2)> connect 'jdbc:derby://localhost:1527/toursDB:retrieveMessagesFromServerOnGetMessage=true;';
+connect 'jdbc:derby://localhost:1527/wombat;create=true:user=judy;password=judy;';
+ij(CONNECTION1)> connect 'jdbc:derby://localhost:1527/"./wombat":user=judy;password=judy;';
+ij(CONNECTION2)> connect 'jdbc:derby://localhost:1527/toursDB:';
 ERROR (no SQLState): null userid not supported
-ij(CONNECTION2)> connect 'jdbc:derby://localhost:1527/toursDB:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadbmin';
+ij(CONNECTION2)> connect 'jdbc:derby://localhost:1527/toursDB:' USER 'dbadmin' PASSWORD 'dbadbmin';
 ERROR 08004: The application server rejected establishment of the connection.  An attempt was made to access a database, toursDB, which was not found.
 ij(CONNECTION2)> connect 'jdbc:derby://localhost:1527/wombat' USER 'APP' PASSWORD 'APP';
-ij(CONNECTION3)> connect  'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
-ij(CONNECTION4)> connect 'jdbc:derby://localhost:1527/my-db-name;upgrade=true:user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
+ij(CONNECTION3)> connect  'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;';
+ij(CONNECTION4)> connect 'jdbc:derby://localhost:1527/my-db-name;upgrade=true:user=usr;password=pwd;';
 ij(CONNECTION5)> connect 'jdbc:derby://localhost:1527/my-db-name;shutdown=true:user=usr;password=pwd;'
 ----- Quoted db and attributes
 connect 'jdbc:derby://localhost:1527/"./my-dbname;create=true":user=usr;password=pwd;';
 ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: my-db-name08006.DDatabase 'my-db-name' shutdown.((server log XXX)
-ij(CONNECTION5)> connect 'jdbc:derby://localhost:1527/"./my-dbname;create=true":user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
-ij(CONNECTION6)> 
+ij(CONNECTION5)> connect 'jdbc:derby://localhost:1527/"./my-dbname;create=true":user=usr;password=pwd;';
+ij(CONNECTION6)> -- retrieveMessageText Testing
+connect 'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;retrieveMessageText=false;';
+ij(CONNECTION7)> -- Should not get message text
+select * from APP.notthere;
+ERROR 42X05: DERBY SQL error: SQLCODE: -1, SQLSTATE: 42X05, SQLERRMC: APP.NOTTHERE42X05
+ij(CONNECTION7)> connect 'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;retrieveMessageText=true;';
+ij(CONNECTION8)> -- Should see message text
+select * from APP.notthere;
+ERROR 42X05: Table 'APP.NOTTHERE' does not exist.
+ij(CONNECTION8)> 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users.out?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users.out Wed Mar  9 06:24:56 2005
@@ -11,7 +11,7 @@
 ij(CONNECTION1)> autocommit on;
 ij(CONNECTION1)> disconnect;
 ij> connect 'wombat;shutdown=true;user=francois;password=paceesalute';
-ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
 ij> connect 'myDB;create=true;user=dan;password=MakeItFaster';
 ij(CONNECTION1)> autocommit off;
 ij(CONNECTION1)> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
@@ -24,7 +24,7 @@
 ij(CONNECTION1)> autocommit on;
 ij(CONNECTION1)> disconnect;
 ij> connect 'myDB;shutdown=true;user=dan;password=MakeItFaster';
-ERROR 08006: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
 ij> -- beetle 5468
 disconnect all;
 ij> -- Specifically test JBMS users.
@@ -110,11 +110,11 @@
 ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
 ij> -- Invalid database users
 connect 'myDB;user=howardR;password=IamBetterAtTennis';
-ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ERROR 04501: DERBY SQL error: SQLCODE: -1, SQLSTATE: 04501, SQLERRMC: 04501.CDatabase connection refused.((server log XXX)
 ij> connect 'wombat;user=jerry;password=SacreBleu';
-ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ERROR 04501: DERBY SQL error: SQLCODE: -1, SQLSTATE: 04501, SQLERRMC: 04501.CDatabase connection refused.((server log XXX)
 ij> connect 'wombat;user=jamie;password=MrNamePlates';
-ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ERROR 04501: DERBY SQL error: SQLCODE: -1, SQLSTATE: 04501, SQLERRMC: 04501.CDatabase connection refused.((server log XXX)
 ij> show connections;
 No connections available.
 ij> connect 'wombat;user=francois;password=paceesalute';
@@ -125,7 +125,7 @@
 ij(CONNECTION1)> connect 'myDB;user=jamie;password=LetMeIn;shutdown=true';
 ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
 ij(CONNECTION1)> connect 'wombat;user=jerry;password=SacreBleu;shutdown=true';
-ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ERROR 04501: DERBY SQL error: SQLCODE: -1, SQLSTATE: 04501, SQLERRMC: 04501.CDatabase connection refused.((server log XXX)
 ij(CONNECTION1)> show connections;
 CONNECTION0 - 	jdbc:derby://localhost:1527/wombat;user=francois;password=paceesalute
 CONNECTION1* - 	jdbc:derby://localhost:1527/myDB;user=jerry;password=SacreBleu
@@ -133,9 +133,9 @@
 ij(CONNECTION1)> -- Database shutdown - check user - should succeed
 ----- beetle 5367
 connect 'wombat;user=francois;password=paceesalute;shutdown=true';
-ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
 ij(CONNECTION1)> connect 'myDB;user=jerry;password=SacreBleu;shutdown=true';
-ERROR 08006: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
 ij(CONNECTION1)> show connections;
 CONNECTION0 - 	jdbc:derby://localhost:1527/wombat;user=francois;password=paceesalute
 CONNECTION1* - 	jdbc:derby://localhost:1527/myDB;user=jerry;password=SacreBleu
@@ -146,7 +146,7 @@
 ij(CONNECTION1)> disconnect all;
 ij> -- JBMS System shutdown - check user - should succeed
 connect ';user=francois;password=paceesalute;shutdown=true';
-ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ERROR XJ015: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ015, SQLERRMC: XJ015.MDerby system shutdown.((server log XXX)
 ij> -- beetle 5390
 ----- the server does not shut down properly in network server
 ;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users2.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users2.out?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users2.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users2.out Wed Mar  9 06:24:56 2005
@@ -18,7 +18,7 @@
 ij> autocommit on;
 ij> disconnect all;
 ij> connect 'wombat;shutdown=true;user=system;password=manager';
-ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
 ij> -- beetle 5468
 disconnect all;
 ij> connect 'wombat;user=system;password=manager';
@@ -91,7 +91,7 @@
 ij> autocommit on;
 ij> disconnect all;
 ij> connect 'myDB;shutdown=true;user=system;password=manager';
-ERROR 08006: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
 ij> -- beetle 5468
 disconnect all;
 ij> connect 'myDB;user=system;password=manager';
@@ -222,11 +222,11 @@
 No connections available.
 ij> -- Database shutdown - check user - should succeed
 connect 'wombat;user=francois;password=paceesalute;shutdown=true';
-ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
 ij> -- beetle 5468
 disconnect all;
 ij> connect 'myDB;user=jerry;password=SacreBleu;shutdown=true';
-ERROR 08006: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
 ij> -- beetle 5468
 disconnect all;
 ij> -- there should be no connections left here
@@ -237,5 +237,5 @@
 ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
 ij> -- JBMS System shutdown - check user - should succeed
 connect ';user=system;password=manager;shutdown=true';
-ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ERROR XJ015: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ015, SQLERRMC: XJ015.MDerby system shutdown.((server log XXX)
 ij> 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java Wed Mar  9 06:24:56 2005
@@ -91,6 +91,8 @@
 			dataSourcePermissions_net tester = new dataSourcePermissions_net();
 			tester.setProperties();
 			tester.runTest();
+			if (TestUtil.isDerbyNetClientFramework())
+				tester.testClientDataSourceProperties();
 
 		} catch (Exception e) {
 		// if we catch an exception of some sort, we need to make sure to
@@ -141,10 +143,18 @@
 
 	}
 
+	public javax.sql.DataSource getDS(String database, String user, String 
+									  password)
+	{
+		return getDS(database,user,password,null);
+	}
+
 	public javax.sql.DataSource getDS(String database, String user, String
-									  password)  
-{
-	Properties attrs = new Properties();
+									  password, Properties attrs)  
+	{
+		
+	if (attrs == null)
+		attrs = new Properties();
 	attrs.setProperty("databaseName", database);
 	if (user != null)
 		attrs.setProperty("user", user);
@@ -225,6 +235,99 @@
 		return false;
 	}
 
+	/**
+	 *  Test Client specific dataSource Properties
+	 *
+	 */
+	public void testClientDataSourceProperties() throws SQLException
+	{
+		testRetrieveMessageText();
+	}
+
+	/** 
+	 * Test property retrieveMessageText to retrieve message text
+	 * Property defaults to true for Network Client but can be set to 
+	 * false to disable the procedure call.
+	 */
+	public void testRetrieveMessageText() throws SQLException
+	{
+		Connection conn;
+		String retrieveMessageTextProperty = "retrieveMessageText";
+		Class[] argType = { Boolean.TYPE };
+		String methodName = TestUtil.getSetterName(retrieveMessageTextProperty);
+		Object[] args;
+
+		try {
+			DataSource ds = getDS("wombat", "EDWARD", "noodle");
+			Method sh = ds.getClass().getMethod(methodName, argType);
+			args = new Boolean[] { new Boolean(false) };
+			sh.invoke(ds, args);
+			conn = ds.getConnection();
+			checkMessageText(conn,"false");
+			conn.close();
+			
+			// now try with retrieveMessageText = true
+			ds = getDS("wombat", "EDWARD", "noodle");
+			args = new Boolean[] { new Boolean(true) };
+			sh.invoke(ds, args);
+			conn = ds.getConnection();
+			checkMessageText(conn,"true");
+			conn.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println("FAIL: testRetrieveMessageText() Unexpected Exception " + e.getMessage());
+			e.printStackTrace();
+		}
+	}
+
+	public void checkMessageText(Connection conn, String
+								 retrieveMessageTextValue) throws SQLException
+	{
+		System.out.println("** checkMessageText() with retrieveMessageText= " + 
+						   retrieveMessageTextValue);
+
+		try {
+			conn.createStatement().executeQuery("SELECT * FROM APP.NOTTHERE");
+		}
+		catch (SQLException e)
+		{
+			String expectedSQLState = "42X05";
+			String sqlState = e.getSQLState();
+			if (sqlState == null || ! sqlState.equals(expectedSQLState))
+			{
+				System.out.println("Incorrect SQLState.  Got: " + sqlState + 
+								   " should be: " + expectedSQLState); 
+				throw e;
+			}
+			if (retrieveMessageTextValue.equals("true") )
+				{
+					if (e.getMessage().indexOf("does not exist") != -1)
+						System.out.println("PASS: Message Text retrieved properly");
+					else
+					{
+						System.out.println("FAIL: Message text was not retrieved");
+						throw e;
+					}
+				}
+			else
+				// retrieveMessageTextValue is false
+				if (e.getMessage().indexOf("does not exist") == -1)
+				{
+					System.out.println("PASS: Message text not retrieved");
+				}
+				else
+				{
+					System.out.println("FAIL: Message Text should not have been retrieved");
+					throw e;
+				}
+			
+		}
+	}
+
 }
+
+
+
 
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql Wed Mar  9 06:24:56 2005
@@ -1,6 +1,6 @@
 driver 'org.apache.derby.jdbc.ClientDriver';
 --Bug 4632  Make the db italian to make sure string selects  are working
-connect 'jdbc:derby://localhost:1527/wombat;create=true;territory=it:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadmin';
+connect 'jdbc:derby://localhost:1527/wombat;create=true;territory=it:' USER 'dbadmin' PASSWORD 'dbadmin';
 
 connect 'jdbc:derby://localhost:1527/wombat' USER 'dbadmin' PASSWORD 'dbadbmin';
 -- this is a comment, a comment in front of a select should not cause an error
@@ -10,26 +10,26 @@
 
 -- Try some URL attributes
 disconnect all;
-connect 'jdbc:derby://localhost:1527/junk;create=true:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadbmin';
+connect 'jdbc:derby://localhost:1527/junk;create=true:' USER 'dbadmin' PASSWORD 'dbadbmin';
 select * from APP.notthere;
 
 
 -- examples from the docs
 
-connect 'jdbc:derby://localhost:1527/wombat;create=true:user=judy;password=judy;retrieveMessagesFromServerOnGetMessage=true;';
+connect 'jdbc:derby://localhost:1527/wombat;create=true:user=judy;password=judy;';
 
-connect 'jdbc:derby://localhost:1527/"./wombat":user=judy;password=judy;retrieveMessagesFromServerOnGetMessage=true;';
+connect 'jdbc:derby://localhost:1527/"./wombat":user=judy;password=judy;';
 
-connect 'jdbc:derby://localhost:1527/toursDB:retrieveMessagesFromServerOnGetMessage=true;';
+connect 'jdbc:derby://localhost:1527/toursDB:';
 
 
-connect 'jdbc:derby://localhost:1527/toursDB:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadbmin';
+connect 'jdbc:derby://localhost:1527/toursDB:' USER 'dbadmin' PASSWORD 'dbadbmin';
 
 connect 'jdbc:derby://localhost:1527/wombat' USER 'APP' PASSWORD 'APP';
 
-connect  'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
+connect  'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;';
 
-connect 'jdbc:derby://localhost:1527/my-db-name;upgrade=true:user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
+connect 'jdbc:derby://localhost:1527/my-db-name;upgrade=true:user=usr;password=pwd;';
 
 
 connect 'jdbc:derby://localhost:1527/my-db-name;shutdown=true:user=usr;password=pwd;'
@@ -37,7 +37,18 @@
 -- Quoted db and attributes
 connect 'jdbc:derby://localhost:1527/"./my-dbname;create=true":user=usr;password=pwd;';
 
-connect 'jdbc:derby://localhost:1527/"./my-dbname;create=true":user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
+connect 'jdbc:derby://localhost:1527/"./my-dbname;create=true":user=usr;password=pwd;';
+
 
 
+-- retrieveMessageText Testing
+connect 'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;retrieveMessageText=false;';
+
+-- Should not get message text
+select * from APP.notthere;
+
+connect 'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;retrieveMessageText=true;';
+
+-- Should see message text
+select * from APP.notthere;
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java Wed Mar  9 06:24:56 2005
@@ -122,6 +122,11 @@
 		return false;
 	}
 
+	public static boolean isDerbyNetClientFramework()
+	{
+		return (getFramework() == DERBY_NET_CLIENT_FRAMEWORK);
+	}
+
 	public static boolean isEmbeddedFramework()
 	{
 		return (getFramework() == EMBEDDED_FRAMEWORK);
@@ -303,7 +308,7 @@
 		Object[] args = null;
 		Object ds = null;
 		Method sh = null;
-
+		String methodName = null;
 		
 		if (specialAttributes == null)
 		{
@@ -312,6 +317,8 @@
 			specialAttributes.put("driverType",INT_ARG_TYPE);
 			specialAttributes.put("retrieveMessagesFromServerOnGetMessage",
 								  BOOLEAN_ARG_TYPE);
+			specialAttributes.put("retrieveMessageText",
+								  BOOLEAN_ARG_TYPE);
 		}
 		
 		try {
@@ -344,7 +351,7 @@
 									" key:" + key + " value:" +value);
 			   
 			}
-			String methodName = getSetterName(key);
+			methodName = getSetterName(key);
 
 			
 			// Need to use reflection to load indirectly
@@ -355,6 +362,7 @@
 
 		} catch (Exception e)
 		{
+			System.out.println("Error accessing method " + methodName);
 			System.out.println(e.getMessage());
 			e.printStackTrace();
 		}
@@ -362,7 +370,7 @@
 	}
 
 	
-	private static String  getSetterName(String attribute)
+	public static String  getSetterName(String attribute)
 	{
 		return "set" + Character.toUpperCase(attribute.charAt(0)) + attribute.substring(1);
 	}

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java (original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java Wed Mar  9 06:24:56 2005
@@ -449,7 +449,7 @@
 		
 		
 		// For JCC make sure we set it to retrieve messages
-		if (isNetFramework())
+		if (isJCCFramework())
 			retrieveMessages = true;
 		
 		if (ijGetMessages != null)
@@ -733,7 +733,7 @@
 	}
 
 	/**
-	 * Used to determine if this is a network testing framework 
+	 * Used to determine if this is a JCC testing framework 
 	 * So that retrieveMessages can be sent.  The plan is to have  
 	 * ij will retrieve messages by default and not look at the testing 
 	 * frameworks. So, ulitmately  this function will look at the driver
@@ -741,11 +741,11 @@
 	 * 
 	 * @return true if the framework contains Net or JCC.
 	 */
-	private static boolean isNetFramework()
+	private static boolean isJCCFramework()
 	{
 		String framework = util.getSystemProperty("framework");
 		return ((framework != null)  &&
-			((framework.toUpperCase(Locale.ENGLISH).indexOf("NET") != -1) ||
+			((framework.toUpperCase(Locale.ENGLISH).equals("DERBYNET")) ||
 			 (framework.toUpperCase(Locale.ENGLISH).indexOf("JCC") != -1)));
 	}
 	

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java?view=diff&r1=156647&r2=156648
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java (original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java Wed Mar  9 06:24:56 2005
@@ -94,8 +94,6 @@
 			  xaHelper.setDataSourceProperty(currentXADataSource,
 											 "portNumber", 1527);
 			  
-			  xaHelper.setDataSourceProperty(currentXADataSource, 
-											 "retrieveMessagesFromServerOnGetMessage", true);
 			  String user;
 			  String password;
 			  user = "APP";
@@ -108,9 +106,13 @@
 			  //"traceFile", "trace.out." + framework);
 			  }
 			  if (isJCC)
+			  {
 				  xaHelper.setDataSourceProperty(currentXADataSource,
 												 "driverType", 4);
 
+				  xaHelper.setDataSourceProperty(currentXADataSource, 
+												 "retrieveMessagesFromServerOnGetMessage", true);
+			  }
 			  xaHelper.setDataSourceProperty(currentXADataSource, "databaseName", databaseName);
 
 			if (shutdown != null && shutdown.toString().toLowerCase(Locale.ENGLISH).equals("shutdown"))