• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Server database file location

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When running the application in server mode, where should the server locate it's database file? The database-file provided together with runme.jar? Or a another database file merged in inside the runme.jar?

If the answer is yes to one of this questions, what's the best way of locating this file assuming that the java command is executed in another directory than the runme.jar?

I don't have (and do not wan't) any GUI or properties configuration whatsoever running in server mode.

Thanks!
 
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Maximilian Heva:
I don't have (and do not wan't) any GUI or properties configuration whatsoever running in server mode.

Thanks!



Its a requirement to allow the user to specify the database location in a configuration GUI and then to store this value in a properties file.

Mark.
 
Maximilian Heva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've understood the requirement of the user selecting the database file only applies when running the client in standalone mode...
 
Mark Smyth
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.




the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely. No authentication is required for database access.



I can't see anything in either of these two statements that suggests that the user should only specify the location of the database file in local mode. The only mention of local mode is that no network code should be used to access a local database.

It also makes sense that if you can specify a database in local mode then this also should be available in server mode. What about if you have to switch to a backup file because of a corrupted db for example?

Mark
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, you don't mean specified by path (like c:\temp\myDBFile.db)? You mean just the Database itself, e.g. myDBFile.db or my2ndDBFile.db. The path-location of the databases are define in a property?
 
Maximilian Heva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess I'll need a GUI for the server with buttons for start and stop server and a filechooser for the database file (the path of the file) to run against.
I do not see any other way to do it....

The property file will contain path values for client standalone database file as well as server database file.

thanks
 
Mark Smyth
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Maximilian Heva:
I guess I'll need a GUI for the server with buttons for start and stop server and a filechooser for the database file (the path of the file) to run against.
I do not see any other way to do it....

The property file will contain path values for client standalone database file as well as server database file.

thanks



You still needn't have a GUI, you can pop up a JDialog and take in the properties this way. Once this is done you can discard the dialog and have a command line server.

To do this you will need a JFrame reference to use as the parent window for the dialog. In my app class I have a window object that is a JFrame instance. In server mode it is my intialised as the serverGUI and in local and network mode it is intialised as the client GUI.

If you don't wish to have a serverGUI this reference can be null in server mode, however even a null JFrame object can still be used as the parent for a JDialog so you can have a server properties GUI and a then a command line server once the properties have been displayed.

Hope this helps,
Mark

Mark
 
Maximilian Heva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your suggestions. Although I believe a pop-up is a kind of GUI...

Anyway, if someone has implemented a non GUI server, I would be happy to
receive any ideas how/where to locate the server database file....
reply
    Bookmark Topic Watch Topic
  • New Topic