0

I have an application in JAVA that connects to HSQLDB and need to be installed, i made that app and works fine, but when i put my code on the Programs and files folder, the HSQLDB cannot edit the lock property and cannot open the software =(

i know that is Windows security, but, is there a way to make the folder who contain my database editable?(c:programs and files\mySoftware\database) Like in PHP, using chmod...

Thanks!

fredt
  • 24,044
  • 3
  • 40
  • 61
Douglas Caina
  • 932
  • 10
  • 8

1 Answers1

0

You are using the wrong approach. Instead of making a folder editable, you need to put your files to application-specific folder under \Users\All users\AppData\yourapplication (in Windows 7) or \Users\Profilename\AppData\yourapplication folder. The path to this folder is obtained via Windows API (don't know what Java offers in regards to Windows-specific API, sorry) function named SHGetFolderPath. You need CSIDL_APPDATA or CSIDL_COMMON_APPDATA paths there.

Community
  • 1
  • 1
Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
  • 1
    The HSQLDB file path can reference the Java user.home directory with a "~" symbol. For example "jdbc:hsqldb:file:~/yourapplcation/yourdb" – fredt Dec 11 '12 at 19:36