I am learning Java, and I am looking to have a stand alone application with a database to store some simple information. I installed Netbeans and I am using Oracle JDK 8. Will JavaDB work as an embedded db?
just to be clear and embeded db means I don't have to connect to a server like postgresql or mysql right?
Is Javadb another name for apache derby or vice versa?
Java DB is included in the JDK from Java 6 onwards. It's an embedded database, meaning if you compile your program for distribution to a user, the database will be included. It works great for small, standalone type apps. PostgreSQL or MySQL are not required to use Java DB. PostgreSQL or MySQL would require more complex configuration setups, so if your goal is to learn Java not databases, I would stick with Java DB for the time being. Once you are comfortable with how Java works with databases, then look at learning to configure a PostgreSQL or MySQL database for connection to Java.
I wouldn't say Java DB is another name for Apache Derby, though, technically. The Java DB product includes Derby without any modification whatsoever to the underlying source code, but I believe Oracle has added wrapper code to help simplify the configuration with Java. From a usability perspective, Java DB and Derby have the same functionality and therefore the Java DB documentation often refers to the core functionality as Derby.
Ronald Guilmet wrote:Will JavaDB work as an embedded db?
Definitely! But there are several other Java SQL database which can be used as an embedded database. For example: H2 and HSQLDB (HyperSQL DataBase). And here you'll find a performance comparison between the embedded databases H2, HSQLDB, and Derby.