Calling java beans from forms 6
Could anyone please tell me if it is possible to call an EJB component from within forms 6.
And if so how.
Thanks
If your EJB is for doing some server side processing, etc. you can consider exposing it via a servlet deployed on the Forms 6i server that accepts GET requests. You can then call to the servlet using utl_http.request.
Similar Messages
-
Calling Java Bean from Form 9i
Dear all,
I have developed a Java Bean and I want to use it in FOrm 9i. I have imported that Bean (.jar file) sucessfully to my form. I use following code to call the Bean:
declare
WordDoc ora_java.jobject;
javaException ORA_JAVA.JOBJECT;
Begin
WordDoc := WordBean.new;
WordBean.OpenWord(WordDoc, true);
EXCEPTION
WHEN ORA_JAVA.EXCEPTION_THROWN THEN
javaException := ORA_JAVA.LAST_EXCEPTION;
message(Exception_.getMessage(javaException));
ORA_JAVA.CLEAR_EXCEPTION;
WHEN ORA_JAVA.JAVA_ERROR THEN
message(ORA_JAVA.LAST_ERROR);
ORA_JAVA.CLEAR_ERROR;
end;
But I receive the "raise unhandled Exception Ora-105100" and my form doesn't handle the errors. What am I missing in the code?
Thanks in advance,
Hamid MotaharHi,
You receive this error because at runtime the form can't find the jar. See note : http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=169529.1
on metalink
Greetings -
How to call Java Beans from JSP (eg.put them in a WAR or package)
Can anyone explain to me what are the steps and ways to call java beans from JSP?
1st, put the javabean classes in the right place:
the web-inf/classes/your_bean.class directory of corresponding web application
2nd in your jsp page:
<jsp:useBean id="obj_var_name" class="your_bean"/>
<jsp:setProperty name="obj_var_name" property="smthg" value="smthg_calue"/>
Micheal -
How to call java bean from jsp
hi
How to call a java bean from jsp page..
Is any other way to call javabean from jsp page apart from this sample code...
<jsp:useBean id="obj" class="com.devsphere.articles.calltag.TestBean"/>
thnx in advanceIf you also use servlets, you can attach beans to the request or session and use them directly in your JSP's. So if you do:
request.setAttribute("name", yourBean);and then forward to a JSP, you can reference the bean like:
${requestScope.name} -
<%@ page contentType="text/html;charset=windows-1252" errorPage = "error.jsp"%>
<%@ page import="java.sql.*,java.io.*,javax.sql.*, mypackage1.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Process</title>
</head>
<body>
<P align="center">
<STRONG><FONT face="Algerian" size="6" color="#0033cc">Result from the Query</FONT></STRONG>
</P>
<P align="center"> </P>
<P align="center"> </P>
<P align="center"> </P>
<P align="center"> </P>
<P align="center">
<%
int rowsChanged;
Connection con;
try
String sql;
sql = request.getParameter("query");
System.out.println(sql);
session=request.getSession(true);
String name = (String)session.getAttribute("theID");
String password = (String)session.getAttribute("paswd");
String driver="oracle.jdbc.OracleDriver";
Class.forName(driver);
String url ="jdbc:oracle:thin:@minerva.humber.ca:1521:grok" ;
con = DriverManager.getConnection(url,name,password);
if(sql.substring(0,6).equalsIgnoreCase("Select"))
Statement stat = con.createStatement();
ResultSet rs = stat.executeQuery(sql);
%>
<jsp:useBean id="myBean" scope="page" class="mypackage1.Table" >
</jsp:useBean>
<jsp:setProperty name="myBean" property="*" param="<%rs%>"/>
<%
myBean.setTable(rs);
out.println(myBean.getTable());
%>
<%
else
Statement stat = con.createStatement();
rowsChanged = stat.executeUpdate(sql);
out.println("<h3><STRONG><FONT face=Algerian size=5 color=#0033cc>Number of rows affected are: "+rowsChanged+"</h3></Strong></Font>");
}//End of Try
catch(Exception e)
System.out.println(e+ "gd"+ e.getMessage());
%>
</P>
<P align="center">
<a href="check.jsp">Please Click Here to Return to Main Page</a>
</P>
</body>
</html>Above is my JSP file, which is calling a Java bean class called Table. The thing is that Its not returning any Table from the Table Class. I dont know how to use Java bean as I m new to it. Following is my Table Class. So If anyone can plz help me then it would be great. I m suffering from 2 days just because of this class and JSP.
package mypackage1;
import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
public class Table implements Serializable
private ResultSet rs;
public Table()
public void setTable(ResultSet result)
rs = result;
public String getTable()
String output=null;
try
ResultSetMetaData metadata;
metadata=rs.getMetaData();
// find the number of fields in customer table
int col=metadata.getColumnCount();
output = "<table/><tr/>";
for(int i=1;i<=col;i++)
output+="<td/><b/>"+metadata.getColumnName(i)+"</b/></td/>";
output += "</tr/>";
while (rs.next())
output="<tr/>";
for(int i=1;i<=col;i++)
output+="<td/>"+rs.getString(i)+"</td/>";
output += "</tr/></table/>";
}//End of While
catch(Exception e)
return output;
}//End of Table method
}//End of ClassFirst reaction: yuck.
This is not something you should be using a bean for.
Beans are meant for storing data, not for generating HTML from.
I don't really like queries on a JSP page either, but thats a different story again.
I would recommend you use JSTL for this.
1 - it provides a c:forEach tag for looping
2 - it provides sql tags for doing queries in a database
IF you are going to do database queries from a JSP page, I absolutely recommend you use the JSTL tags.
(end rant)
Your problem is probably caused by the fact that in your bean you have the following
try{
// code here
catch (Exception e){
// completely ignore exception and carry on as if nothing bad happened.
// what you should be doing is something like:
System.out.println("Error occurred " + e.getMessage());
e.printStackTrace();
return e.getMessage();
}Cheers,
evnafets -
How to call Java class from Forms 6i?
Hi friends,
I need to call a Java class from my Forms 6i application.
(It runs under WIndows XP. It's a client/server application and I have only the client and the Form builder installed on my PC)
I don't know almost anything about Java's world so your help would be very useful for me.
Could you tell me exactly what i have to do?
I've read in metalink several Notes, but they supposed that the Java architecture is already installed in the computer.... I only have the default installation of Developer 6i... so I would need to know:
- How to install/configure the neccesary to execute Java classes without problem
- How to invoke the .class from Forms 6i.
Thanks a lot
Jose.And also this one:
Problem Description
Installed Forms 6i Rel 2 on a MS Windows machine. When trying to Import the Java
Classes getting the errors
PDE-UJI0001 Failed to create the JVM
Solution Description
You need to to install JDK 1.2.2 to run the Java Importer. And set the PATH's
and classpath's correctly.
Explanation
1. Download and install the JDK 1.2.2.
Possibly available at: http://java.sun.com/products/archive/
2. Assuming the JDK 1.2.2 is installed in c:\jdk1.2.2 directory and the JRE in
C:\PROGRA~1\JAVASOFT\JRE\1.2 directory; ORACLE_HOME=C:\Dev6iR2.
Set the PATH to
set PATH=c:\jdk1.2.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin\classic;%PATH%
( If you are using ias9i then the JDK 1.2.2 comes with the ias installtion ,
in this case please set the PATH to
D:\ias9i\Apache\jdk\bin;D:\ias9i\Apache\jdk\jre\bin;D:\ias9i\Apache\jdk\jre\bin\classic;%PATH% )
3. Set the CLASSPATH to set CLASSPATH=%CLASSPATH%;C:\Dev6iR2\TOOLS\COMMON60\JAVA\IMPORTER.JAR;.
(If you do not set the CLASSPATH correctly you will get the error
PDE-UJI002 Unable to find the required java importer classes)
4. Now run the Forms Builder by using the command.
C:\Dev6iR2\bin\ifbld60.exe
Now the Java Importer Should Run fine.
Francois -
Can we run java bean from forms client server??
Hi,
The OLTP application we are planning to build has lot of gui e.g
tabs, drag and drop etc. Our aim is to make it web enabled but
the network bandwidth available is small 16 - 64K . So even
thoughwe plan toi use applet , we seriuosly doubt how good it
will perform on such low network bandwidth. [The system will
have 100 users]
Q1. What will be a reasonable bandwidth to run an oltp
application (say maintenance )
Hence we are thinking of developing with developer 6i and
deploying our application in client server mode, which can
easily be web enabled in future. But we also have to integrate
visual interfaces like gantt chart, which are not available with
forms. We plan to use third party java component (e.g ILOG
jviews), so that in future we can easily web enable the entire
application.
Q2. Can we run forms with java bean in client server mode? If
not, what are the products to be installed on each machine to
run it without using 9ias?
best regardsYes. We can run sql loader from client machine.
C:\Karthik>sqlldr user/pass@database data='test.csv' control='test.ctl' log='test.log' bad='test.bad'
You can go through the following link for better understanding.
http://www.oreilly.com/catalog/orsqlloader/chapter/ch01.html -
Call Java (Beans) from VisualBasic/COM?
Is this ActiveX Bridge (that come with the Java Plugin) suitable for Visual Basic programmers to call Java classes/beans/applications?
yes.
i have developed some tutorials etc. that use VBA that you can see here
http://www.reallyusefulcomputing.com/java/
i am also using the Bridge for a client server app with RMI where the
client is VB and the server is Java. -
Calling Java Classes from Forms 6.0
Can this be done?
How can it be done?
And, I don't mean JavaBeans... I don't want to embed a control
on my form... I want to call a standard java class routine.
Any help or laughter would be appreciated...
Thanks,
Pat Caldwell
[email protected]
nullYou have to write a wrapper classes so forms can call your java,
if you've got any yet.
Then use the Bean Area tool to draw the area your applet will
display in (if you don't want to display anything then don't
display anything in you java).
Its not really JavaBeans more like oracleBeans.
I've had to re-write functionality for the web such as
displaying open/save file dialogs.
If your interested and you've installed dev60, the example:
C:\orant\FORMS60
\java\oracle\forms\DEMOS\SOURCE\ProgressBarPJC.java and
ProgressBar.java got me started with alot of reading from
http://java.sun.com/products/jdk/1.1/docs.html
Patrick Caldwell (guest) wrote:
: Can this be done?
: How can it be done?
: And, I don't mean JavaBeans... I don't want to embed a control
: on my form... I want to call a standard java class routine.
: Any help or laughter would be appreciated...
: Thanks,
: Pat Caldwell
: [email protected]
null -
Hi Guys,
I am calling java bean from oracle Forms6i (implementation
class property set to bean class). This java bean in turn
calling some JNI methods written in C. The application server
(Forms6i) is hanging at the point of calling the JNI method.
Is oracle Forms6i supports all java functionality (JNI here)
and if so how to solve the problem ?
Any pointers or tips in this regard is highly appreciated ?
Thanks & Regards
Chandra MohanTo call Java from forms:
look at the technical documents on Java integration at
http://otn.oracle.com/products/forms
and also look at the Javabeans and PJC samples in the sample
code section of Forms on OTN.
Creating a random number using a java class is an excelent
example of how to use Java with forms. -
Accessing Java Classes from Forms
Is is possible to access a Java class from Forms? I have been
creating an Active X control that returns a Java object, and from
that I can call methods on that object, but I would really like
to do that without having and Active X control in the mix. Any
suggestions?
nullOracle Developer Team wrote:
: Robert Nocera (guest) wrote:
: : Oracle Developer Team wrote:
: : : hey robert -
: : : Developer 6.0 provides this ability for web deployment.
You
: : can
: : : insert your own custom Java components into your
application
: : and
: : : they will appear in the application when it is run via the
: web.
: : : If you look at the documentation for 6.0, there are a few
: : : section son Pluggable Java Components and JavaBeans that
: : : describes what is provided and how you use the interfaces
: and
: : : classes we provide.
: : : A whitepaper on this topic will be posted to the OTN
: shortly,
: : as
: : : well as some samples that illustrate how to go about doing
: it.
: : : cheers!
: : : -Oracle Developer Team-
: : Thanks for the quick response. Is there any way to access
: those
: : classes without being in a web deployment. That's probably
: not
: : totally out of the question, but what we had in mind was
: adding
: : some Java Functionality (actually connectictivity to some
EJBs
: : that we have) to existing forms. Currently there forms are
: not
: : deployed in a "web" environment and are just run from the
: forms
: : runtime engine.
: : -Rob
: hey again robert -
: there's no easy way (yet!) to call out from forms runtime
: process to a Java application.
: We've played around some with creating an ORA_FFI interface to
: JNI and then wrappering this with PL/SQL code. We've been able
: to make calling into an EJB running in 8i from a forms runtime
: work using this approach.
: Let me know if this is of interest to you and I can post the
: stuff we've currently got. It's no more than a simple demo and
: is not complete. It requires quite a bit of manual coding on
: the PL/SQL side since the interface emulates JNI (FindClass,
: GetMethodID, CallMethodID, etc.).
: cheers!
: -the Oracle Developer Team-
I'd be interested in this ORA_FFI doc you've been playing with.
Would you please email it to me or post it.
null -
Calling SQL*Loader from Forms
Hi,
I was wondering if anyone has called SQL*Loader from Forms?
What I am wanting to do is use Oracle Forms as the interface where you can specify a file that you can import into the database and it will use a set control file. Push the import button and SQL*Loader does the rest.
Is using Java code to call SQL*Loader from Forms a viable option, or is there an easier way to achieve the desired outcome.
Any ideas or guidance will be much appreciated.
Thanks,
Scott.Scott,
In forms, there's a HOST built-in command which is supposed to execute any o/s commands.
What you have to do is :
1. Bult up the string exacltly in the fashion which you will run in o/s
2. Call the HOST Built-in and pass in the string
Here's a example :
Declare
lOsCmd Varchar2(1000) := Null;
Begin
lOsCmd := 'sqlldr user-id=userid/passwd@connectStr '
|| ' control=c:\temp\abc.ctl log=c:\temp\abc.log '
|| ' bad = c:\temp\abc.log';
Host (lOsCmd, No_Screen);
End;
-- Shailender Mehta -- -
Canot call Weblogic Bean from Delphi via JNI
I tried to call a bean within the weblogiv server 7 from Delphi.
I use a JNI Wrapper which allows me easily to acces normal java objects.
I can call the bean from a java application.
When i try to call the bean via jni, the following error occurs:
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****
[ Assertion violated] at weblogic.utils.Debug.assertion(Debug.java:74)
at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:258)
at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:233)
at weblogic.rmi.internal.ClientRuntimeDescriptor.computeInterfaces(ClientRuntimeDescriptor.java:224)
at weblogic.rmi.internal.ClientRuntimeDescriptor.intern(ClientRuntimeDescriptor.java:123)
at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:165)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:145)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242)
at javax.naming.InitialContext.init(InitialContext.java:218)
at javax.naming.InitialContext.<init>(InitialContext.java:194)
at ejbtest3.ejbtest3sbTestClient1.getInitialContext(ejbtest3sbTestClient1.java:104)
at ejbtest3.ejbtest3sbTestClient1.init(ejbtest3sbTestClient1.java:32)
at ejbtest3.ejbtest3sbTestClient1.testmain(ejbtest3sbTestClient1.java:277)
It seems that i canno create a context object, but i do not know why ...
So i would be glad if anyone could help me here ...
Regards RobertI would try this with the newest service pack since it seems this assertion does
not exist in later code lines. It appears to be related to a class loader
issue. Do you know what version of the Java VM Delphi uses?
Sam
robert wrote:
I tried to call a bean within the weblogiv server 7 from Delphi.
I use a JNI Wrapper which allows me easily to acces normal java objects.
I can call the bean from a java application.
When i try to call the bean via jni, the following error occurs:
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****
[ Assertion violated] at weblogic.utils.Debug.assertion(Debug.java:74)
at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:258)
at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:233)
at weblogic.rmi.internal.ClientRuntimeDescriptor.computeInterfaces(ClientRuntimeDescriptor.java:224)
at weblogic.rmi.internal.ClientRuntimeDescriptor.intern(ClientRuntimeDescriptor.java:123)
at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:165)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:145)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242)
at javax.naming.InitialContext.init(InitialContext.java:218)
at javax.naming.InitialContext.<init>(InitialContext.java:194)
at ejbtest3.ejbtest3sbTestClient1.getInitialContext(ejbtest3sbTestClient1.java:104)
at ejbtest3.ejbtest3sbTestClient1.init(ejbtest3sbTestClient1.java:32)
at ejbtest3.ejbtest3sbTestClient1.testmain(ejbtest3sbTestClient1.java:277)
It seems that i canno create a context object, but i do not know why ...
So i would be glad if anyone could help me here ...
Regards Robert -
Embedding Java bean in Forms 6i
Hi,
Can anybody guide me to embed java bean in forms 6i . I need steps to embed. I tried the steps given in oracle site for KnobBean steps are confusing. Can anybody pls help me
thanks in advance
IlamHi
Following is the result of Jinitiator Java Consol.......
Oracle JInitiator version 1.1.8.19
Using JRE version 1.1.8.19
User home directory = C:\Documents and Settings\Administrator
JAR caching enabled.
Cache directory: C:\Program Files\Oracle\JInitiator 1.1.8.19\jcache
Maximum cache size: 50000000 bytes
Opening http://202.163.88.194:6777/forms60java/f60all_jinit.jar no proxy
Loading http://202.163.88.194:6777/forms60java/f60all_jinit.jar from JAR cache.
Opening http://202.163.88.194:6777/forms60java/java/awt/KeyboardFocusManager.class no proxy
Opening http://202.163.88.194:6777/forms60java/oracle/forms/engine/MainBeanInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/sun/beans/infos/MainBeanInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/oracle/ewt/swing/JBufferedAppletBeanInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/sun/beans/infos/JBufferedAppletBeanInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/oracle/ewt/lwAWT/BufferedAppletBeanInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/sun/beans/infos/BufferedAppletBeanInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/oracle/ewt/popup/PopupAppletBeanInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/sun/beans/infos/PopupAppletBeanInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/oracle/forms/registry/Registry.dat no proxy
Opening http://202.163.88.194:6777/forms60java/oracle/forms/registry/default.dat no proxy
proxyHost=null
proxyPort=0
connectMode=HTTP
Forms Applet version is : 60821
Opening http://202.163.88.194:6777/forms60java/oracle/forms/demos/GetClientInfo.class no proxy
Opening http://202.163.88.194:6777/forms60java/oracle/forms/demos/Utils.class no proxy
Regards
Laila Mac -
hi,
i m working with 10g version 10.1.2.0.2 (form builder).
i want to call java beans like calender in my form.
please give me suggestion.
thanx
PrashantDownload and install the Oracle Developer Suite 10g Demos and follow the instructions to install them. There is a Java Swing calendar demo included. There is also an example here (A Java Swing Calendar.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly.
Maybe you are looking for
-
Can I back up the songs from my iPod touch on my computer if my iPod Touch is lost or breaks?
I have over 700 songs on my iPod Touch and am worried that I will lose them if my iPod is lost, stolen or breaks. If the songs are already on my hard drive, I cannot find them anywhere in the iPod directory. Are they there? How can I find them? If n
-
Trading partner removel and its effects
My client has this scenario they want to see if they remove trading parner from the config what will be the effect of that, so i have these questions. I will appriciate if some one can guide me on this. 1 If we remove trading partner what will be th
-
Hi Guriji,s I wrote one inner join query. it is working fine. but when i exceute this query it is fetching the data only 261 movement type but but i also fetch the data movement type 201. for this plz tell me the correction in this query. select amat
-
Multiple Target (Backup) Drives
I have an external 1-TB drive I used for more than a year until the power supply died. At the time I needed an immediate backup before extended travel. I used a spare 250 meg external drive and started a new backup series. It has been 3 months and I
-
1811W Default Signatures Are Not Active
I'm using SDM to configure IPS and the default 128MB.sdf signature file is not loading. There are only 3 active IPS signatures when there should be much more. I've successfully deployed IPS using SDM on other 1811W and 1841 units. Can someone tell me