• 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

Database Selection Question

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

First of all Happy New Year!, second, I have a question I hope you can help me with, The thing is about the statement "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", does this mean that the user can select the database in case that the db file is in the same computer as the GUI is running but it will only put the IP Address and port in case of a networking connection ?

I mean:
1) Select a database in the same machine and bypass the networking
2) Set an IP Address and a port to be used for networking (Not selecting where the database is in the server side).


Am I correct?
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

1) Select a database in the same machine and bypass the networking
2) Set an IP Address and a port to be used for networking (Not selecting where the database is in the server side).



You're right !

... it must also accept an indication that a local database is to be used


Just indicate in your connection GUI that the database is a local one (in my opinion)
 
Ulises Pulido
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have another question regarding this issue.

I believe that using a property file where the database path can be stored is enough to store the file path to the database during database selection, and retrieve this property to load the database.

Also use this same property file to store the network preferences like IP Address and port used in case of a network connection.

Is there a restriction in using properties files in the project do you know ?


Thanks a lot for your comments

Regards!
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulises

I'm still working on my submission, but from what I've read here on the ranch it is very dangerous (read automatic failure) for your application to rely on the existence of the suncertify.properties file.

A post that eased my concerns about this can be found here.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, no, no. It's not dangerous at all

In the post the guy says "... if not would it be an automatic failure.", but he's actually asking (he used . instead of ? after the phrase!). What needs to happen is, this file is NOT included in the final .jar file. This file is generated in the same working directory of the application. In my case, I used the suncertify.properties file to store all properties of the 3 modes. In standalone mode, I just ask for the .db file location. In server mode, I ask for the .db file location and in which port the server will run. In client mode, I ask for the server IP address and the port in which the server is running.

Take a look at this thread. I think it might be helpful!
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi having read this I have a question. Why does the database path is needed for server mode? Shouldn't the server's database file already be set? Like clients running the network mode don't care where the database is on the server computer as long as they connected to the serve itself. Right?
 
Ulises Pulido
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

K. Tsang wrote:Hi having read this I have a question. Why does the database path is needed for server mode? Shouldn't the server's database file already be set? Like clients running the network mode don't care where the database is on the server computer as long as they connected to the serve itself. Right?



Hi

I believe Roberto is right, I mean when you start in server mode you are only initianting the server, but the server itself does not know where your db file is until you set it, if you are using your GUI only then you have to specify the server hostname/IP Address and port only because the server already is set up with the values provided to it.


I hope this helps
reply
    Bookmark Topic Watch Topic
  • New Topic