ij> -- -- 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. -- -- -- -- URL locale handling -- create procedure checkDatabaseLoc(in locale char(12)) parameter style java language java external name 'org.apache.derbyTesting.functionTests.tests.i18n.DefaultLocale.checkDatabaseLocale'; 0 rows inserted/updated/deleted ij> create procedure checkRDefaultLoc() parameter style java language java external name 'org.apache.derbyTesting.functionTests.tests.i18n.DefaultLocale.checkRDefaultLocale'; 0 rows inserted/updated/deleted ij> -- this current database was created with the default locale call checkRDefaultLoc(); 0 rows inserted/updated/deleted ij> disconnect; ij> -- create a Swiss database connect 'swissdb;create=true;territory=fr_CH'; ij> create procedure checkDatabaseLoc(in locale char(12)) parameter style java language java external name 'org.apache.derbyTesting.functionTests.tests.i18n.DefaultLocale.checkDatabaseLocale'; 0 rows inserted/updated/deleted ij> call checkDatabaseLoc('fr_CH'); 0 rows inserted/updated/deleted ij> disconnect; ij> connect 'swissdb;shutdown=true'; ERROR 08006: Arr EnC:>234< t de la base de donn EnC:>233< es 'swissdb'. ij> -- check it is still Swiss when we re-boot connect 'swissdb'; ij> call checkDatabaseLoc('fr_CH'); 0 rows inserted/updated/deleted ij> disconnect; ij> connect 'swissdb;shutdown=true'; ERROR 08006: Arr EnC:>234< t de la base de donn EnC:>233< es 'swissdb'. ij> -- Locale automatically converts the components to the correct case -- create a Hindi in India database (hi_IN) connect 'hindi;create=true;territory=HI_in'; ij> create procedure checkDatabaseLoc(in locale char(12)) parameter style java language java external name 'org.apache.derbyTesting.functionTests.tests.i18n.DefaultLocale.checkDatabaseLocale'; 0 rows inserted/updated/deleted ij> call checkDatabaseLoc('hi_IN'); 0 rows inserted/updated/deleted ij> disconnect; ij> connect 'hindi;shutdown=true'; ERROR 08006: Database 'hindi' shutdown. ij> -- now try one with a variant -- create a English in Israel database for JavaOS en_IL_JavaOS connect 'Israel;create=true;territory=en_IL_JavaOS'; ij> create procedure checkDatabaseLoc(in locale char(12)) parameter style java language java external name 'org.apache.derbyTesting.functionTests.tests.i18n.DefaultLocale.checkDatabaseLocale'; 0 rows inserted/updated/deleted ij> call checkDatabaseLoc('en_IL_JavaOS'); 0 rows inserted/updated/deleted ij> disconnect; ij> connect 'Israel;shutdown=true'; ERROR 08006: Database 'Israel' shutdown. ij> -- now try with just a language - we support this -- as some vms do. connect 'bacon;create=true;territory=da'; ij> create procedure checkDatabaseLoc(in locale char(12)) parameter style java language java external name 'org.apache.derbyTesting.functionTests.tests.i18n.DefaultLocale.checkDatabaseLocale'; 0 rows inserted/updated/deleted ij> call checkDatabaseLoc('da'); 0 rows inserted/updated/deleted ij> disconnect; ij> connect 'bacon;shutdown=true'; ERROR 08006: Database 'bacon' shutdown. ij> connect 'bacon'; ij> call checkDatabaseLoc('da'); 0 rows inserted/updated/deleted ij> disconnect; ij> connect 'bacon;shutdown=true'; ERROR 08006: Database 'bacon' shutdown. ij> -- -- some negative tests -- connect 'fail1;create=true;territory='; ERROR XJ041: Failed to create database 'fail1', see the next exception for details. ERROR XBM0X: Supplied territory description '' is invalid, expecting ln[_CO[_variant]] ln=lower-case two-letter ISO-639 language code, CO=upper-case two-letter ISO-3166 country codes, see java.util.Locale. ij> -- database will not have been created so this connection will fail connect 'fail1;shutdown=true'; ERROR XJ004: Database 'fail1' not found. ij> connect 'fail3;create=true;territory=en_'; ERROR XJ041: Failed to create database 'fail3', see the next exception for details. ERROR XBM0X: Supplied territory description 'en_' is invalid, expecting ln[_CO[_variant]] ln=lower-case two-letter ISO-639 language code, CO=upper-case two-letter ISO-3166 country codes, see java.util.Locale. ij> connect 'fail4;create=true;territory=en_d'; ERROR XJ041: Failed to create database 'fail4', see the next exception for details. ERROR XBM0X: Supplied territory description 'en_d' is invalid, expecting ln[_CO[_variant]] ln=lower-case two-letter ISO-639 language code, CO=upper-case two-letter ISO-3166 country codes, see java.util.Locale. ij> connect 'fail5;create=true;territory=en_US_'; ERROR XJ041: Failed to create database 'fail5', see the next exception for details. ERROR XBM0X: Supplied territory description 'en_US_' is invalid, expecting ln[_CO[_variant]] ln=lower-case two-letter ISO-639 language code, CO=upper-case two-letter ISO-3166 country codes, see java.util.Locale. ij> connect 'fail6;create=true;territory=en-US'; ERROR XJ041: Failed to create database 'fail6', see the next exception for details. ERROR XBM0X: Supplied territory description 'en-US' is invalid, expecting ln[_CO[_variant]] ln=lower-case two-letter ISO-639 language code, CO=upper-case two-letter ISO-3166 country codes, see java.util.Locale. ij> -- try using a database name with trailing blanks -- beetle 4653 connect 'trailblank;create=true'; ij> connect 'trailblank'; ij(CONNECTION1)> connect 'trailblank '; ij(CONNECTION2)> connect 'trailblank ;shutdown=true'; ERROR 08006: Database 'trailblank' shutdown. ij(CONNECTION2)> connect ';shutdown=true'; ERROR XJ015: Derby system shutdown. ij(CONNECTION2)>