|
Bikle.com web Portfolio: http://VietEnglish.com http://Edgar411.com http://ForumGrouper.com http://hpricot.com
Ajax Demo:
Categories
of
URLs
Plain HTML
(no Ajax here): Categories:
|
-------------- History of this file: 02-21-2001 Bikle Creation of BC4Jdemo.txt 02-22-2001 Bikle Finished BC4Jdemo.txt 03-11-2001 Bikle Derived BC4Jdemo.html from BC4Jdemo.txt ----------------------------------------------------------- Dan Meets JDeveloper This contains a few simple notes about Oracle JDeveloper 3.2 (we call it JDev). Or at least that is how it started out. It is mostly a random tour by a clueless neophyte through various areas of JDev functionality which ended after a side-trip into the awe inspiring (I'm serious here) JDev help system. This document ends after it describes how we setup what we call the BC4J demo which comes with the JDev software. tip: when JDev has a form up asking for input; avoid clicking another window to do something like read mail or look something up; getting back to the input form may cause JDev to hang. We start JDev with file-close-workspace. Then we do file-new-workspace. Next right click connections and attach a jdbc connection to the workspace. For example: jdbc:oracle:thin:@localhost:1521 We try exporting the definition to a file; it fails. Possible bug? Next, new-project project containing business objects-next next next finish biz components wizard appears-next connection def appears-next initial package-next table list appears-select EMP-click-radio button-view objects click-radio button-application module next-finish-upper-menu-project-make file-new project-empty project-finish file-new....-business components data form wizard single-table, frame, next all the way through until .java gets created Eventually we find a deployment wizard which we use to create a jar file, a .bat, and a .sh we find them here: e:/jdev32/myclasses/MyProject3.jar e:/jdev32/myclasses/Profile.bat e:/jdev32/myclasses/Profile.sh A table of contents of the jar file: ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo M Filemode Length Date Time File - ---------- -------- ----------- -------- ------------------------ -rw-rw-rw- 507 22-Feb-2001 01:01:52 meta-inf/manifest.mf -rw-rw-rw- 776 22-Feb-2001 01:01:08 package3/Frame1$12.class -rw-rw-rw- 860 22-Feb-2001 01:01:08 package3/Frame1$8.class -rw-rw-rw- 864 22-Feb-2001 01:01:08 package3/Frame1$10.class -rw-rw-rw- 860 22-Feb-2001 01:01:08 package3/Frame1$3.class -rw-rw-rw- 860 22-Feb-2001 01:01:08 package3/Frame1$6.class -rw-rw-rw- 861 22-Feb-2001 01:01:08 package3/Frame1$9.class -rw-rw-rw- 746 22-Feb-2001 01:01:08 package3/Frame1$1.class -rw-rw-rw- 864 22-Feb-2001 01:01:08 package3/Frame1$11.class -rw-rw-rw- 860 22-Feb-2001 01:01:08 package3/Frame1$4.class -rw-rw-rw- 860 22-Feb-2001 01:01:08 package3/Frame1$7.class -rw-rw-rw- 773 22-Feb-2001 01:01:08 package3/Frame1$2.class -rw-rw-rw- 860 22-Feb-2001 01:01:08 package3/Frame1$5.class -rw-rw-rw- 343 22-Feb-2001 01:01:52 connections.properties -rw-rw-rw- 13492 22-Feb-2001 01:01:08 package3/Frame1.class - ---------- -------- ----------- -------- ------------------------ 24386 15 files ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Inspection of the above list reveals that the java program we just created might be named: "package3/Frame1.class" Now that we've done the deployment step; we wonder if it is possible to gain access to the .java files so we may change any code in there if nec? To run it we need to prepare an environment and then try this command: java package3/Frame1.class On UNIX, and we assume for win2k too, it would be a good idea to specify a full path to java so we don't pickup a bad one which is resident in our PATH somewhere. But, how do we create an environment? We suspect clues reside in the Profile.bat and the Profile.sh files which the deployment wizard made for us. The .bat file is displayed below: ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo @REM -- Script filename: Profile.bat @REM -- Do not make changes directly to this script!! @REM -- This script is generated and gets overwritten whenever you deploy. @REM -- Changes made directly to this script will be lost. @REM -- Use this script to set up the CLASSPATH environment variable for your deployed project. @REM -- The following archives are involved in running your project: @REM -- E:\jdev32\myclasses\MyProject3.jar @REM -- E:\jdev32\java1.2\jre\lib\rt.jar @REM -- E:\jdev32\lib\jdev-rt.zip @REM -- E:\jdev32\lib\connectionmanager.zip @REM -- E:\jdev32\lib\javax_ejb.zip @REM -- E:\jdev32\lib\dacf.zip;E:\jdev32\infobus\lib\infobus.jar @REM -- E:\jdev32\lib\LW_pfjbean.jar @REM -- E:\jdev32\lib\jbodomorcl.zip;E:\jdev32\lib\jbodatum12.zip @REM -- E:\jdev32\lib\jbomt.zip;E:\jdev32\lib\jbodomorcl.zip;E:\jdev32\lib\jboremote.zip;E:\jdev32\lib\jndi.jar;E:\jdev32\lib\xmlparserv2.jar @REM -- E:\jdev32\jdbc\lib\oracle8.1.7\classes12.zip @if X%1 EQU Xcopyto goto :copyto @REM -- When the 'copyto' target is not being invoked, this script takes a single argument, which is your archive root directory. @REM -- The default is the root directory of your JDeveloper installation. set __CLASSPATH_ROOT_DIR__=%1 if X%__CLASSPATH_ROOT_DIR__% EQU X set __CLASSPATH_ROOT_DIR__=E:\jdev32 @REM -- Initialize CLASSPATH to point to your deployed archive. set CLASSPATH=%__CLASSPATH_ROOT_DIR__%\myclasses\MyProject3.jar @REM -- JDK classpath (java version "JDK1.2.2_JDeveloper") set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\java1.2\jre\lib\rt.jar @REM -- Add classpath from library 'JDeveloper Runtime' set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\lib\jdev-rt.zip @REM -- Add classpath from library 'Connection Manager' set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\lib\connectionmanager.zip @REM -- Add classpath from library 'Enterprise JavaBeans' set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\lib\javax_ejb.zip @REM -- Add classpath from library 'InfoBus DAC' set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\lib\dacf.zip;%__CLASSPATH_ROOT_DIR__%\infobus\lib\infobus.jar @REM -- Add classpath from library 'Chart' set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\lib\LW_pfjbean.jar @REM -- Add classpath from library 'JBO Oracle Domains' set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\lib\jbodomorcl.zip;%__CLASSPATH_ROOT_DIR__%\lib\jbodatum12.zip @REM -- Add classpath from library 'JBO Runtime' set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\lib\jbomt.zip;%__CLASSPATH_ROOT_DIR__%\lib\jbodomorcl.zip;%__CLASSPATH_ROOT_DIR__%\lib\jboremote.zip;%__CLASSPATH_ROOT_DIR__%\lib\jndi.jar;%__CLASSPATH_ROOT_DIR__%\lib\xmlparserv2.jar @REM -- Add classpath from library 'Oracle 8.1.7 JDBC' set CLASSPATH=%CLASSPATH%;%__CLASSPATH_ROOT_DIR__%\jdbc\lib\oracle8.1.7\classes12.zip @goto :end :copyto @shift @if X%1 EQU X goto :usage1 @if not exist %1 goto :usage2 set __TARGET_DIR__=%1 if not exist %__TARGET_DIR__%\myclasses\. mkdir %__TARGET_DIR__%\myclasses\. copy "E:\jdev32\myclasses\MyProject3.jar" %__TARGET_DIR__%\myclasses\. if not exist %__TARGET_DIR__%\java1.2\. mkdir %__TARGET_DIR__%\java1.2\. if not exist %__TARGET_DIR__%\java1.2\jre\. mkdir %__TARGET_DIR__%\java1.2\jre\. if not exist %__TARGET_DIR__%\java1.2\jre\lib\. mkdir %__TARGET_DIR__%\java1.2\jre\lib\. copy "E:\jdev32\java1.2\jre\lib\rt.jar" %__TARGET_DIR__%\java1.2\jre\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\jdev-rt.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\connectionmanager.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\javax_ejb.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\dacf.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\infobus\. mkdir %__TARGET_DIR__%\infobus\. if not exist %__TARGET_DIR__%\infobus\lib\. mkdir %__TARGET_DIR__%\infobus\lib\. copy "E:\jdev32\infobus\lib\infobus.jar" %__TARGET_DIR__%\infobus\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\LW_pfjbean.jar" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\jbodomorcl.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\jbodatum12.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\jbomt.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\jbodomorcl.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\jboremote.zip" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\jndi.jar" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\lib\. mkdir %__TARGET_DIR__%\lib\. copy "E:\jdev32\lib\xmlparserv2.jar" %__TARGET_DIR__%\lib\. if not exist %__TARGET_DIR__%\jdbc\. mkdir %__TARGET_DIR__%\jdbc\. if not exist %__TARGET_DIR__%\jdbc\lib\. mkdir %__TARGET_DIR__%\jdbc\lib\. if not exist %__TARGET_DIR__%\jdbc\lib\oracle8.1.7\. mkdir %__TARGET_DIR__%\jdbc\lib\oracle8.1.7\. copy "E:\jdev32\jdbc\lib\oracle8.1.7\classes12.zip" %__TARGET_DIR__%\jdbc\lib\oracle8.1.7\. @echo. @echo End of the 'copyto' target. @echo. @goto :end :usage1 @echo. @echo ******* ERROR: You must specify the target directory when invoking 'copyto' @echo. @goto :end :usage2 @echo. @echo ******* ERROR: The specified target directory does not exist. @echo. @goto :end :end @set __CLASSPATH_ROOT_DIR__= @set __TARGET_DIR__= ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo The Profile.sh is displayed below: ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo #!/bin/sh # Script filename: Profile.sh # Do not make changes directly to this script!! # This script is generated and gets overwritten whenever you deploy. # Changes made directly to this script will be lost. # Use this script to set up the CLASSPATH environment variable for your deployed project. # The following archives are involved in running your project: # E/jdev32/myclasses/MyProject3.jar # E/jdev32/java1.2/jre/lib/rt.jar # E/jdev32/lib/jdev-rt.zip # E/jdev32/lib/connectionmanager.zip # E/jdev32/lib/javax_ejb.zip # E/jdev32/lib/dacf.zip:E/jdev32/infobus/lib/infobus.jar # E/jdev32/lib/LW_pfjbean.jar # E/jdev32/lib/jbodomorcl.zip:E/jdev32/lib/jbodatum12.zip # E/jdev32/lib/jbomt.zip:E/jdev32/lib/jbodomorcl.zip:E/jdev32/lib/jboremote.zip:E/jdev32/lib/jndi.jar:E/jdev32/lib/xmlparserv2.jar # E/jdev32/jdbc/lib/oracle8.1.7/classes12.zip set -a set -x # When the 'copyto' target is not being invoked, this script takes a single argument, which is your archive root directory. # The default is the root directory of your JDeveloper installation. if [ $# -lt 1 ]; then __CLASSPATH_ROOT_DIR__='E/jdev32' else __CLASSPATH_ROOT_DIR__=$1 fi # Initialize CLASSPATH to point to your deployed archive. CLASSPATH='${__CLASSPATH_ROOT_DIR__}/myclasses/MyProject3.jar' # JDK classpath (java version "JDK1.2.2_JDeveloper") CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/java1.2/jre/lib/rt.jar' # Add classpath from library 'JDeveloper Runtime' CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/lib/jdev-rt.zip' # Add classpath from library 'Connection Manager' CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/lib/connectionmanager.zip' # Add classpath from library 'Enterprise JavaBeans' CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/lib/javax_ejb.zip' # Add classpath from library 'InfoBus DAC' CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/lib/dacf.zip:${__CLASSPATH_ROOT_DIR__}/infobus/lib/infobus.jar' # Add classpath from library 'Chart' CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/lib/LW_pfjbean.jar' # Add classpath from library 'JBO Oracle Domains' CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/lib/jbodomorcl.zip:${__CLASSPATH_ROOT_DIR__}/lib/jbodatum12.zip' # Add classpath from library 'JBO Runtime' CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/lib/jbomt.zip:${__CLASSPATH_ROOT_DIR__}/lib/jbodomorcl.zip:${__CLASSPATH_ROOT_DIR__}/lib/jboremote.zip:${__CLASSPATH_ROOT_DIR__}/lib/jndi.jar:${__CLASSPATH_ROOT_DIR__}/lib/xmlparserv2.jar' # Add classpath from library 'Oracle 8.1.7 JDBC' CLASSPATH=${CLASSPATH}':${__CLASSPATH_ROOT_DIR__}/jdbc/lib/oracle8.1.7/classes12.zip' export $SHELL ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Are we getting any closer to running our java program? How do we run it? We carefully read the Profile.bat and the Profile.sh and cook up this simple .bat file to run it: ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo rem rem runJdevDemo.bat rem rem History: rem 02/22/2001 Bikle Creation rem rem rem rem rem rem rem rem rem rem simple win2k script to run a java program which was created by JDeveloper rem set our env vars Profile.bat rem now run the java program e:\jdev32\java1.2\bin\java package3.Frame1 rem end of script ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo The above script fails. It seems to run Profile.bat okay but then completely ignores the line: e:\jdev32\java1.2\bin\java package3.Frame1 win2k sure is pathetic. We run Profile straight from a win2k shell. It does set our CLASSPATH to the following value: CLASSPATH=E:\jdev32\myclasses\MyProject3.jar;E:\jdev32\java1.2\jre\lib\rt.jar;E:\jdev32\lib\jdev-rt.zip;E:\jdev32\lib\connectionmanager.zip;E:\jdev32\lib\javax_ejb.zip;E:\jdev32\lib\dacf.zip;E:\jdev32\infobus\lib\infobus.jar;E:\jdev32\lib\LW_pfjbean.jar;E:\jdev32\lib\jbodomorcl.zip;E:\jdev32\lib\jbodatum12.zip;E:\jdev32\lib\jbomt.zip;E:\jdev32\lib\jbodomorcl.zip;E:\jdev32\lib\jboremote.zip;E:\jdev32\lib\jndi.jar;E:\jdev32\lib\xmlparserv2.jar;E:\jdev32\jdbc\lib\oracle8.1.7\classes12.zip So, we try running this command straight from a win2k shell: e:\jdev32\java1.2\bin\java package3.Frame1 It gives us an error: E:\jdev32\myclasses>e:\jdev32\java1.2\bin\java package3.Frame1 java.lang.NoSuchMethodError: void package3.Frame1.main(java.lang.String[]) Exception in thread main E:\jdev32\myclasses> It looks like main() is missing from Frame1.java; we wonder if I'm supposed to be running a different class? This leads us back to a previous question: Now that we've done the deployment step; we wonder if it is possible to gain access to the .java files so we may change any code in there if nec? We go to the top menu bar; we click view... and JDev freezes; win2k is such a piece of junk. I'll cherish the day when Oracle ports this JDeveloper to linux and Solaris. We reboot win2k. Next, we try to figure out how to pickup where we left off. We use win2k search to look for all files which end with .jws We find about 15 .jws files under e:\jdev32; many of them are under samples; we make a note to study them at a later time. Where is the .jws we were working on? We think this is it: e:\jdev32\myprojects\ws1.jws We open it, nope, wrong workspace. Maybe the workspace got removed after we 'deployed'. We don't see any others which could be mine. I'll try this: 1. Create a new-empty workspace. 2. Try pulling the deployed jar (e:\jdev32\myclasses\MyProject3.jar) into the workspace. Well, JDev did put the .jar table of contents in a viewer. It's starting to dawn on us that perhaps this is not the way to go. We doubt JDev is smart enough to transform .class files inside a .jar into .java files which we can then edit and manipulate. We do know the names of the .class files. Perhaps we can locate the .java files under e:\jdev32\ somewhere. We start our quest with a search for Frame1.java. No Frame1.java exists under e:\jdev32\ This sucks; how do we get back into that mode where we can edit the corresponding .java files? How about if we extract the .class files out of MyProject3.jar into a temporary directory and read them with JDev? We doubt this will work but maybe JDev is smarter than we think. We issue these win2k commands: cd e:\jdev32\myclasses\ mkdir tmp cd tmp e:\jdev32\java1.2\bin\jar xvf ..\MyProject3.jar We jump into JDev; we close the workspace; open a new one; we then open this file: e:/jdev32/myclasses/tmp/package3/Frame1.class The IDE does show a bunch of java code in the viewer; we refer to it below: Frame1-class-java.txt Notice the comments at the top of the file: oooooooooooooooooooooooooooooooooooooooooo // JDeveloper API Decompiler STUB SOURCE generated from class file // Thu Feb 22 12:17:46 PST 2001 // -- implementation of methods is not available package package3; // approximate imports oooooooooooooooooooooooooooooooooooooooooo This makes sense; we think it is telling us that it's doing the best that it can of deriving the .java from a .class and that the original .java is lost. Let's walk through the demo again this time trying to find out at which point JDev puts the .java files in the trash. We bring up JDev and trigger the actions below: We press file-close-workspace We press file-new-workspace we fill out the connections dialog We press file-new-project It: project wizard welcome Us: next It: project wizard step 1 Us: next It: project wizard step 2 Us: next It: project wizard step 3 Us: next It: project wizard finish Us: finish It: business components project wizard, welcome Us: next It: business components project wizard, step 1 Us: next It checks dbs connectivity It: business components project wizard, step 2 Us: next It: business components project wizard, step 3 It displays table names Us: pick EMP Us: next It: business components project wizard, finish Us: finish We press file-save-all a few files get written to e:/jdev32/myprojects/package4: e:/jdev32/myprojects/package4: total 13 drwxrwxrwx 2 dbikle 5 0 Feb 23 00:47 . drwxrwxrwx 2 dbikle 5 0 Feb 23 00:47 .. -rw-rw-rw- 1 dbikle 5 3635 Feb 23 00:39 Emp.xml -rw-rw-rw- 1 dbikle 5 4225 Feb 23 00:39 EmpImpl.java -rw-rw-rw- 1 dbikle 5 2921 Feb 23 00:39 EmpView.xml -rw-rw-rw- 1 dbikle 5 478 Feb 23 00:39 EmpViewImpl.java -rw-rw-rw- 1 dbikle 5 480 Feb 23 00:39 Package4Module.xml -rw-rw-rw- 1 dbikle 5 995 Feb 23 00:39 Package4ModuleImpl.java drwxrwxrwx 2 dbikle 5 0 Feb 23 00:47 common -rw-rw-rw- 1 dbikle 5 567 Feb 23 00:39 package4.xml We press project-make-project We press file-new-project It: project wizard welcome Us: next It: project wizard, project type, step 1 Us: empty project, next It: step 2 Us: next It: step 3 Us: next It: finish Us: finish We press project-make-project We press file-new we pick business components data form It: welcome Us: next It: step 1 Us: next It: step 2,3,4,5 Us: next It: step 6 Us: pick emp view, next It: list of columns Us: pick em all; next It: step 8 Us: next It: finish Us: finish Now we see a Frame1.java icon appear in the lhs window. According to IDE, it is in e:/jdev32/myprojects/package5/ Emacs doesn't show it though. We try file-save-all. Now emacs can see it: Frame1-java.txt Now we try a project-make-project e:/jdev32/myprojects/package5/Frame1.java is still there. Now we try a deploy. It: step 1, how deploy? Us: simple jar, next It: step 2, files to deploy? Us: next It: step 3, specify archive properties Us: main=aform, next It: finish Us: finish We go looking for the jar file; we find it here: e:/jdev32/myclasses/MyProject6.jar Its contents: M Filemode Length Date Time File - ---------- -------- ----------- -------- ------------------------ -rw-rw-rw- 525 23-Feb-2001 01:17:20 meta-inf/manifest.mf -rw-rw-rw- 860 23-Feb-2001 01:01:36 package5/Frame1$4.class -rw-rw-rw- 860 23-Feb-2001 01:01:36 package5/Frame1$7.class -rw-rw-rw- 773 23-Feb-2001 01:01:36 package5/Frame1$2.class -rw-rw-rw- 860 23-Feb-2001 01:01:36 package5/Frame1$5.class -rw-rw-rw- 860 23-Feb-2001 01:01:36 package5/Frame1$8.class -rw-rw-rw- 860 23-Feb-2001 01:01:36 package5/Frame1$3.class -rw-rw-rw- 860 23-Feb-2001 01:01:36 package5/Frame1$6.class -rw-rw-rw- 746 23-Feb-2001 01:01:36 package5/Frame1$1.class -rw-rw-rw- 864 23-Feb-2001 01:01:36 package5/Frame1$11.class -rw-rw-rw- 776 23-Feb-2001 01:01:36 package5/Frame1$12.class -rw-rw-rw- 343 23-Feb-2001 01:17:20 connections.properties -rw-rw-rw- 864 23-Feb-2001 01:01:36 package5/Frame1$10.class -rw-rw-rw- 13492 23-Feb-2001 01:01:36 package5/Frame1.class -rw-rw-rw- 861 23-Feb-2001 01:01:36 package5/Frame1$9.class - ---------- -------- ----------- -------- ------------------------ 24404 15 files We were hoping to see 'aform.class' in there. We look for any file named 'aform.*'; none found. Next, we check if the Frame1.java file still exists; yep it is still here: e:/jdev32/myprojects/package5/Frame1.java So this is good news; our deployment activity did not trash our .java file. The next day we tinkered some more. We started with close workspace: file-close-workspace Next we defined a connection: tools-connections We hoped to define a connection which will appear like this in the connections file: jdbc:oracle:oci8:@DANB We tinkered with the connection wizard and then go look for the corresponding connections file which gets created by the wizard. We found this file: e:/jdev32/bin/IDEConnections.properties We display it below: ooooooooooooooooooooooooooooooooooooooooooooo #Fri Feb 23 12:12:22 PST 2001 CM_NumConnections=2 CM_Connection2=password\=s\r,defaultBatchValue\=1\r,ConnectionType\=JDBC\r,ConnectionName\=c1\r,user\=scott\r,DeployPassword\=false\r,URL\=jdbc\\\:oracle\\\:thin\\\:@localhost\\\:1521\\\:danb\r,remarksReporting\=false\r,JdbcDriver\=oracle.jdbc.driver.OracleDriver\r,defaultRowPrefetch\=10\r,Role\=Normal CM_Connection1=password\=s\r,defaultBatchValue\=1\r,ConnectionType\=JDBC\r,user\=scott\r,ConnectionName\=c2\r,DeployPassword\=false\r,URL\=jdbc\\\:oracle\\\:oci8\\\:@(DESCRIPTION\\\=(ADDRESS_LIST\\\=(ADDRESS\\\=(PROTOCOL\\\=TCP)(PORT\\\=)(HOST\\\=)))(CONNECT_DATA\\\=(SID\\\=danb)))\r,remarksReporting\=false\r,JdbcDriver\=oracle.jdbc.driver.OracleDriver\r,defaultRowPrefetch\=10\r,Role\=Normal ooooooooooooooooooooooooooooooooooooooooooooo It looks like the above file contains two connection definitions which does validate what we see in JDev. Currently, connection1 works and connection2 gives error: ORA-12533 We tinkered with connection2 in a text editor so the connection string is this: jdbc:oracle:oci8:@DANB We wonder if the data in the above file is cached by JDev while it is running or if the data is looked up from the file each time a connection is established. We attempted to establish this with an experiment. Result: We found the data in the above file is cached by JDev while it is running; changes made to e:/jdev32/bin/IDEConnections.properties by a text editor are not seen by JDev. We shutdown JDev. We tinkered more with e:/jdev32/bin/IDEConnections.properties using text editor. e:/jdev32/bin/IDEConnections.properties now looked like this: ooooooooooooooooooooooooooooooooooooooooooooo #Fri Feb 23 12:30:42 PST 2001 CM_NumConnections=2 CM_Connection2=password\=s\r,defaultBatchValue\=1\r,ConnectionType\=JDBC\r,ConnectionName\=c1\r,user\=scott\r,DeployPassword\=false\r,URL\=jdbc\\\:oracle\\\:oci8\\\:@DANB\r,remarksReporting\=false\r,JdbcDriver\=oracle.jdbc.driver.OracleDriver\r,defaultRowPrefetch\=10\r,Role\=Normal CM_Connection1=password\=s\r,defaultBatchValue\=1\r,ConnectionType\=JDBC\r,user\=scott\r,ConnectionName\=c2\r,DeployPassword\=false\r,URL\=jdbc\\\:oracle\\\:thin\\\:@localhost\\\:1521\\\:DANB\r,remarksReporting\=false\r,JdbcDriver\=oracle.jdbc.driver.OracleDriver\r,defaultRowPrefetch\=10\r,Role\=Normal ooooooooooooooooooooooooooooooooooooooooooooo We started JDev. We noticed two connections defined: c1 and c2 The c1 url is this: jdbc:oracle:oci8:@DANB The c2 url is this: jdbc:oracle:thin:@localhost:1521:DANB We tested both c1 and c2; they both work. While tinkering we discover that a double click on the c1 icon (or c2 icn) results in the display of a nice browser of database objects. Next we created a third connection which pointed us at an 8.1.6 database running on Solaris. Tinkering inside of help ------------------------- With our newly created connection active we decided to walk through a demo inside of the Help system within JDeveloper. We keyed this: help->help-topics->TutorialsandSampleApplications ->Building Enterprise Applications with Business Components for Java ->Running the Online Orders Application ->Requirements ->Creating and Populating the Database Tables create bc4j account run @e:\jdev32\bin\java2perm.sql bc4j create user ship identified by ship; grant connect , resource to ship; grant execute on dbms_aqadm to ship; grant execute on dbms_aqin to ship; grant execute on dbms_aqjms to ship; We put this in the database: # 02-23-2001 bikle aq_tm_processes=1 aq_tm_processes=1 Then we bounced the database. To create the tables: In JDeveloper, we opened the workspace DatabaseSetup.jws located in \samples\bc4j\OrderEntry\DatabaseSetup right-clicked OnlineOrders.sql and choose Invoke SQL*Plus We got an error: Creating table INVENTORY_ITEM image ORDSYS.ORDIMAGE, * ERROR at line 5: ORA-00902: invalid datatype Here is the offending statement: ooooooooooooooooooooooooooooooooooooooooooooooooooooooooo create table inventory_item( id number, name varchar2(30), description varchar2(500), image ORDSYS.ORDIMAGE, price number(8,2), onhand number, supplier_id number, category_id number, constraint inventory_item_pk primary key (id), constraint supplied_by foreign key (supplier_id) references supplier ); ooooooooooooooooooooooooooooooooooooooooooooooooooooooooo This might have something to do with improper setup of 8i object option. We inspected the RDBMS banner: ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo c:\dan\ptdir\webprops>E:\oracle\ora81\bin\sqlplus sys/s@zy SQL*Plus: Release 8.1.7.0.0 - Production on Tue Feb 27 20:33:19 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production With the Partitioning option JServer Release 8.1.6.0.0 - Production SQL> ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Notice that it shows no mention of the object option. We decided to check that later. We looked for clues in google; we did find a neat org: enhydra.org. We added enhydra.org (and http://www.lutris.com) to our xml.doc url list. After the two side trips to enhydra.com and lutris.com, we googled some more. Further googling suggested that the "image" data type might be created by a feature inside of Oracle InterMedia. We investigated further via the document listed below: Oracle8i interMedia Audio, Image, and Video User's Guide and Reference Release 8.1.5 A67299-01 We list a useful url: http://www.csee.umbc.edu/help/oracle8/inter.815/a67299/mm_imgre.htm The main clue we found in the above document (which we did not read very carefully) is that we need to install Oracle8i interMedia. We looked around under $ORACLE_HOME. We found some interesting scripts and ran them; the results are linked below: ordtinkerings.txt Wow talk about a side trip. We decided to steer clear of the 8.1.6 database on Solaris and use the NT 8.1.7 database as the platform for this demo. So we ran the script below: e:\jdev32\bin\java2perm.sql using a right click in JDev file browser. It spawned sqlplus which then prompted us to input command line argument #1; we responded with "bc4j". It ran so fast we had no chance to spot any possible errors. So we re ran it from a ms-dos shell prompt: E:\jdev32\bin>sql sys/s @java2perm.sql bc4j sql sys/s @java2perm.sql bc4j E:\jdev32\bin>E:\oracle\ora81\bin\sqlplus sys/s @java2perm.sql bc4j SQL*Plus: Release 8.1.7.0.0 - Production on Tue Feb 27 23:56:42 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production BEGIN DBMS_JAVA.GRANT_PERMISSION(UPPER('bc4j'), 'SYS:java.util.PropertyPermission', '*', 'write'); END; * ERROR at line 1: ORA-29532: Java call terminated by uncaught Java exception: oracle.aurora.vm.IdNotFoundException: BC4J is not a user or role ORA-06512: at "SYS.DBMS_JAVA", line 0 ORA-06512: at line 1 BEGIN DBMS_JAVA.GRANT_PERMISSION(UPPER('bc4j'), 'SYS:java.util.PropertyPermission', '*', 'read'); END; * ERROR at line 1: ORA-29532: Java call terminated by uncaught Java exception: oracle.aurora.vm.IdNotFoundException: BC4J is not a user or role ORA-06512: at "SYS.DBMS_JAVA", line 0 ORA-06512: at line 1 BEGIN DBMS_JAVA.GRANT_PERMISSION(UPPER('bc4j'), 'SYS:java.lang.RuntimePermission', 'createClassLoader', null); END; * ERROR at line 1: ORA-29532: Java call terminated by uncaught Java exception: oracle.aurora.vm.IdNotFoundException: BC4J is not a user or role ORA-06512: at "SYS.DBMS_JAVA", line 0 ORA-06512: at line 1 BEGIN DBMS_JAVA.GRANT_PERMISSION(UPPER('bc4j'), 'SYS:java.lang.RuntimePermission', 'setContextClassLoader', null); END; * ERROR at line 1: ORA-29532: Java call terminated by uncaught Java exception: oracle.aurora.vm.IdNotFoundException: BC4J is not a user or role ORA-06512: at "SYS.DBMS_JAVA", line 0 ORA-06512: at line 1 BEGIN DBMS_JAVA.GRANT_PERMISSION(UPPER('bc4j'), 'SYS:java.lang.RuntimePermission', 'getClassLoader', null); END; * ERROR at line 1: ORA-29532: Java call terminated by uncaught Java exception: oracle.aurora.vm.IdNotFoundException: BC4J is not a user or role ORA-06512: at "SYS.DBMS_JAVA", line 0 ORA-06512: at line 1 Commit complete. Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production E:\jdev32\bin> Good thing we checked. Looks like we forgot to create he bc4j account; oops. Here is a screen dump of us creating it: SQL> grant connect,dba to bc4j identified by bc; Grant succeeded. SQL> alter user bc4j default tablespace users temporary tablespace temp; User altered. Now we retry the script above which had failed: E:\jdev32\bin>sql sys/s @java2perm.sql bc4j sql sys/s @java2perm.sql bc4j E:\jdev32\bin>E:\oracle\ora81\bin\sqlplus sys/s @java2perm.sql bc4j SQL*Plus: Release 8.1.7.0.0 - Production on Wed Feb 28 00:02:22 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. Commit complete. Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production E:\jdev32\bin> Ah, much better. Next we did the steps below which had failed us before. To create the tables: In JDeveloper, we opened the workspace DatabaseSetup.jws located in \samples\bc4j\OrderEntry\DatabaseSetup right-clicked OnlineOrders.sql and choose Invoke SQL*Plus We notice we have no connection defined for the bc4j account so we escape from the sqlplus method for a minute. We key upper-menu-tools-connections. We create a connection with the naming convention "sid_user" which in this case is: "danb_bc4j" Then we right-clicked OnlineOrders.sql and choose Invoke SQL*Plus. The script ran with no significant errors! Next, we browsed the BC4J user using the browser built into the danb_bc4j connection. We found 5 tables, 2 triggers, 6 sequences, and an "object". Information about the object is displayed below: type T_ADDRESS as object (STREET VARCHAR2(50), CITY VARCHAR2(30), STATE VARCHAR2(2), ZIPCODE VARCHAR2(10) ); When we look in OnlineOrders.sql for more information about the T_ADDRESS object, we find the following interesting syntax: ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo drop type T_ADDRESS; create type T_ADDRESS as object (STREET VARCHAR2(50), CITY VARCHAR2(30), STATE VARCHAR2(2), ZIPCODE VARCHAR2(10) ); / -- Notice how we put both a semicolon and a slash at the end of the CREATE TYPE -- statement. This is similar to syntax used to create other objects in the database -- like packages, procedures, and triggers. prompt Creating table CUSTOMER create table customer( id number, firstname varchar2(30), lastname varchar2(30), username varchar2(15), password varchar2(15), address T_ADDRESS, status varchar2(8), email varchar2(40), constraint customer_pk primary key (id) ); insert into customer (id, firstname, lastname, username, password, address, status, email) values (customer_seq.nextval, 'Steve', 'Herbengizer', 'steve', 'steve', t_address('101 California', 'Blueville', 'CA', '94036-3209'), 'Gold', 'steve@steve.com'); ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Notice how the script interacts with this new data type named T_ADDRESS. Next, we used the win2k searcher to list all .jws files (workspace files) which reside under the samples/bc4j directory. We counted 7 .jws files. Next, we use JDev to open the workspace file listed below: e:/jdev32/samples/BC4J/OrderEntry/DatabaseSetup/DatabaseSetup.jws The navigator window displays a DatabaseSetup.jpr icon as a parent of other icons: -Folder named images which is full of .jpg files -Icon named ImageLoader -Icon named ImageLoader.java -Icon named ImageLoader.jpx -Icon named messaging.sql -Icon named OnlineOrders.sql We noted that these icons have properties: ImageLoader, ImageLoader.java, ImageLoader.jpx We right clicked ImageLoader and picked "edit ImageLoader". A Screen appeared which told us that ImageLoader is a Package. We canceled out and then pressed the "+" next to ImageLoader. A hierarchy appeared which contained ImageLoader.xml and three branches. Each branch contained a .xml file and a .java file. So one pattern we noticed is that .xml files seem to be paired with .java files. We used our right mouse to view the file ImageLoader.xml: oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo <?xml version="1.0" encoding='WINDOWS-1252'?> <!DOCTYPE JboPackage SYSTEM "jbo_03_01.dtd"> <JboPackage Name="ImageLoader" SeparateXMLFiles="true" PackageName="ImageLoader" > <Containee Name="InventoryItem" FullName="ImageLoader.InventoryItem" ObjectType="Entity" > </Containee> <Containee Name="InventoryItem1View" FullName="ImageLoader.InventoryItem1View" ObjectType="ViewObject" > </Containee> <Containee Name="ImageLoaderModule" FullName="ImageLoader.ImageLoaderModule" ObjectType="AppModule" > </Containee> </JboPackage> oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo We noticed that the above .xml structure mirrors what we see in the IDE workspace browser. We decided to go play ping-pong and work with these demos tomorrow. End of file |
|
|
http://bikle.com |
Built With Rails |
4096 Color Wheel |