Creating EclipseLink DBWS Services Using the DBWSBuilder utility

You can use the EclipseLink DBWS design-time tool DBWSBuilder to create deployment files. DBWSBuilder is a Java application that processes the operations described in an EclipseLink DBWS builder XML file to produce all the required deployment artifacts.

Be sure to set the following environment variables in the <ECLIPSELINK_HOME>\utils\dbws\setenv.cmd (or setenv.sh file) before invoking DBWSBuilder:

$JAVA_HOME

$DRIVER_CLASSPATH

There are script files provided for invoking DBWSBuilder. They are located in <ECLIPSELINK_HOME>\utils\dbws. The scripts are dbwsbuilder.cmd for Windows usage and dbwsbuilder.sh for other operating systems.

Parameter Binding

The SQL SELECT statement for a <sql> operation may have parameters that must be bound to a datatype from the eclipselink-dbws-schema.xsd, or to any of the basic XSD datatypes. The SQL SELECT string uses JDBC-style '?' markers to indicate the position of the argument. The <sql> operation uses nested <binding> elements to match the datatype to the parameters. The order in which <binding> elements are defined must match the order of '?' markers in the SQL string:

Simple customization

Intermediate customization

The primary reason to use an EclipseLink SessionCustomizer is to enable programmatic access to the EclipseLink API. Using this API, one can retrieve the ORM or OXM descriptors from the session, and from these descriptors add, change or delete mappings. Other examples might be to
turn off the session cache or change the transation isolation level of the database connection:

Advanced customization

You can customize an EclipseLink DBWS service by creating your own project.xml and sessions.xml files.
Using your preferred tool you can map your objects to your relational database in an EclipseLink relational project, map your objects to your XML schema in an EclipseLink XMl project, and create an EclipseLink sessions.xml file that references both projects.
In this way, you can control all aspects of the relational and XML mapping. This approach is best when you want to customize most or all details. See the advanced example Creating EclipseLink DBWS Service based upon existing ORM and OXM Projects.

DBWSBuilder API

The EclipseLink DBWS design-time utility, DBWSBuilder, is a Java application that generates EclipseLink DBWS files and assembles them into deployable archives. One can also set the DBWSBuilder’s properties, add table or procedure definitions and SQL operations programmatically through DBWSBuilder’s API.