Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database Selection Question

 
Ulises Pulido
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • 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?
 
christian combarel
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
Geoff Prest
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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!
 
K. Tsang
Bartender
Posts: 3348
12
Android Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic