mary jhane wrote:*so, what is the use of [;shutdown=true] in your installer??
This string shuts-down the HSQLDB server app upon closing the last connection. I included the string by default for server-mode as a single-user consideration. Server-mode allows you to move the database folder without changing the data-source URL, unlike file-mode. And server-mode remains running if Base crashes adding yet another layer of data protection. So server-mode is quite useful in single-user environments. Multi-user environments are typically setup by more advanced users that don't mind digging into tutorials and performing the file surgery in order to support a persistent client-server setup of HSQLDB.
mary jhane wrote:*im confuse in rewritting it, because i need time in management or policy in the server
how i shutdown, automatically without pressing the stop or starting it without pressing the start?
No modification of these files is necessary for such tasks. Simply create a
Windows XP scheduled task that runs START.vbs daily at 6am, and another that runs STOP.vbs daily at 5pm, if you wish. But you should be aware of some considerations when
shutting down the server app. The STOP script issues the SQL 'SHUTDOWN' command which rolls-back any transactions still in-progress. And since it's the end of the day, it may be better to issue 'SHUTDOWN COMPACT' which is already available in the next line of the associated batch file (server.stop.bat).
See the following changes to
server.stop.bat in
red:
server.stop.bat wrote::::::::: Issue the "shutdown;" command to hsqldb
:: set sql=--sql "shutdown;"
:::::::: "shutdown compact will reduce the space required and may improve access times" - HSQLDB documentation
set sql=--sql "shutdown compact;"
mary jhane wrote:*You need to open START or server.start to open "mydb.server.odb" in the sever
The
START.vbs script simply runs
server.start.bat silently (without exposing the command-line window).
Similarly,
STOP.vbs simply runs
server.stop.bat silently.
mary jhane wrote:i am now trying the Standalone Forms / Switchboard
*if i do it in the base, and exporting it, the sub forms/ sub sub form & etc... need a data source and if you do it in writer and connect it to the base the sub form dont need the data source
That's correct. If you export the Base Forms, they will need to be reconnected to the data-source at the DataForm level (each MainForm & SubForm). If you leave the Forms inside the Base (.odb) file, then you can create a Push Button in a Writer document to open the Base file (which opens the Base GUI) and access the embedded Forms...thus, no re-connection is necessary. Unless I'm missing something here...?
mary jhane wrote:and what if im gonna use 2 database? example 1 for accounting and 1 for faculty?
what is the set up for that?
HSQLDB 1.8 supports up to 10 databases simultaneously, while HSQLDB 2.x supports an unlimited number.
Check
the documentation for setup instructions, but as I recall it (
server.start.bat) would look something like:
server.start.bat wrote:@echo off
REM The database name is reflected twice after the 'CONTINUE' label below
set java=Java\jre6\bin
set jar=openoffice.org 3\Basis\program\classes
IF EXIST "%PROGRAMFILES(X86)%" GOTO Win64
:Win32
set javapath=%PROGRAMFILES%\%java%\Java.exe
set jarpath=%PROGRAMFILES%\%jar%\hsqldb.jar
GOTO CONTINUE
:Win64
set javapath=%PROGRAMFILES(X86)%\%java%\Java.exe
set jarpath=%PROGRAMFILES(X86)%\%jar%\hsqldb.jar
:CONTINUE
rem start mydb.server.odb
"%javapath%" -cp "%jarpath%" org.hsqldb.Server -database.0 file:accounting dbname.0 accounting -database.1 file:faculty dbname.1 faculty
rem ;hsqldb.default_table_type=cached
rem Evidently switches are not allowed when running multiple databases in this manner
rem Therefore manually edit the .properties or .script files as appropriate to reflect 'cached' as desired
rem (HSQLDB 1.8: .properties) hsqldb.default_table_type=cached
rem (HSQLDB 2.x: .script) SET DATABASE DEFAULT TABLE TYPE CACHED
REM pause
exit
And of course, the database names must be reflected in their associated file naming convention, etc. I would have to experiment because I haven't messed with multiple databases since I first started playing with server-mode a couple of years ago. I don't remember if the alias names (dbname.X xyz) are necessary with multiple databases, etc. I just don't remember the details.
With more than one database, you may need to shut them down individually. The following seems to work. Here's the
changes to
server.stop.bat in
red:
server.stop.bat wrote:@echo off
set java=Java\jre6\bin
set jar=openoffice.org 3\Basis\program\classes
IF EXIST "%PROGRAMFILES(X86)%" GOTO Win64
:Win32
set javapath=%PROGRAMFILES%\%java%\Java.exe
set jarpath=%PROGRAMFILES%\%jar%\hsqldb.jar
IF EXIST "*.tmp" set jarpath=%PROGRAMFILES%\%jar%\hsqldb2\sqltool.jar
GOTO CONTINUE
:Win64
set javapath=%PROGRAMFILES(X86)%\%java%\Java.exe
set jarpath=%PROGRAMFILES(X86)%\%jar%\hsqldb.jar
IF EXIST "*.tmp" set jarpath=%PROGRAMFILES(X86)%\%jar%\hsqldb2\sqltool.jar
:CONTINUE
:::::::: Localhost server with user=SA, without password (HSQLDB 1.8 only)
:: "%javapath%" -cp "%jarpath%" org.hsqldb.util.ShutdownServer
:::::::: Issue the "shutdown;" command to hsqldb
set sql=--sql "shutdown;"
:::::::: "shutdown compact will reduce the space required and may improve access times" - HSQLDB documentation
:: set sql=--sql "shutdown compact;"
:::::::: Localhost server with user=SA, without password
set authentication1=--inlineRC url=jdbc:hsqldb:hsql://localhost/accounting,User=SA,Password=
set authentication2=--inlineRC url=jdbc:hsqldb:hsql://localhost/faculty,User=SA,Password=
:::::::: Localhost server with user=SA, with password prompt
:: set authentication=--inlineRC url=jdbc:hsqldb:hsql://localhost,User=SA
:::::::: Localhost serving multiple databases using alias, with password prompt
:: set authentication=--inlineRC url=jdbc:hsqldb:hsql://localhost/mydb_alias,User=SA
:::::::: Fully automated using a separate, secured, sqltool.rc file; in user home/profile folder during shutdown
:: set authentication=localhost-sa
"%javapath%" -jar "%jarpath%" %sql% %authentication1%
"%javapath%" -jar "%jarpath%" %sql% %authentication2%
rem pause
exit
Alternatively, you can upgrade to HSQLDB 2.x and utilize separate schema within the same database, while separating the two groups (accounting and faculty) using role-based security. But that would be more complex unless you're already planning to implement
users and roles.