0

Hi this might be a really stupid question Im building a java fx application that is connected to a local mySQL database for a college project. but i have a problem and cannot think of a solution.

here is the conundrum its bad practice to store images in blob form in the database you should instead use directories i don't know much about directories but im fairly certain that the file path changes from computer to computer depending on where the app is unziped. So how can i build a directory of images that will have the same file paths on my lecturers computer. as i said i don't know directories and may be wrong.

edit: Im still fairly noobish and have no idea on how to export the project as .jar and my lecturer will need to see the code so i would be able to figure out the .jar bit but would i need to send a .zip of the compressed raw project folder?

any help is much appreciated

JavaScrub
  • 133
  • 9
  • 2
    You can keep your resources locally and refer to them using a relative file path. – msitt Apr 25 '17 at 19:14
  • 1
    "Depending on where the app is unzipped". Typically a (standalone, desktop) Java app would be run from a jar file, without unzipping it. If the images are "fixed" you can just include them as resources in the jar file and [load them as resources](http://stackoverflow.com/questions/34755630/javafx-location-is-not-set-error). OTOH, if the images are not known at compile/build time (e.g. they are supplied by the user), you would probably create a specific folder on the user's system (e.g. in the user's home directory) in which to store them. – James_D Apr 25 '17 at 19:16

0 Answers0