Using SQLJ from JSP in JDeveloper
Hello,
Has anyone succeeded in creating a JSP file by using SQLJ in JDeveloper 3.1 (Build 681)?
In the whitepaper http://technet.oracle.com/docs/tech/java/servlets/jsp/whitepapers/jsp-oow99-paper.pdf
it is stated that you can create an SQLJ-JSP by giving the JSP file the .sqljsp extension. This results in an "Fatal error: compiler internal error." in JDeveloper.
In the same whitepaper, it is stated that you can also use the following JSP page directive to create an SQLJ-JSP page:
"<%@ page language="sqlj" %>"
This results in an "Error: (16) illegal character." error in JDeveloper at the mere sight of "#sql".
Any help would be appreciated.
Helgi
Hi,
there is something wrong with the code.
I will update you when it is fixed
(1352536)
Similar Messages
-
Using SQLJ in JSP files ... ?
Hi,
has anyone used oracle 8.1.5 SQLJ with JSP pages? In partucilar, with Apache Tomcat 3.0?
Help much appreciated, direct mails ([email protected]) preferred!
Cheers, all - keep up the good work!
nullHi,
Yes, OJSP inside JDeveloper cannot currently handle the language="sqlj" extension. A workaround is to name your file Foo.sqljsp.
Before running the JSP on a webserver you will need to map the sqljsp extension to the class oracle.jsp.JspServlet, just as for OJSP setup, and then you can hit the page directly:
http://<host>:<port>/SQLJQuery.sqljsp
Let us know if you have problems..
- Julie
null -
UNABLE TO ACCESS SECURED EJB USING IIOP FROM JSP
Following codes does not work with IIOP when called from jsp returns an
com.sap.engine.services.iiop.CORBA.CORBAObject:com.sap.engine.services.iiop.server.portable.Delegate_1_1@8312b1 step2 RemoteException occurred in server thread; nested exception is: java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: User Guest does not have access to method create(). at
Following codes does not work with IIOP when called from a fat client returns an
org.omg.CORBA.UNKNOWN: vmcid: 0x0 minor code: 0 completed: Maybe
at com.sun.corba.se.internal.core.UEInfoServiceContext.<init>(UEInfoServ
iceContext.java:33)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at com.sun.corba.se.internal.core.ServiceContextData.makeServiceContext(
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.cosnaming.CNCtxFactory");
p.put(Context.PROVIDER_URL, "iiop://hostname:50007");
p.put(Context.SECURITY_PRINCIPAL, "User");
p.put(Context.SECURITY_CREDENTIALS, "pass");
I have add java option to add IIOP filer
-Dorg.omg.PortableInterceptor.ORBInitializerClass.com.sap.engine.services.iiop.csiv2.interceptors.SecurityInitializer
Solution Required: Could you please detail me what steps in need to perform in order for me to access secure ejb using iiop protocol.
FYI -- How ever ejb security works with P4 protocol, If required i can send you the test case ear.
Thanks
Vijay
Following are the server side logs
java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: User Guest does not have access to method create().
at test.TestEJBHomeImpl0.create(TestEJBHomeImpl0.java:91)
at test._TestEJBHome_Stub.create(_TestEJBHome_Stub.java:214)
at jsp_testIIOP1199698887113._jspService(jsp_testIIOP1199698887113.java:33)
at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.security.exceptions.BaseSecurityException: Caller not authorized.
at com.sap.engine.services.security.resource.ResourceHandleImpl.checkPermission(ResourceHandleImpl.java:608)
at com.sap.engine.services.security.resource.ResourceHandleImpl.checkPermission(ResourceHandleImpl.java:505)
at com.sap.engine.services.security.resource.ResourceContextImpl.checkPermission(ResourceContextImpl.java:45)
at test.TestEJBHomeImpl0.create(TestEJBHomeImpl0.java:89)
... 20 more
; nested exception is:
java.lang.SecurityException: com.sap.engine.services.security.exceptions.BaseSecurityException: Caller not authorized.
at com.sap.engine.services.security.resource.ResourceHandleImpl.checkPermission(ResourceHandleImpl.java:608)
at com.sap.engine.services.security.resource.ResourceHandleImpl.checkPermission(ResourceHandleImpl.java:505)
at com.sap.engine.services.security.resource.ResourceContextImpl.checkPermission(ResourceContextImpl.java:45)
at test.TestEJBHomeImpl0.create(TestEJBHomeImpl0.java:89)
at test._TestEJBHome_Stub.create(_TestEJBHome_Stub.java:214)
at jsp_testIIOP1199698887113._jspService(jsp_testIIOP1199698887113.java:33)
at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)That's the code that you need to execute but you should
probably encapsulate that code in Custom Action.
Orion has a EJB Tag Library that is free to distribute that
does all that stuff you just set some attributes.
Go to their site and look at their Tag Libraries.
Also look for other Tag Libraries Freely Available for EJB Access. -
How to connect oracle database using DSN from jsp
hello, can any know how can i connect to[b] oracle database using DSN name from jsp .I am using oracle 9i and Tomcat 5
Using odbc tool i have created the dsn name but ithe connection does not make .here is the code that i have tried
Connection connection = null;
try
Class.forName("oracle.jdbc.driver.OracleDriver");
catch(ClassNotFoundException Exception)
out.println("error occoured during loading the driver ");
try
out.println("getting the connection");
connection = DriverManager.getConnection("jdbc:oracle:deepak","scott","tiger");
out.println("connection getted");
catch(Exception exception1)
out.println("error occoured ");
pls help as soon as possible
Sorry, for my englishyou are actually using JDBC so the DSN entry does not matter.
2 things.
Make sure that your oracle database driver is in your classpath on your tomcat server.
I.E. copy the file classes12.jar into your common/lib folder of tomcat, or into your WEB-INF/lib folder of your application. and RESTART your server. classes12.jar can be found on the internet or more easily somewhere within your oracle installation. just search for it.
Make sure your jdbc url is correct. I believe it goes like this.... fill in the blacks
connection conn = DriverManager.getConnection("jdbc:oracle:thin:scott/tiger@MyOracleHost:1521:MyDB");Note how the username are passed in the first string there fore there is no need to pass additional parameters. This method may be depriciated, but if so, just take out the user and pass from the string and continue to pass them as 3 seperate strings.
connection conn = DriverManager.getConnection("jdbc:oracle:thin:MyOracleHost:1521:MyDB","scott","tiger");That should get your connection. if not, post your errors. -
Using JSObject from jsp..
Hello there,
I am trying to use the netscape.javascript.JSObject from a jsp page. However, it looks like, JSObject is only to be used from an applet. Is it true? If it's not possible to use JSObject from the jsp page, is there a way that I can evaluate a Javascript expression in my Java code and assign its value to a Java variable?
Thanks a lot in advance!The Java code in the jsp file is executed on the server side, whereas the javascript stuff is executed on the client. So it's wonky to figure out what the heck you're trying to do.
-
Using ActiveX from JSP or alternative to using Excel
Hi, I'm newbie in Java, and I have one problem I want to generate Excel Charts from Java, and I don't know if I can call an ActiveX control or COM component from Java, and if it isn't possible I want to know some modules that I can use to generate charts for using it in an HTML web page, thanks a lot.
Hi, I'm newbie in Java, and I have one problem I want
to generate Excel Charts from Java, and I don't know
if I can call an ActiveX control or COM component from
Java, and if it isn't possible I want to know some
modules that I can use to generate charts for using it
in an HTML web page, thanks a lot. There are 2 possibilities:
1) Use Java <-> Com bridges - there are 2 of them Sun's COM->EJB and IBM's EJB->COM (probably visa-versa). Look at:
http://www.theserverside.com/home/thread.jsp?thread_id=7588
and
http://www-3.ibm.com/software/webservers/appserv/doc/v40/aee/wasee_content/xjb/concepts/cxjbovw.htm
There are also (I heard) other implementations of ActiveX<->EJB bridges
2) You could use POI - it's open source http://jakarta.apache.org/poi/
POI means Poor Obfuscation Implementation - it's really poor... and I'm not sure that it supports charts - though with common sheets it works well.
Paul -
Simple Java class using SQLJ not compiling.
Hello all, I have a simple Java class that is using SQLJ. It will not compile though. I am not sure what I should set for classpath. Any ideas? This is what I have so far.
set PATH=C:\jdk1.2.2\bin;c:\oracle\ora81\jdbc\bin;
set CLASSPATH="C:\oracle\ora81\jdbc\lib\classes12.zip;C:\oracle\ora81\sqlj\lib\runtime12.zip;C:\oracle\ora81\sqlj\lib\translator.zip;C:\jdk1.2.2\lib\*.*"
then
javac SQLJTester.java
Here is my .java file ---
import java.io.*;
import java.sql.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
public class SQLJTester {
public static void update() throws Exception {
java.sql.Timestamp timeNow;
#sql {
BEGIN
:timeNow := sysdate;
END
public static void main (String[] args) {
try {
SQLJTester.update();
System.out.println ("Updated successfully");
catch (Exception e) {
System.out.println ("Caught an exception.");
Thanks ahead for your time,
JustinWhen sqlj files are compiled and translted to java file with them the file with extension .ser is also generated. browsers do not recognise this .ser files they only understand .class files which the download using <codebase> instead of class path. so thats why you r not able to use sqlj in servlet. try to customize the profile. Now can some one inform how to use sqlj from eclipse. does it support?. i need to downoad sqlj.exe for that. if anyone has idea from where i can download sqlj.exe pls inform me at [email protected]
-
Does anyone know how to develop JSP using SQLJ? This chapter is not availabe in the developer's guide. And which one is a better solution, JSP + BC4J or SQLJ?
I would stick with the JDK 1.1.8 in JDeveloper 3.0. SQLJ and JDBC do not yet support JDK 1.2 (they will in Oracle 8.1.6 and JDeveloper 3.1... not sure about OAS 4.0.9, but I would suspect so).
Laura -
Crystal report from JSP using the JRC
Hi, I am trying to call crystal report from JSP using the JRC.
But i am getting the Error as 'Logon Failed'. my web.xml entry is
<env-entry>
<env-entry-name>jdbc/Test</env-entry-name>
<env-entry-value>!oracle.jdbc.driver.OracleDriver!jdbc:oracle:thin:{userid}/{password}@//10.0.0.1:1521/TestDB</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
i am setting the userid and password in the code. Please see the below code for your reference. Please help me to solve the issue.
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
<%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
<%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSource" %>
<html>
<head>
<title>Crystal Report with Database Logon information</title> </head>
<body bgcolor="#ffffff">
<%
try
String report = "/TEMPLATE.rpt";
IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
JPEReportSource reportSource = (JPEReportSource) rptSrcFactory.createReportSource(report, request.getLocale());
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(reportSource);
viewer.setHasRefreshButton(true);
IConnectionInfo newConnInfo = new ConnectionInfo();
newConnInfo.setUserName("TEST");
newConnInfo.setPassword("TEST");
ConnectionInfos newConnInfos = new ConnectionInfos();
newConnInfos.add(newConnInfo);
viewer.setDatabaseLogonInfos(newConnInfos);
viewer.setEnableLogonPrompt(false);
viewer.setOwnPage(true);
viewer.setOwnForm(true);
out.println("Connection Information: "+viewer.getDatabaseLogonInfos().getConnectionInfo(0).getAttributes().toString());
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(),null);
viewer.dispose();
catch(Exception e)
throw new JspException( e);
%>
</body>
</html>I never really had much luck with this approach.
Mind you I was using Crystal Reports 10, and as far as I recall it didn't allow setting/changing of database at this level.
Things to check
- can you create a database connection on your page with this URL/username/password?
- what server are you using? Tomcat? WebLogic?
I found this in your other post:
Connection Information: {Server Name=ee6rpt, Connection String=DSN=s(ee6rpt);User ID=s(ee62test);Password=;UseDSNProperties=b(false), Database Name=, Database DLL=crdb_odbc.dll}That would indicate it is using odbc to connect to the database (crdb_odbc.dll). ODBC is a bad idea with java.
The way I have got it to work for me (after much trial and error) was to in Crystal Reports to connect using the Oracle Driver, and specifying a tnsname - eg define REPORT_DS in tnsnames.ora.
When running through the JRC, it looked for a JNDI datasource under that same name "REPORT_DS".
Don't know if that will help you or not.
Good luck,
evnafets -
Insert data into table from JSP page using Entity Beans(EJB 3.0)
I want to insert data into a database table from JSP page using Entity Beans(EJB 3.0).
1. I have a table 'FRIENDS', (in Oracle 10g database).
2. It has two columns, 'NAME' and 'CITY'. Both have datatype strings(varchar2).
3. Now from a JSP page, having two textfields, 'NAME' and 'CITY', I want to insert data into table 'FRIENDS'.
4. In between JSP and database is a Entity Bean(EJB 3.0) and a stateless session bean.
5. I am using JDev as editor.
Please provide me code ASAP or link with similar example.
Thank you.
AnuragHi,
I am also trying that scenario. So u can
Post the jsp form data to a Servlet which will act as a Controller.
In the servlet invoke the business method.
Similar kind of app is in www.roseindia.net
Hope this would help u.
Meanwhile if u get any optimal solution, pls post it.
Thanks,
Happy Java Coding. -
I am very new to this JDeveloper & BPEl Process , please could some one help in ersolving my problem that is , how to upload a file in BPEL Console Using JSP in JDeveloper.
Hi,
ADF Faces provides you with the file upload component
http://download-uk.oracle.com/docs/html/B25947_01/web_complex006.htm#CEGCEDHF
http://download-uk.oracle.com/docs/html/B25947_01/appendixa007.htm#CHDEDCFA
This gives you a handle to the file content. However, uploading files through a service is different and I suggest to consult teh BPEL forum for this BPEL
Frank -
How to upload a file in BPEL Console Using JSP in JDeveloper, please help..
Please I am new to Jdeveloper and to BPEL Process of OASuite,I want to know , how to upload a file in BPEL process using JSP in Jdeveloper IDE.
The main aim is first we need to upload a file in JSP , it has to go to BPEL Process & it has to read the file & write the respective file in return to JSP through BPEL Process. Please I am in Urgent need of the Query , please help me ASAP.
Send to me response Please.....................................Hi,
I thin that you asked the same question before and I premember that I ointed you to the ADF BC developer guide and the SRDemo if your application uses JSF. For plain JSP - if you Google for: JSP and file upload then you find plenty of sources for JSP and Struts.
The remaining part is how to stiff the file into a BPEL service on the middle tier. For this I recommended to ask your question on the BPEL forum
BPEL
Note that the BPEL integration would be easier if it was done on the middle tier and not onthe client
Frank -
Import a servlet from JSP without the use of a .JAR
Migrating web app from NT / iPlanet 4.1 to Solaris / iPlanet 4.1.
I've created a Web app in which JSPs utilize Servlets stored in a JAR file. I am now moving the app to a server that I do not control. I wish to configure the app in such a way that I will be able to modify the servlets and not have to restart the Web server to see the changes. I assume the only way to do this is to remove them from the JAR file.
I'm familiar with how to package servlets in JAR files and use them in JSPs, but can't figure out how to import (my own) servlets from outside the JAR file. Is there any way to do this without specifying the servlet in the CLASSPATH?
...sorry if it's a stupid question, I'm not a Java programmer. Thanks in advance. Please let me know if I have not given enough detail.I've created a Web app in which JSPs utilize Servlets
stored in a JAR file. I am now moving the app to a
server that I do not control. I wish to configure the
app in such a way that I will be able to modify the
servlets and not have to restart the Web server to see
the changes. I assume the only way to do this is to
remove them from the JAR file.Bad assumption! This will have no impact on reloading the servlets!
What you are asking for is called 'hot deployment'. Not all servers do that.
Tomcat 4 does for instance, but you have to configure it for your specific webapp to be able to use it.
Hot deployment just reloads all the classes in its classpath, it doesn't matter if they're in jars or just .class -
Use groups from BPMObject in JSP
Hi all.
Please, help me.
I don't know jsp...but I find a little example project in Oracle BPM Studio, which describe the process of using jsp in BPM project. (JSP-Screenflow_FoodDelivery.exp) But there is no any code in this example how we should use groups from BPMObject in JSP. I mean that I don't know what I should do to input in my JSP table part (with dynamic rows). That’s why..can you write such example, or (better) give me such project in BPM (*.exp).
Thanks.You will find the sample exp files under the samples folder where you installed Studio (this is the case for OBPM so I assume the same for ALBPM).
I'm also interested on how others are using groups within jsps.
I have a BPM object called 'Order' that has a group of 'OrderItems' and I want to fill in the 'Order' and add as many 'OrderItems' as required from within a JSP. The only way I've found to do this is have an automatic task before the interactive initialise the required number of 'orderItems' and then just update them in the jsp. Does anyone know a better way of doing this?
Thanks,
Mike -
Can I simulate SELECT * FROM TABLE WHERE ROW IN (1111,2222) using SQLJ
I have a fct like
public void fct(String inStr) {
String str = "SELECT * FROM TABLE WHERE ROW IN" + inStr;
// then I xecute the query using JDBC connection
But I want to do the same thisn using SQLJ like:
public void fct(String inStr) {
#sql [nctx] iter = { SELECT * FROM TABLE WHERE ROW IN :inStr}
When I run the second version and give a parameter like "(1111,2222)" it gives
ORA-01722: invalid number error.
Is there a way to give parameters to in clauses of SQLJ statements.
Thanks in regard.This is a SQLJ FAQ. You can find the FAQ at:
http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html
Your question is addressed in the following section:
http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#variablesizevaluelist
Note that that section has a typo. The lines:
? // populate mynumbers
#sql { SELECT * FROM tab WHERE col in (:(a[0]),:(a[1]),?};
should read:
... // populate mynumbers
#sql { SELECT * FROM tab WHERE col in (:(a[0]),:(a[1]),...};
By the way, with the next release SQLJ will support pasting in of dynamic SQL fragments. Then you'll be able to do pretty much what you are trying to accomplish here (albeit with slightly different syntax). Until then you'd have to use the workarounds from the FAQ.
Maybe you are looking for
-
INS-08109 Unexpected error occurred while validating inputs at state nodeselection page
Scenerio: We have 4 node 11gr2 RAC cluster and Trying to install RAC Database software only on two nodes Getting warning on run Installer Page INS-08109 Unexpected error occurred while validating inputs at state nodeselection page while selecting two
-
I know this topic has been brought up many times. I've read through the other threads, but still haven't found a solution. I use the iPod AV connection kit to connect to my TV and it has worked fine in the past. But now that I've updated iTunes and m
-
I cannot open password protected PDF document having attachments on my OS X (v 10.8.4) with Adobe Reader X nor XI. The reader crashes. The same document using the same password opens fine on the laptop and Windows systems wheni it is fetched from a s
-
How can I incluce a hyperlink to TDMS file in the report?
Hi, I am storing the measured data in TDMS file in each step. File name is written to the ResultText property so it is visible in the report. I would like to have hyperlink in the report that opens this TDMS file automatically either with DIADEM or w
-
"Business View" of archived data in ECC 6.0 ?
We have a customer that doesn't like the (ixos)view of archived pr_order and pp_order data (archived in SAP 4.7). They will be going to ECC 6.0 next year and are hoping for a 'business' view of this data when they get there. Is there such a thing?