Setting Up the "sun-appserv-samples" Database

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.


Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« February 2015