Orindasoft

JDBCWizard Getting Started Guide

Getting Started With JDBCWizard

JDBCWizard Logo

Fundamentals

  • JDBCWizard is not an IDE - it doesn't help you write PL/SQL, SQL or Java. Instead it writes Java to run your existing PL/SQL procedures and SQL statements.
  • JDBCWizard is a Java Swing application.
  • It writes Java source code for database objects selected by the user.
  • It can write Java to access Tables, Procedures, Functions, Packages and Sequences.
  • It can also write Java to run any SQL statement.
  • JDBCWizard can also generate a DAOFactory Class and Web Services classes
  • An example  and all the generated code it uses is available here.
  • A 3 minute Macromedia Flash presentation (1.1MB) can be found on our web site.
  • JDBCWizard generated code uses a utility library called com.orindasoft.pub, which comes with the product.
  • If you buy JDBCWizard you get the source code for com.orindasoft.pub.
  • There is no run time component to JDBCWizard.
  • JDBCWizard does not use SQLJ

 

JDBCWizard - The 15 Minute Tour

Setting up

  • Find an Oracle database you want to generate code for.
  • You'll need -
      • Hostname or IP Address
      • Port number
      • SID (Database Identifier)
      • Oracle username and password.
  • JDBCWizard includes a zip file that contains a demo database (JDBCWizard.emo.zip).
  • Create a directory full of files containing the SQL statements you wish to call from Java.
      • Each file should contain 1 SQL statement.
      • JDBCWizard will recognize parameters in JDBC format ('empno = ?') or Sql*Plus format (empno = &empno).
  • Start JDBCWizard and log into the database.
  • When you have logged in start using the Tabs on the screen in order:
  • The first tab controls who you are logged in as. The other tabs don't work if you aren't logged in.

 

Login Screen

 


Finding things to create code for

  • The second Tab is used to pick things to generate code for. 
  • The "PL/SQL Packages, Procedures and Functions", "Tables" and "Sequences" tabs allow you to select items you want to generate code for by ticking a box next to the object's name.

 

Step 2

  • The "Sql Statements" tab allows you to pick SQL statements to create Java code for.
  • Use the "Find Directory" button to select the directory containing your SQL statements.
  • Use the "Generate Matching Class" button to create Java for a SQL statement
  • You can usually assign a name and data type to parameters.
    • See the online manual on how you can use comments to force JDBCWizard to use a name/data type

 

step 2

 

Specifying options for generated code

  • Once you have selected your procedures and SQL statements use the "Code Options" to alter the appearance, name and behaviour of generated code.

 

code optiona screen

 

  • The "Service Options" screen allows you to define both a Data Access Object Factory class and Web Service classes.
    • The DAO Class provides objects that represent database tables, stored procedures and SQL statements. You use 'set' and 'get' methods to pass parameters in and out. 
    • The Web Service classes call procedures or SQL statements with a single method call that access input parameters and returns an object that contains output parameters. The classes do not repreent a complete web service themselves but can be plugged into a product such as Apache Axis.

 

file options

 

Generating and using the code.

  • The fifth tab allows you to start the code generation process

 

generate code

 

To use generated code

  • Make sure your classpath has an Oracle JDBC driver.
  • make sure the generated code is on your classpath.
  • Add the com.orindasoft.pub library (e.g. OrindaBuildpub920.jar) to your classpath.
  • Import com.orindasoft.pub.*
  • Import your generated classes.
  • Create an instance of a DAOFactory or DAOFactoryServiceImpl (web service) class.
  • Use the class to access your database.
  • A simple example can be found on the web here
  • A detailed example can be found on th web here
  • The generated source code for the detailed example can be found here
  • Don't worry about the details of the com.orindasoft.pub API until you have checked out the other documentation first

 

 

 

 

 

 

 

JDBCWizard Logo