You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by han hongfang <ha...@gmail.com> on 2009/12/23 08:31:22 UTC

Can derby network server be shutdown from ij?

Hi all,

I'm using Derby 10.4.2.0. I have a problem regarding shutdown derby network
server in ij.

I have derby installed here, D:\devtools\derby\db-derby-10.4.2.0-bin

I have bin\derby.properties with following informatin to enable user
authentication:

derby.connection.requireAuthentication=true
derby.authentication.provider=BUILTIN
derby.user.user1=passw0rd1
derby.user.user2=passw0rd2

Then I open two command windows on my XP, and direct both of them to
D:\devtools\derby\db-derby-10.4.2.0-bin\bin.

- In one command window, I start derby network server with
startNetworkServer.bat;

- In another command window, I start ij, and perform the following
operation.

ij> connect
'jdbc:derby://localhost:1527/;shutdown=true;user=user1;password=passw0rd1';
ERROR XJ015: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ015, SQLERRMC: Derby
system shutdown.
ij> connect
'jdbc:derby://localhost:1527/testdb;user=user1;password=passw0rd1';
ij> show tables;
TABLE_SCHEM         |TABLE_NAME                    |REMARKS
------------------------------------------------------------------------
SYS                 |SYSALIASES                    |
SYS                 |SYSCHECKS                     |
SYS                 |SYSCOLPERMS                   |
SYS                 |SYSCOLUMNS                    |
SYS                 |SYSCONGLOMERATES              |
SYS                 |SYSCONSTRAINTS                |
SYS                 |SYSDEPENDS                    |
SYS                 |SYSFILES                      |
SYS                 |SYSFOREIGNKEYS                |
SYS                 |SYSKEYS                       |
SYS                 |SYSROLES                      |
SYS                 |SYSROUTINEPERMS               |
SYS                 |SYSSCHEMAS                    |
SYS                 |SYSSTATEMENTS                 |
SYS                 |SYSSTATISTICS                 |
SYS                 |SYSTABLEPERMS                 |
SYS                 |SYSTABLES                     |
SYS                 |SYSTRIGGERS                   |
SYS                 |SYSVIEWS                      |
SYSIBM              |SYSDUMMY1                     |

My understading is ERROR XJ015 means that derby system is successfully
shutdown.

But why after derby shutdown I can still see other commands working. In my
example, "show tables" still works. Meanwhile, my first command window which
starts derby network server is listenning on port 1527. It seems derby is
still alive.

What does ERROR XJ015 actually mean? Is it possible to shutdown derby
network server from ij, and how?

Your help is high appreciated!

-- 
Best regards,

Han Hong Fang

Re: Can derby network server be shutdown from ij?

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
han hongfang <ha...@gmail.com> writes:

> My understading is ERROR XJ015 means that derby system is successfully
> shutdown.
>  
> But why after derby shutdown I can still see other commands working.

The Derby system shutdown brought down the database engine. However, the
next connect command booted the database again.

> In my
> example, "show tables" still works. Meanwhile, my first command window which
> starts derby network server is listenning on port 1527. It seems derby is
> still alive.

Yes, that observation is correct. In Derby, shutting down the database
engine and shutting down the network server are two different concepts.

> What does ERROR XJ015 actually mean? Is it possible to shutdown derby network
> server from ij, and how?

You can shut down the network server either by running

  java -jar derbynet.jar shutdown

on the command line, or by using the NetworkServerControl API. See also
this section in the administration guide:
http://db.apache.org/derby/docs/10.5/adminguide/tadminconfigshuttingdownthenetworkserver.html

You cannot shut down the network server from ij, as far as I know,
except if you write your own stored procedure that uses the
NetworkServerControl API.

Hope this helps,

-- 
Knut Anders