SQL Developer Examples
We are currently using jdk1.8
You'll need a copy of SQL Developer both as a deployment location for testing and as the source for required library files.
Currently the SQL Developer examples are part of a larger set that must be downloaded together.
- Go to the main oracle-db-examples page,
- Select the green Clone or download button,
- and then the Download ZIP button.
- unzip the file somewhere (we only really need the sqldeveloper folder)
If you plan to build the Dependency Example, you will also need:
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.
-
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.
If/when you plan to build the Dependency Example, see that page for additional set up requirements.
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.
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.
cd <where you put examples>/sqldeveloper/extension/xml/packaged
ant _deploy
cd <where you put sqldeveloper>/sqldeveloper/bin
sqldeveloper -clean
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
- Select Install From Local File(s)
- Browse to /sqldeveloper/extension/xml/packaged/built/cfu and select the zip file
- Select Next, then Finish on the next page
- Accept SQL developer restart