Setting Up the "sun-appserv-samples" Database
By Geertjan-Oracle on Aug 22, 2013
When you start up NetBeans IDE, you're automatically given a Java DB database named "sample", which unsurprisingly includes some sample data:
However, you have access to another database, should you need it, via utilities provided by GlassFish. Right-click the GlassFish node in the IDE and choose "View Domain Admin Console", as shown here:
Once the Admin Console has started up in your browser, navigate to Resources | JDBC | Derby Pool, as shown below:
Click the "Ping" button that you see above. Then, the database defined in the "Additional Properties" tab, shown below, will be created, automatically, i.e., during the process that's started when "Ping" is clicked. By default, as you can see below, that database is named "sun-appserv-samples".
In the IDE, then go to the Services window, and right-click "New Connection". Now you can register your new database, i.e., the one created above:
Here's what you need to set to specify after click Next above:
You now have your new database registered in the IDE:
However, a simpler approach, from a NetBeans IDE point of view (i.e., not everyone uses NetBeans IDE, so in those cases using the Admin Console for this purpose is useful) is to right-click the Java DB node in NetBeans IDE and choose "Create Database" and then create the database from there, within the IDE.