Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Mixing Java with Oracle Forms 11g

 
Ranch Hand
Posts: 34
Oracle Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have already tried asking about this on the Oracle forum but it has so far left me more confused and having no idea what to do. What's going on is I wrote a program for work that allows the user to upload a document from their computer onto the database and then download it back later. Now I have to take that and integrate it into a button in Oracle Forms because our actual program runs from Forms. I know Forms uses a different language (PL/SQL) but i was hoping that someone would be able to help still. I imported the jar into the form and wrote a button with code I found online (modified slightly for my own use of course):



but when I tried to compile it I got:

Error 306 at line 8, column 8
wrong number or types of arguments in call to 'STARTUPLOADPAGE'

I did get out of someone on the Oracle forum that apparently as written my code wont work anyway because apparently the jar importer in Forms doesnt transfer UI (ie Java Swing) and that in order to get the UI to transfer I would have to write a JavaBean on top of my code... but 1 I have no clue what a JavaBean is and the research I have done so far about it has just confused me more... and 2 I'm not sure what that has to do with the error considering that the method that is supposed to be being called by the line that threw the error doesnt have any JFrames or Java Swing of any kind connected to it... there is a tiny bit of Swing in the class to open up the first form that has the buttons for upload and download in it but that is all. I have 4 classes in that jar... 3 are the various Java Swing pages and have the absolute minimum logic in them possible... and the 4th one is the one that starts everything going, has the main class, and any serious logic that needs to be done the needed values are passed to that class and that class does all the work... that 4th class is the one that is being called in the PL/SQL. If it isnt any trouble could I maybe get a little help from someone on:

1. How to write a JavaBean to allow my program to work the way it is supposed to in Forms and

2. Why I am getting this error and how to make it go away
 
Greenhorn
Posts: 5
Netbeans IDE Firefox Browser Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there, when calling Java from Oracle forms or adding swing components, I've always used PJCs (pluggable Java components). This has the benefit of using the JVM being used by the client instead of having to use the one that comes with forms. This means you're not tied to the particular version of forms you are running. You have to update your formsweb.cfg to register your jar and put it in the java directory below forms. I know this is a bit different to what you were describing in your post but generally I've found this to be a reliable way to integrate Java into Oracle forms. There's quite a good resource on doing this sort of thing here:

http://forms.pjc.bean.over-blog.com/

One gotcha is if your implementation still uses JInitiator. If this is the case then all your PJCs must use Java 1.3. That's still the case where I work but we should be moving away from it soon (hopefully).

 
Jo Young
Ranch Hand
Posts: 34
Oracle Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Brownsell wrote:Hi there, when calling Java from Oracle forms or adding swing components, I've always used PJCs (pluggable Java components). This has the benefit of using the JVM being used by the client instead of having to use the one that comes with forms. This means you're not tied to the particular version of forms you are running. You have to update your formsweb.cfg to register your jar and put it in the java directory below forms. I know this is a bit different to what you were describing in your post but generally I've found this to be a reliable way to integrate Java into Oracle forms. There's quite a good resource on doing this sort of thing here:

http://forms.pjc.bean.over-blog.com/

One gotcha is if your implementation still uses JInitiator. If this is the case then all your PJCs must use Java 1.3. That's still the case where I work but we should be moving away from it soon (hopefully).



oh ok cool thank you.. unfortunately (stupid internet security makes my job impossible sometimes) I can't get to the link you gave me... thankfully forums are not blocked... however blogs are

I am using JDeveloper 11g Forms 11g and Java 6 (not sure why but for some reason between 1.4 and 5 then decided to drop the "1.")
 
Jo Young
Ranch Hand
Posts: 34
Oracle Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Brownsell wrote:Hi there, when calling Java from Oracle forms or adding swing components, I've always used PJCs (pluggable Java components). This has the benefit of using the JVM being used by the client instead of having to use the one that comes with forms. This means you're not tied to the particular version of forms you are running. You have to update your formsweb.cfg to register your jar and put it in the java directory below forms. I know this is a bit different to what you were describing in your post but generally I've found this to be a reliable way to integrate Java into Oracle forms. There's quite a good resource on doing this sort of thing here:

http://forms.pjc.bean.over-blog.com/

One gotcha is if your implementation still uses JInitiator. If this is the case then all your PJCs must use Java 1.3. That's still the case where I work but we should be moving away from it soon (hopefully).



oh ok cool thank you.. unfortunately (stupid internet security makes my job impossible sometimes) I can't get to the link you gave me... thankfully forums are not blocked... however blogs are

I am using JDeveloper 11g Forms 11g and Java 6 (not sure why but for some reason between 1.4 and 5 then decided to drop the "1.")
 
Jo Young
Ranch Hand
Posts: 34
Oracle Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oops sorry for the double post...
 
Rob Brownsell
Greenhorn
Posts: 5
Netbeans IDE Firefox Browser Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll try to explain as much as I can in this post but I believe the Oracle website has some information on this. Surely they haven't blocked that site! You need to add frmall.jar to your project, this will give you the forms classes you need (you should find it in your forms installation). You then need to create a class that extends VBean. Here is a simple class that displays a swing button.



You need to create a bean area in your form and specify the implementation class as the name in your jar (fully qualified with the package name). The methods setProperty and getProperty can be used to send and receive parameters to and from the class. To call these methods from your form you have to call set_custom_property and get_custom_property. You should see examples of these functions in the forms help.
 
Jo Young
Ranch Hand
Posts: 34
Oracle Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Brownsell wrote:I'll try to explain as much as I can in this post but I believe the Oracle website has some information on this. Surely they haven't blocked that site! You need to add frmall.jar to your project, this will give you the forms classes you need (you should find it in your forms installation).



you would think the Oracle website would have stuff on it but I havent been able to find anything as of yet and I have been looking for over a month... there was a few tutorials but they were all program specific and mostly all using netbean and none of them were for JDev 11g and most of it was walking through how that program makes it so you dont have to do much of any coding because the program does your coding for you and almost no actual coding being done which made following it with JDev 11g very difficult if not impossible.

thank you very much I will look through what you gave me and see how I do.
 
Rob Brownsell
Greenhorn
Posts: 5
Netbeans IDE Firefox Browser Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jo Young wrote:

Rob Brownsell wrote:I'll try to explain as much as I can in this post but I believe the Oracle website has some information on this. Surely they haven't blocked that site! You need to add frmall.jar to your project, this will give you the forms classes you need (you should find it in your forms installation).



you would think the Oracle website would have stuff on it but I havent been able to find anything as of yet and I have been looking for over a month... there was a few tutorials but they were all program specific and mostly all using netbean and none of them were for JDev 11g and most of it was walking through how that program makes it so you dont have to do much of any coding because the program does your coding for you and almost no actual coding being done which made following it with JDev 11g very difficult if not impossible.

thank you very much I will look through what you gave me and see how I do.



This is document was written back in 2000 (when it comes to Oracle forms, I don't think much has really moved on since then!) but I think the principals are the same

http://www.oracle.com/technetwork/developer-tools/forms/documentation/269054-130573.pdf
 
Jo Young
Ranch Hand
Posts: 34
Oracle Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Brownsell wrote:
This is document was written back in 2000 (when it comes to Oracle forms, I don't think much has really moved on since then!) but I think the principals are the same

http://www.oracle.com/technetwork/developer-tools/forms/documentation/269054-130573.pdf



Yea from what I've heard Forms hasn't really changed any since like 6i or something like that
 
reply
    Bookmark Topic Watch Topic
  • New Topic