I want to work with a file-based database using apache derby. I was wondering if anyone can carify how to connect & create this database using netbeans as an IDE. I pass
Most certainly the driver that you want to use is the embedded driver in derby.jar. Rather than getting into the "coding side of things" as there are enough examples running about, I kind of like to use netbeans itself to do everything up prior to starting the coding.
Since I use the embedded approach to convert wireshark / tcpdump / nmap files into database entries, I kind of use a slightly different approach.
Since I prefer to us the latest stable versions of Derby instead of the installed version I have a slightly different approach which allows me to use whatever version I desire as well as putting the database in a r/w data directory where ever I want in the file system.
pwd
/version pwd
/latest.pwd
/latest pwd
From here on you can do everything in netbeans:
When you get into coding, just add in the ASF-Derby-Emb Library and it will be automatically copied into your 'dist.'
Now set up the JavaDB.
Just by changing the database location you can put a database where ever you want it. Or you can accomplish the same thing in code as the url is: jdbc:derby://database location directory.
Any way, now I can setup my database.
From this point there are three choices:
Personally, (2) I find to be the best approach, initially. If you have pre-existing sql scripts with the the .sql extension the simply by opening them under the project, they will be loaded into the sql editor and can be executed there.
Alternatively (3) can be used and the resulting script saved.
Any way, much can be created before the coding begins. There are a lot of ways to do it. I would much rather have all created before coding -- it makes developing test cases much easier and using the preceding I don't have to jump in and out of netbeans to modify things.