Starting the Java DB in Glassfish

I’ve been doing a lot of development in NetBeans 5.5 beta 2 recently using Glassfish as my target application server. When doing development, its often quite useful to use the Derby DB bundled within Glassfish. As you’d expect from a modern IDE, NetBeans makes this easier for you by starting the database automatically so you don’t need to worry about it. When you deploy your application to a standalone Glassfish that isn’t “controlled” via NetBeans, you will probably find that the Derby DB doesn’t start automatically when Glassfish starts. Starting the DB is easily done from the command prompt though using the command:

asadmin start-database