GaaborMarkt

A live demo website by Jozsef Gabor based on Java and powered by db4o. It uses the Apache Click framework.

http://www.gaabor.com/

Interview

Check the interview with Joszef to get tips to use db4o in web applications

InterviewJozsefGabor.Pdf (Details)
Download (35.3kB)

 

Integration Example

The zip file below contains an example for integrating db4o into a web application.
The example contains  a demo servlet which displays a list of Content objects read from a db4o database. These content objects are created in the init method of the servlet.
The location of db4o database repository is specified in the web.xml file.

How to run the example:

1. Create a web application project in Eclipse WTP

2. Specify a context path for the application e.g. integration

3. Check the database location in web.xml

4. Run example servlet http://localhost/integration/demo

Db4oIntegration.Zip (Details)
Download (2.6MB)

 

OrderService Example

The zip file below contains an example for developing a service layer with db4o database.

The example is an order service component of a web application.

The customer order is defined by the Order class. A product within the order is represented by  OrderItem instances.
A single Order can contain several OrderItem instances.
The OrderItem instance has predefined fields such as orderId and custom fields.
The custom fields are stored in a hashmap.

The service methods are defined in the OrderService interface.
Service methods can throw an OrderServiceException.

Some of the service methods return an OrderResult instance.
This object can be used if you need to page through large number of orders.

The implementation of the service methods are defined in the OrderServcieImpl class.
The implementation contains two queries for selecting orders by user id and order processing state.
These queries are db4o native queries (please see OrderQueryByState and OrderQueryByUser).
The results of a database queries can be sorted by creation time. Please see OrderCreatedComparator.

In addition the OrderServiceTest class contains Junit tests that demonstrates the usage of service methods.

Order-Service-Sample.Zip (Details)
Download (9kB)