Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Database connection

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For connecting to the database I display a dialog which allows the user to select whether they would like a local or remote database connection. If remote is selected I display a text field which allows the user to enter the hostname of the machine wishes to connect to. I was wondering, for the local mode, if I should allow the user to select the db.db file to connect to i.e. with a file chooser dialog
Any suggestions would be appreciated
Brian
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I was wondering, for the local mode, if I should allow the user to select the db.db file to connect to i.e. with a file chooser dialog


The requirements are very clear, -- in local mode, the user must be able to specify the location of the database.
Eugene.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Eugene Kononov:

The requirements are very clear, -- in local mode, the user must be able to specify the location of the database.
Eugene.


Must? I never saw that, and in my submission I hard coded the location of the db.db file, user cannot specify the location and didn't lose any points.
Mark
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Must? I never saw that, and in my submission I hard coded the location of the db.db file, user cannot specify the location and didn't lose any points.


Perhaps your assignment was different. Did you have this in your instructions: ".. 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"?
Eugene.
[ February 24, 2003: Message edited by: Eugene Kononov ]
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes in the Network approaches section. And I took it to mean which mode to be in.
The Location of the database is it locally or remotely.
So my start of the client was either
"java -jar client.jar" for local mode
or
"java -jar client.jar <<serverAddress>>" for remote mode. This fulfilled that requirement.
Mark
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic