I’ve created a JEE6 web design using glassfish as the container and runtime enviornment, derby as the database and it’s all managed in Eclipse. This is working great.
My question is how do I now access the database directly independent of Eclipse of Glassfish. Say I wanted another completely foreign program to have access (not through my controller–completely independent of Eclipse and Glassfish). How would I do this?
They seem so tightly integrated that I don’t know if it’s even possible. I looked for the Derby installation through the file system and it is located inside of the Glassfish folders.
or what if I wanted to just update the database from a command line or linux terminal outside of Eclipse.
Thanks
Assuming you know the location of the Derby database of interest, you can simply write a standard JDBC application, include derby.jar in the classpath, register org.apache.derby.jdbc.EmbeddedDriver with the DriverManager, and connect to the URL “jdbc:derby:/path/to/the/derby/database/directory”.
Then away you go!