Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/DBWS/DBWSBuilderAPI"

(DBWSBuilder API)
Line 1: Line 1:
 
==DBWSBuilder API==
 
==DBWSBuilder API==
 
<onlyinclude>
 
<onlyinclude>
The EclipseLink DBWS design-time utility, <tt>DBWSBuilder</tt>, is a Java application that generates EclipseLink DBWS files and assembles them into deployable archives. It is normally invoked from the command-line via its <code>main</code> method
+
The EclipseLink DBWS design-time utility - <tt>DBWSBuilder</tt> - is a Java application that generates EclipseLink DBWS files and assembles them into deployable archives. <br />
 
+
It is normally invoked from the command-line via its <code>main</code> method:
 +
<css>
 +
  .source-text {padding: 1em; border: 1px solid; color: black; background-color: #ffffff; line-height: 1.1em;}
 +
</css>
 +
<source lang="text">
 +
prompt > dbwsbuilder.cmd -builderFile {path_to_builder.xml} -stageDir {path_to_stageDir} -packageAs {packager}
 +
</source>
 +
The the given builder XML file is parsed:
 +
<css>
 +
  .source-xml {padding: 1em; border: 1px solid; color: black; background-color: #ffffff; line-height: 1.1em;}
 +
</css>
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 +
    <properties>
 +
        <property name="projectName">test</property>
 +
        <property name="driver">oracle.jdbc.OracleDriver</property>
 +
        <property name="password">tiger</property>
 +
        <property name="url">jdbc:oracle:thin:@localhost:1521:ORCL</property>
 +
        <property name="username">scott</property>
 +
    </properties>
 +
    <table
 +
      catalogPattern="%"
 +
      schemaPattern="SCOTT"
 +
      tableNamePattern="EMP"
 +
    />
 +
</dbws-builder>
 +
</source>
  
 
You can also set the <tt>DBWSBuilder</tt>’s properties, add table or procedure definitions and SQL operations programmatically through <tt>DBWSBuilder</tt>’s API.  
 
You can also set the <tt>DBWSBuilder</tt>’s properties, add table or procedure definitions and SQL operations programmatically through <tt>DBWSBuilder</tt>’s API.  

Revision as of 13:29, 17 April 2009

DBWSBuilder API

The EclipseLink DBWS design-time utility - DBWSBuilder - is a Java application that generates EclipseLink DBWS files and assembles them into deployable archives.
It is normally invoked from the command-line via its main method:

prompt > dbwsbuilder.cmd -builderFile {path_to_builder.xml} -stageDir {path_to_stageDir} -packageAs {packager}

The the given builder XML file is parsed:

<?xml version="1.0" encoding="UTF-8"?>
<dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    <properties>
        <property name="projectName">test</property>
        <property name="driver">oracle.jdbc.OracleDriver</property>
        <property name="password">tiger</property>
        <property name="url">jdbc:oracle:thin:@localhost:1521:ORCL</property>
        <property name="username">scott</property>
    </properties>
    <table
      catalogPattern="%"
      schemaPattern="SCOTT"
      tableNamePattern="EMP"
    />
</dbws-builder>

You can also set the DBWSBuilder’s properties, add table or procedure definitions and SQL operations programmatically through DBWSBuilder’s API.

The class org.eclipse.persistence.tools.dbws.DBWSBuilder is public and can be populated programmatically through property setters (i.e. setDriver(), setUrl()) and adding table or procedure definitions via the public addDbTable() and addDbStoredProcedure() methods; SQL operations via addSqlOperation() (NB - before adding a table or procedure definition, it is recommended that the public checkTables() and checkStoredProcedures() methods be used to ensure that the definitions are supported). Once all the data and definitions have been set, the builder is invoked through the build(...) method:

public void build(OutputStream dbwsSchemaStream, OutputStream dbwsSessionsStream,
        OutputStream dbwsServiceStream, OutputStream dbwsOrStream, OutputStream dbwsOxStream,
        OutputStream swarefStream, OutputStream webXmlStream, OutputStream wsdlStream,
        OutputStream codeGenProviderStream, OutputStream sourceProviderStream, Logger logger)
        throws WSDLException


Information pending

Back to the top