Skip to content

Latest commit

 

History

History
83 lines (54 loc) · 4.21 KB

File metadata and controls

83 lines (54 loc) · 4.21 KB

SQL Developer Examples

First things first: Getting the pieces

Java JDK 8

We are currently using jdk1.8

SQL Developer

You'll need a copy of SQL Developer both as a deployment location for testing and as the source for required library files.

The Examples

Currently the SQL Developer examples are part of a larger set that must be downloaded together.

  1. Go to the main oracle-db-examples page,
  2. Select the green Clone or download button,
  3. and then the Download ZIP button.
  4. unzip the file somewhere (we only really need the sqldeveloper folder)

get examples image

Third party libraries

If you plan to build the Dependency Example, you will also need:

The build environment

sqldeveloper/extension is an eclipse project directory but the examples are built using Apache ant. If you don't know or want to use eclipse, you can download ant and do everything simply from the command line.

Wiring it together

build.properties

  • extension/build.properties - Update to point to your SQL Developer installation & optionally change the owner info.

  • extension/java/SQLDeveloper.userlibraries - IF you are using eclipse, update the paths to point to your SQL Developer installation and import the library.

Third party libraries

If/when you plan to build the Dependency Example, see that page for additional set up requirements.

Making it go

If you are using eclipse, I'm going to assume you know how to import an existing project and run ant tasks but continue reading to learn about the various ant tasks and how they are used.

If you are using ant from the command line, make sure ANT_HOME and JAVA_HOME are defined for your environment and that ant is on your PATH and accessible from the command line. An example setenv.bat file to do this is in the extension folder. I included sqldeveloper on the path so I wouldn't have to navigate around.

Ant tasks

The XML Packaged example and all of the Java examples use ant to build and deploy the example. The 'heavy lifting' is all defined in buildtools so the individual build.xml files for each example are pretty simple. There only a few targets of interest:

  • _rebuild cleans and deploys the example

  • _deploy builds and deploys the example to the target SQL Developer installation (defined in build.properties). Please remember to exit out of SQL developer before running this so you don't confuse yourself. (Which I have great experience with :/ )

  • _cfu creates a check for updates bundle and associated metadata xml file in the built/cfu directory for the example.

  • resgen generates the ResourceBundle java files from the .properties files listed in resfiles.properties. Running this manually - and then refreshing the project - is only "needed" if you are using eclipse and want code completion and the error checker to know about new entries when editing java.

_deploy Example

cd <where you put examples>/sqldeveloper/extension/xml/packaged
ant _deploy
cd <where you put sqldeveloper>/sqldeveloper/bin
sqldeveloper -clean

cfu example

cd <where you put examples>/sqldeveloper/extension/xml/packaged
ant _cfu
cd <where you put sqldeveloper>/sqldeveloper/bin
sqldeveloper

Navigate to Help->Check for Updates

  1. Select Install From Local File(s)
  2. Browse to /sqldeveloper/extension/xml/packaged/built/cfu and select the zip file
  3. Select Next, then Finish on the next page
  4. Accept SQL developer restart

cfu-install-local image 1