JDBCWizard makes complex PL/SQL Procedures accessible from Java without making
schema changes or using precompilers such as SQLJ.
JDBCWizard examines your data dictionary and writes Java source code to run
PL/SQL procedures.
JDBCWizard creates Java classes that match your database tables.
JDBCWizard can also write Java to run any SQL statement you give it.
JDBCWizard runs stand alone or as extensions to JDeveloper 10g, Oracle SQL
Developer,
Eclipse 3.4, All Round Automation's PL/SQL Developer or as a
stand alone swing application.
The Demo version of JDBCWizard expires roughly one month after you download it.
The full version of JDBCWizard gives you a 100% Java source
and SQLJ-free way of calling PL/SQL from Java.
The extension can be obtained from the following locations:
From Oracle's Update Center -
http://www.oracle.com/technology/products/jdev/101/update/exchange.xml
To use this update center select "Help/Check for updates" and select "Open Source and Partner's Extensions". Select "JDBCWizard" from the list of available extensions and follow the instructions on the screen.
From our Update Center -
To use this update center select "Help/Check for updates" and select "Orinda Software Update Center". If the Orinda update Center is not on your list you can add it by clicking on the "Add" button and entering "OrindaSoft" in the Name field and " /public/jdev11gCenter.xml" Select "JDBCWizard" from the list of available extensions and follow the instructions on the screen.
By downloading the stand alone version of the JDBCWizard demo from here.
You will have to restart JDeveloper in order for the extension to be loaded. You can check that the extension has been installed by selecting "Help/About/Extensions". JDBCWizard should appear in the list of loaded extensions.
Your demo copy will expire roughly one month after you download it. You can then download the demo again. This does not happen if you buy a full copy. You can find out the expiration date of your demo by looking at the "JDBCWizard Configuration" section in the "Tools/Preferences" menu.
To upgrade your demo use one of the download sites mentioned above.
There are two ways to use JDBCWizard
To do this select "File/New" and add an JDBCWizard configuration file. When you open this file the JDBCWizard GUI will open with default values for the connection information. Provide appropriate values and select "Connect" to login to Oracle and enagle the rest of the GUI.
To do this go to the Connections Navigator and open an Oracle database connection. An JDBCWizard Folder will appear beneath the schema. A default configuration file is automaticly created for you. You can create additional JDBCWizard files by right clicking on the JDBCWizard Folder. To start the JDBCWizard GUI double click on a configuration file.
The GUI Consists of 4 tabs and a "Generate" button. The tabs are used to select objects to generate Java for and to define what features the generated code will have.
This tab has the following fields:
| Field |
Requires |
| TCP/IP
Hostname |
The
hostname or IP address of the database server. |
| Oracle
SID |
The
Oracle instance identifier. |
| SQL*NET
Port |
The
SQL*NET port used by the Oracle Listener, usually 1521 |
| Oracle
User |
Your
Oracle username. |
| Oracle
Password |
Your
Oracle username's password. |
Note:
This tab does not always appear when using configuration files associated with database connections.
The 'Select Objects' page allows the user to select database
objects
and SQL files to generate code against.
Note: If
you
use a wildcard character, wait until JDBCWizard completes the
retrieval
of all selected objects.
| Field |
Description |
| Owner |
The
owner of the resource. If this is a synonym, this will be your
username. If you have access rights to an object owned by another user, you see their username. The name PUBLIC means that the resource is a publicly owned synonym. |
| Name |
The
name of the object or the synonym name. For procedures inside packages,
JDBCWizard
adds the package name to the beginning of the procedure name. If
another
procedure exists with the same name but different parameters the name
will
be followed by " overload n". |
| Selected |
Choose
this check box to add the object to the list of objects that require
generated
code. |
| Accessed
Via |
There
are four methods ways of accessing objects:
|
| Real
Owner |
The
actual owner of the selected object. |
| Real
Name |
The
actual name of the selected object. |
| Field |
Description |
| Line
# |
The number of the line in the SQL file that the parameter was found on. |
| Parameter
Name |
The
Name that has been given to this parameter. This must be a valid Java
identifier.
When first selected the name will default to 'ParamX' where 'X'
is the number of the parameter.If the same parameter name is reused it
will
be assumed that there is one parameter that is used in multiple
locations.
If This field is greyed out it means that the Parameter name has been
set
by a Hint in the SQL Statement. |
| Parameter
Data Type |
In
addition to naming parameters you must also specify a data type. The
list
allows you to select from the following:
|
where
e.empno
= ? /* empNumber NUMBER */ |
where
e.empno
= &empNumber /* NUMBER */ |
/* ... */"
| Field |
Description |
| Owner |
The
owner of the table. In the case of a synonym this is your username. If you have access rights to a table owned by another user, you see their username. The name PUBLIC means that the table is a publicly owned synonym. |
| Name |
The
name of the table or the synonym name. |
| Selected |
Choose
this check box to add the object to the list of objects that require
generated
code. |
| Accessed
Via |
There
are four methods ways of accessing objects:
|
| Real
Owner |
The
actual owner of the selected table. |
| Real
Name |
The
actual name of the selected table. |
The 'Code Options' page allows
you
to control the code that is generated:
| Section |
Option |
Purpose |
||||||
| Messages
in
generated code |
Debug
Messages in code |
Adding
debug messages to the generated code |
||||||
| Other
Messages in Code |
Adding other messages to the generated code | |||||||
| Comments in generated code |
Comments
in Code |
Adding
detailed comments to the generated code. |
||||||
| Maintain usage statistics |
Maintain
Usage Statistics |
Generating
JDBCWizard performance metrics. Each generated class implements the
StatsInterface
Java Interface. |
||||||
| Naming convention for generated files |
Java
Naming Convention |
Choosing
the naming conventions for generated Java files:
|
||||||
| Target version of Oracle | Oracle Version | Generating code optimized for
one
of the following versions of Oracle: 8.1.5, 8.1.6, 8.1.7, 9.0.1, 9.2.0, 10.1.0, 10.2.0 |
||||||
| Use the following numeric data types |
A checkbox for each of the
following
Java data types:
|
Whenever JDBCWizard is writing
a
method for passing numbers to or from a procedure, SQL statement or
table
its default behaviour is to generate a seperate method for each of the
data
types on the left. By unticking the appropriate checkboxes it is
possible
to prevent JDBCWizard from generating code with datatypes such as short,
which are rarely used in practice. This feature was added in build
4.0.1709 |
||||||
| Table
Specific Options |
Check columns before insert or
update |
If checked generated table access code will make sure that all non-null fields have values and that numeric fields do not have decimal places if they aren't supposed to. This feature was added in build 4.0.1709 | ||||||
| Create TYPE definitions for tables in a file called 'extraObjects.sql' | If checked a SQL file called
'extraObjects.sql' will be created in the
'tables' subdirectory of the generated code. This file contains
matching oracle TYPE definitions for the tables selected earlier. For
each table it will create a record type and an array type. This code is provided to assist developers who need to pass arrays into PL/SQL procedures. Because of limitations in JDBC the only kind of array of records that can be passed from Java to a PL/SQL procedure is one that uses ORACLE TYPEs. For further information on this subject see the manual entry for Working with PL/SQL Arrays that can not be directly accessed by JDBC. This feature was added in build 4.0.1935. |
The Service Options screen allows you to
Enter the path to the directory on your computer for the generated code.
Enter the package name for the generated code. In the previous illustration, JDBCWizard generates code in the following directory:
| C:/Test3/com/yourcompany/yourproduct |
In addition to creating classes for each procedure and table in your database JDBCWizard can also create a single Data Access Object Factory class that handles logging, database connections and the creation of access class instances.
This step has the following options:
| Option |
Purpose |
| DAO Factory Class Name |
The name of the class. This can be any valid Java class name.If this field is blank no field will be created. |
| Log messages using... |
There
are five ways of logging messages
|
| Log name/Directory |
|
| Get DB Connection using... |
There
are four methods of obtaining a Connection:
|
| Connection Name |
An Oracle thin driver connect string or the
name of the DataSource in JNDI |
| Implement javax.ejb.SessionBean |
If selected the generated class will
implement the SessionBean interface. |
| Add 'finalize()' method |
If selected the generated class
will have a finalize method that releases database resources. |
| Close Connections |
Close connections when releaseConnection()
is called |
| Commit Connections |
Commit connections when releaseConnection() is called |
| Temporary Directory |
Location for temporary files
when working with LOBS. Can be a real operating system directory or a
System property such as 'user.dir'. |
| Temporary File Prefix/Suffix |
Prefix and suffix used by
temporary files. |
Full information on how to use the DAO Factory class is available in the DAO Factory Manual section.
The 'Create Web Services' checkbox controls whether Web Services classes are created or not. The other options are:
| Option |
Purpose |
| Interface Class Name |
The name of the interface class that
contains web service methods |
| Implementing Class Name |
The name of the class that implements the Web Service |
| Number Type used by service |
By default generated code will use
java.math.BigDecimal to represent numbers, as this is the closest
match in Java to Oracle's number datatype. For convenience JDBCWizard
can also use the following data types to represent numbers in Web
Services code:
|
| Always release database connection after call. |
If selected releaseConnection() will be called after each service method call. |
| Add pre call code stubs |
An empty method is created that is called by
each service method just before execution. By extending the
implementing class and overiding this method users can add custom
functionality without modifiying generated code. |
| Add post call code stubs |
An empty method is created that is called by each service method after execution. By extending the implementing class and overiding this method users can add custom functionality without modifiying generated code. |
| Web Service Record Type |
Generated web service records can either be:
|
| Uploaded BFILE naming is abstract |
JDBCWizard will write code that under some circumstances allows the creation of BFILEs by web services. This option gives the user control over how BFILEs are named. For more information see Creation of BFILEs using a Web Service |
Full information on how to use the Web Services classes is available in the Web Service Manual section.
Pressing the generate button saves your configuration and results in Java code being generated to match your selected objects. If you are using JDeveloper 10.1.3 JDBCWizard libraries will be added to your project.
An Oracle JDBC driver is required to use the generated code.
All generated code will require a copy of the com.orindasoft.pub library.
A demo version of this is included in the JAR file containing the extension. Add this Jar file to your CLASSPATH.
This is done for you if you are using Jdeveloper 10.1.3.
If you buy JDBCWizard you get the source for this library.
JDBCWizard has additonal libraries for Apache Log4J or Java 1.4's
java.util.logging. If you select Log4j
or java.util.logging as log types you will need to add the
appropriate library class to your CLASSPATH. The libraries are in a subdirectory in the Extensions's directory.
This is done for you if you are using Jdeveloper 10.1.3.
To access this screen select "Tools/Preferences" and then "JDBCWizard Configuration". This window contains the current licence code, the expiration date and product build information. The only editable field specifies where Configuration Files associated with database connections are kept. There are also hyperlinks to JDBCWizard's documentation and purchase pages.
This extension works with Oracle JDeveloper 11g.
Do not try to use the JDeveloper 11g extension with SQL Developer or vice versa. They have the same names but are different internally.
More information is obtainable from the JDBCWizard Documentation page. The support and FAQ are also useful. Information on purchasing JDBCWizard is available here.
JDBCWizard comes with a demo schema. To obtain your own copy of the tables, procedures and data you will need to download a version of JDBCWizard that uses a windows installer from here.