Hi, thanks for looking into it!

I executed your program and the result is:

Default locale = en_US
08006.D : [0] memory:db

I checked Language Settings for my Linux Mint, and Region was actually not US, 
so I changed everything to be US, restarted the machine and then re-executed 
your program (what actually gave the same result as when region was not US)

[cid:fb941382-5d6e-4e71-9b2e-a1a80dea4358]

Regards,
Orange


________________________________
From: Rick Hillegas <rick.hille...@gmail.com>
Sent: 25 November 2022 21:33
To: derby-user@db.apache.org <derby-user@db.apache.org>
Subject: Re: not getting proper database shutdown message in embedded mode

This indicates that Derby cannot find the localized messages for your 
environment. Only the English messages are bundled inside derby.jar. What 
happens when you run the following program:


import java.sql.*;

import java.util.*;

public class Z

{

    public static void main(String... args) throws Exception

    {

        println("Default locale = " + Locale.getDefault());

        Connection conn = 
DriverManager.getConnection("jdbc:derby:memory:db;create=true");

        conn.prepareStatement("CREATE TABLE t (a INT, b INT)").execute();

        try

        {

            DriverManager.getConnection("jdbc:derby:memory:db;shutdown=true");

        }

        catch (Exception ex)

        {

            println(ex.getMessage());

        }

    }

    private static void println(String text) { System.out.println(text); }

}


I see the following output when I run a script which prints out the java 
version and the classpath and then runs the program:

openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
CLASSPATH = 
/Users/rhillegas/derby/upgradeReleases/10.15.2.0/derby.jar:/Users/rhillegas/derby/upgradeReleases/10.15.2.0/derbyshared.jar:/Users/rhillegas/derby/upgradeReleases/10.15.2.0/derbytools.jar:/Users/rhillegas/src
Default locale = en_US
Database 'memory:db' shutdown.


On 11/25/22 4:33 AM, Orange Trees wrote:

Hello,

For some reason for my newly created database in embedded mode after issuing 
shutdown command getConnection("jdbc:derby:" + <database name> + 
";shutdown=true")  I'm not getting the message 'Database <database name> 
shutdown.' (as it was for my previous projects) but instead I'm getting this 
message:

08006.D : [0] <database name>

SQL State and error codes are inline (08006 and 45000). I tried with Derby 
versions 10.15.2.0 and 10.16.1.1. Also executing the included SimpleApp.java 
demo program gives the same result. For my project I'm including these jars:

derby.jar
derbyshared.jar
derbytools.jar

Also tried derbyoptionaltools.jar with no help.

Tried several times, deleting and recreating databases etc. Using Linux Mint 
with OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) (by the way 
in this environment my old databases return the correct/expected message)

What could be the issue?

Regards,
Orange



Reply via email to