Trasferring data b/w VB and Servlets
Hi All,
We have standalone VB application ,that needs to upload data to a central database . Due to security restrictions ,the VB application is not allowed to open a DB port explicitly.
So Im thinking of having a servlet which will act as a proxy for this DB insertions and retreival.The VB application talks to the servlet with the XML data.
Is it possible to have a VB application send large data to the Servlet ? Im aware that thru VB we ca send in parameters as query string.We are sending and receiving XML documents(say as String) which wont fit in a querystring.
Any ideas will most useful.
Thanks in Advance.
One method is to send the data as if it were a file upload from an HTML <input type="file">. I do this using the InternetWriteFile method of the wininet.dll after using HttpOpenRequest to set up a POST connection.
Using InternetWriteFile, you can either generate the data to be uploaded on the fly within VB or make an actual file to upload and then stream the file to the InternetWriteFile command in chunks. I usually use the latter because I zip the file before uploading.
On the server side, the servlet saves the file just as it would process an HTML file upload and then opens it to parse the data.
Similar Messages
-
Delete data dynamically with JSP and servlet (Very Urgent)
Hi,
I am new with servlets and JSP. On my jsp page I am populating customer names in a drop box from database and I have 3 buttons ADD, DELETE and EDIT.
Now when I press DELETE buttong I am calling delete function which is writen in Javascript on my jsp file only,now I want to pass these selcted values ehich I have stored in an array to be pass to servlet,so I can write Delete query for it and delete.
Could anyone help with sample code>
Here what I am trying to say:
<HTML>
<HEAD>
<script language="JavaScript" type="text/javascript">
<!--
function remove()
var u = confirm("Are you sure you want to Delete Selected names?")
if (u==true)
var selectedArray = new Array();
var selObj = document.getElementById('CUSTOMER_NAME');
var i;
var count = 0;
for (i=0; i<selObj.options.length; i++) {
if (selObj.options.selected) {
selectedArray[count] = selObj.options[i].value;
count++;
alert("names to be deleted are:"+selectedArray);
// selectedArray has the selected items stored
alert("Items Deleted!")
else
alert("No data were deleted!!You pressed Cancel!")
//-->
</script>
</HEAD>
<BODY>
//calling servlet on action tag of form
<FORM METHOD= 'POST' ACTION='Remove_Customer'>
<form ><INPUT TYPE='submit' NAME='DELETE' VALUE='DELETE' onclick="remove()"></TD></form>
<form><INPUT TYPE='submit' NAME='MODIFY' VALUE='MODIFY' onclick="modification()" ></TD></form>
</BODY>
</HTML>
PLEASE HELPME,it's very urgent.
Since the selected Array is in javascrip language , I don't know how can I pass that to servlet.
request.getParameter is not working,since it's an array
Many thanks in Advance.Hey,
I am having problem deleting multiple values.
If I just select one value,it deletes it
But for multiple values the code is not working right.
If there 2 values selcted then the last value gets deleted,if there are more than 2 values selected none values delete.
Could plese check the code,and let meknow what mistake am I doing?
Please help
String delName="";
int pos = tStr.indexOf(",");
System.out.println(pos);
if (pos != -1)
delName = tStr.substring(0, tStr.indexOf(","));
tStr = tStr.substring(tStr.indexOf(",") + 1 );
System.out.println("DElName:"+delName);
System.out.println("tStr::"+tStr);
delName = tStr;
delete_Customer(delName);
Thanks
ASH -
Reconciliation to verify data in R/3 and BW
Hi Experts,
Can any one explain me how we will maintain reconciliation to verify the data in SAP R/3 and SAP BW are same or not after the data loads. Please explain all the sources that we have.
Thanks in advance
MallikFor Unit Test, you don't need to reconcile all the records. So, I take a couple of selections. Using these, go to RSA3 in R/3 and extract the data and take sub-totals in Excel.
Now, go to Info Provider in BW, and using same selections, download the data in BW or BEx and take sub-totals again and compare both.
If the extractor is generic extractor based on View/Tables, you can go one additional step and get data from SE16 in R/3 to make sure RSA3 and Tables also match.
For Business Content extractor, its a little difficult is do this step because most of them are Function Modules.
This should be enough as long as your selections are good.
You can compare the data from RSA3. Run RSA3 and save the data in a file and then compare with BW.
You can compare the PSA data with R/3 to check whether your data transport is correct.But its very much important the end result (with data in Data Targets ex.Infocube...) should be reconciled with the R/3 data to check your update and transfer rules are working fine.
The second part is too tricky since you cannot directly compare the reports while the formats and grouping are different.
You can execute the reports in R/3 and apply the Update and transfer conversions (at least for random records) then reconcile with the BW data.
Take a look on the note: 543188
"How to Reconcile Data Between SAP Source Systems and SAP NetWeaver BI"
The Data Reconciliation procedure is still in the SAP action item for the future release.
But we can reconcile the data by extracting the reports and compare with the query output in Excel sheet.
Please check for a tool "Excel Compare" in google which is really useful in comparing excel files.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7a5ee147-0501-0010-0a9d-f7abcba36b14
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/how%20to%20validate%20infocube%20data%20by%20comparing%20it%20with%20psa%20data
By this method you can compare your infocube data with PSA ones...clearly, every changes in R/3 (due to user exit or, above all, BW-specific standard logic) is not taken into account...if you want to consider also this part (back-end), there is no std method and it depends from every specific flow!
also check in service.sap.com/bi
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7a5ee147-0501-0010-0a9d-f7abcba36b14
One way is to define Remote Cube on the R3 data source and create multiprovider on BW with the Remote Cube and the BW target. Subtract the KF on R3 from the KF in BW - anything not 0 becomes an exception.
Sometimes the source on R3 is not as straight forward and we have had ABAP developers create summary table on R3 to compare to BW.
Actually one to one Data comparison between R/3 and BW is done during Integration Test phase. During this time we need to sit with R/3 team and work closely because they know exactly the numbers in R/3 side and which tables Data resides and all. After loading Data same data in to BW we compare the numbers between R/3 BW. If both the teams feel there is some data missing then we start the analysis. As a first stem we will see in the extractors then BW side during transformation like transfer and update rules.
Pleases see this document for more help
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/968dab90-0201-0010-c093-9d2a326969f1
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/how%20to%20validate%20infocube%20data%20by%20comparing%20it%20with%20psa%20data
verifying the data which is coming from R/3 to BW system. That is called as Reconciliation.
That process is done with v lookup functionality.
Hope this helps and assihn points, if so
Regards
Raja -
Hi friends,
[please forgive me if i am posting this in the wrong forum, all seems same to a fresher]
Now, to my problem..i need a suggestion, a way or a method to implement the following!
I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task?
Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSP
Thanks in adavancearun_ramachandran wrote:
[please forgive me if i am posting this in the wrong forum, all seems same to a fresher]Then you should learn to be more observant - after all, we have JSP and Servlet fora, further down the list. :)
I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task? You can store the data in your session object. You can even use JavaBeans and the jsp:usebean tag.
[http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html]
Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSPA wise approach - I wish more prople woiuld be as thoughtful. -
Ale transcation data uploading for outbound and in bound system
hi,
can any tell me what is idoc trirrering prgm when we uploading transcational data for invoice in outbound, inbound system. if u have brief information ALE outbound interfaces for transactional data such as invoice and SD send mehi bharathi j
go through these links
ALE/ IDOC
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://www.sapgenie.com/sapedi/idoc_abap.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
http://www.allsaplinks.com/idoc_sample.html
http://www.sappoint.com/abap.html
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.allsaplinks.com/idoc_sample.html
Check these step-by-step links
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
regards
Nagesh.Paqruchuri -
How to upload a file into server using j2ee jsp and servlet with bean?
How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
Anyone help me please!u don't need j2ee and struts to do file uploading. An example is as such
in JSP. u use the <input> file tag like
<input type="file"....>You need a bean to capture the file contents like
class FileUploadObj {
private FormFile srcFile;
private byte[] fileContent;
// all the getter and setter methods
}Then in the servlet, you process the file for uploading
* The following loads the uploaded binary data into a byte Array.
FileUploadObj form = new FileUploadObj();
byte[] byteArr = null;
if (form.signFile != null) {
int filesize = form.srcFile.getFileSize();
byteArr = new byte[filesize];
ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
bytein.read(byteArr);
bytein.close();
form.setFileContent(byteArr);
// Write file content using Writer class into the destination file in the server.
... -
Implement SSL in JSP and servlets
hi there,
i needed some help in implementing ssl in JSPs and servlets. My idea was to have a login page and also use it where sensitive data is being sent. I have used the basic socket programming (socket.class and serverSocket.class) in GUI applications using threads to listen and send simultaniously and understand how it works but how do I implement it in JSP and servlets and where do i store the certificate?
i do know that using SSL sockets is very much the same as using the normal sockets.
can anyone tell me any useful links or give me a step by step guide how to implement it and which classes to use
your help would be very much appreciated.
manihi,
soory for late reply.
i think you need to use keytool program in your JDK to generate a certificate signature file and you need to configure the server.xml to open and use the HTTPS port. I have not had any additional info on this but i would assume that you simply enter https:// on the file you wish to load in your form and it should use the HTTPS port provided it can find the certificate which must be stored somewhere in your tomcat web server. i would recommend you see tomcat website or search on google for "ssl support in tomcat".i hav not had time to look into this but i will as soon as i am free from my work load.
mani -
Hi there,
A frontend processing of HTTP request that pass thru WebLogic server that make
API calls thru tuxedo to the application servers that eventually running C, C++
that retrieve data from a backend database of Oracle.
Being the services of EJB and Servlets, EJB is more kind of processes inside the
server but Servlets can handle better in request and respond (talk to the client),
whats your opinions in this kind of integration? Go for pure EJB or Servlets?
Or shall mixed matched? and how should the architecture should looks like?
Thanks
NeoSorry, wrong question, just ignore it.
-
I'm creating JSP pages to represent the view of the site and servlets to get the request and decide which JSP page to load next.
When the servlet recibes a request it generally has to query the database to get some data and then show it back to the client. To do this the servlet calls other object that is responsible to query the database and fill a ResultSet.
My question is: what is better, to load a Vector with special objects containing the data in the ResultSet and then return this vector to the jsp page for it to use it, or may a return directly the ResultSet to the jsp page? With the first option I have to cycle in the resultSet to load the vector and then cycle through the vector to show the results. With the second option I cycle only once, but I isolate from the database (column names, order in which the things are returned...)
I hope anybody can give me an opinion.
ThanksThere are a few things wrong with this:
1) MVC -> The View should have no Model work init.
For the MVC pattern, the database is Model. Use
a
a ResultSet in JSP, and now your View is lockedto
a
database with a specific column format.
Huh? I think that's backwards. The View willalmost
always require Model data unless it is a staticpage.
The Model, however, should be agnostic about what
t View technology it serves. (The Controllerbridges
the two). Also, I would call the database the
Persistence or Integration tier, a separateconcept
from the Model, though intimately coupled to it.I meant the work of the model (gathering the data to
a presentable form) is moved to the View. Yes, the
View needs to know the Model to be able to display
its data. But the Model should handle the data
collection.
Fair enough. I might have read it backwards as well.
>>
2) Any web application (or any application in
general) wether it uses MVC or not, should still
follow a 3 tier approach: Persistance (Data),Domain
(logic), Presentation (View, output) (note, thisis
different then MVC.) By moving the ResultSet inthe
JSP you would be dragging the Persistancemechanism
up two layers. Generally, a layer should only
see
the layer just below it (Presentation seesDomain.
Domain sees Persistance. Persistance never sees
s Domain or Presentation. Domain never sees
Presentation. Presentation never seesPersistance).
>
I agree that Persistence and View should not seeeach
other. However, Model and Persistence must. How
else do you write a DAO? Or even use a mapperlike
Hibernate?First the Model doesn't fit into just one of the
three tiers (Persistance Domain and Presentation).
The Model of MVC is both the Domain logic and the
e Persistance mechanism.
To me, at least, Domain logic = model. The terms I have normally read is either "business tier" or "model domain". "Patterns of Enterprise Application Architecture", M. Fowler. Though, I will concede that this tier has the least well defined set of terms.
But for the three tier architecture: the domain sees
the persistance. You always see one layer down. So
Domain sees the persistance and pulls the data into
the model. So a DAO would be part of the Domain, the
logic of collecting the data from the database to be
used in the application (in the correct object graph
and all that). The persistance though, doesn't see
the domain.
Hmm, I'm not sure which direction 'down' is. And even if 'down' meant towards the back-end or away from it, what about the controller? It parses view requests and delegates them to the model. The results are then normally returned to the controller for dispatch to a view. So, the controller seems to have its fingers in all the tiers except integration and persistence, at least to me. I think of the controller as the 'middle man' between model and view that lets the model be agnostic to the view. The view and controller will to some extent always be coupled. However, the model theoretically exists on its own.
Half of me thinks that I have a different view on
where the Domain and Persistance border is. I
thought the DAO or the Data Mapper would be in the
Domain, whereas you seem to be saying they are in the
Persistance layer?
That's interesting. I don't know if there is an absolute answer. We are dealing with the O/R boundary, and the DAO straddles the boundary. However, one could, at least theoretically, change persistence strategies. What would change? Not your model objects, but your persistence tier objects. Though, again, the definition is nebulous.
3) From a Practical matter:
In many DBs, if you close the connection fromwhich
the ResultSet was derived, the ResultSet is
closed
and you get errors if you try to access it. Ifyou
don't close the connection in the Servlet beforeyour
JSP, then you have to do it in the JSP. Thatmeans
even more DB bleed through to the JSP, and theM->V.
Or, you could just not close the Connection and
d allow it to hang around and create memory
leaks.
>
Yepper.
4) Also practical:
To use the ResultSet in JSP is going to require
scriptlet code. This is ugly and hard to manageand
update later. You have to wrap your code in
try{}catch(SQLException e) {} finally {}, so
the
code is even uglier and harder to manage(especially
if you end up not touching the thing for monthsand
forget what you had done - or god forbid someoneelse
has to keep up your code). You could make acustom
tag to handle it, which makes the JSP easier toread,
but does further damage of spreading the dataaccess
code all over the application.
Definitely!
5) Practical:
When you do this sort of thing, then later
decide
to
change the way the database is set up, digging
all
the places affected by the simple renaming of a
column, or refactoring of which columns are inwhich
tables becomes a heavy effort. Keep it all in a
DataAccessObject, and changes in DB becomestrivial
to keep track of in your code. It is all in one
place, and can be tested off line. Harder stillis
if you change persistance from a database to anXML
library, or some directory lookup or something.You
would have to completely refactor your Servlet
and
your JSP. Put it in a DataAccessObject and allyou
have to do is switch out the DAO instance. The
change is transparent to the Servlet and the JSPas
long as you maintain an interface.
Just keep in mind that for the vast majority of
projects, the RDBMS technology is rarely switched.I
generally program to interfaces in my Model, butmy
Persistence tier is always so tightly coupled thatI
simply use POJO's without an interface.
6) Practical:
I have elluded to this several times, but I will
state it specifically. When you isolate the
persistance and data access to its own layer
then
you
can swap out the presentation (the View and the
Controller) when testing all your persistance
operations. This means the data is independent
of
the container. You can run it out of theServlet/JSP
environment and it will behave EXACTLY as it
will
inside the JSP environment. You can designrobust
tests, debug, redesign, re-edit, etc... muchquicker.
Then, when all done, plug it into your web app
p without worry.
Great point.
Of course, Numbers 3 -> 6 are the reasons why
following 1->2 (MVC and the 3 Tier architecture)are
such good ideas.- Saish
BTW, please take all the above just in the interest of having a good discussion. I have been wrong many times before! ;^)
- Saish -
Java app with web service and servlets
Hi. I intend to make a java application which exposes some methods as a web service and as jsp/servlets. It's core functionality is not really web centric, but its more a java app with a web tier. I am not sure about how the architecture of such a system would look like using the java platform. I currently see three options:
1. Run everything in a servlet container like tomcat. I hesitate to do this because i would be putting a lot of functionality which isn't about the web into a servlet container. Also, I have a lot of application scope data that is maintained and shared by all servlets/web services. However, it would be really easy just to put everything into tomcat and use ServletContext to maintain some global objects.
2. Use a Java EE to seperate application/business logic and data access into session beans and entity beans. I hesitate to this because it seem a bit overkill because the system isn't very big or complex right now. It also means that I would have to learn to use EJB's instead of just using some POJOs.
3. Run the web tier in a servlet container and the main app in a separate JVM, and then connect the tier by sending serialized objects over TCP sockets. I don't like writing network code but at least there is some separation of the tiers.
What would you do? Maybe I have overlooked a much better solution to the problem?
Let me just say that the system is the product of a student project spanning one semester, so it's important to choose the RIGHT solution (architectural-wise) instead of the something quick and dirty that is hard to defend.jschell wrote:
Run everything in a servlet container like tomcatTomcat is a JEE container.Now I am confused. Maybe you mean Glassfish? Tomcat is definitely a web container(?).
Let me just say that the system is the product of a student project spanning one semester, so it's important to choose the RIGHT solution (architectural-wise) That pretty much makes it impossible then.
1. A "Right" solution is generally only proven by time.
2. It requires a great deal of knowledge about the business domain.Yeah, you are right. Let be try to rephrase it. What solution (pattern) would be considered the most common or appropriate when you have a Java App and want to expose a few methods as a website and web service?
I hesitate to do this because i would be putting a lot of functionality which isn't about the web into a servlet container. Also, I have a lot of application scope data that is maintained and shared by all servlets/web servicesHuh? Do you already have an exposed web service? If you already have a server which other clients communicate then where does this functionality that you don't want to be tomcat running now? Or where do you think that you want to run it? And if you are or do run it somewhere else then tomcat could access it the same way any other client accesses that server.Sorry, that sentence was written badly. I don't have anything right now. What I meant to write was that I will have a lot of application scope data, objects that are kept in memory as long as the server is running, shared by multiple servlet instances. -
Am I correct in assuming that JSP is an extention of servlets and that to learn JSP in effect means learning about servlets? My point is, is JSP the superior technology a bit like learning JDK1.4 is now a pointless excercise as it has been superceded by 1.5 ?
thanksAm I correct in assuming that JSP is an extention of
servletsYes.
and that to learn JSP in effect means
learning about servlets? No. This isn't necessary, as a matter of fact, it is one of the reasons why JSP exists - so people with little or no Java knowledge can build dynamic web sites using Servlet containers, assuming they have Java programmers behind them to build the tags / glue to the web app.
Still, I say having basic understanding of Servlets (at least) will help you out.
My point is, is JSP the
superior technology No. JSP has a different role. It makes display easier to code for non-Java programmers (looks more like HTML/XML), and easier to support and understand later on.
JSP does horribly bad at complex application control, data selection and manipulation, or as an interface to external resources. Java and Servlets are better at these tasks (but conversly, are horrible to work with for display purposes).
They are different, JSPs and Servlets, in what task they do. J2EE is far superior when you use them both appropriately.
a bit like learning JDK1.4 is now
a pointless excercise as it has been superceded by
1.5 ?No.
JSP is a newer technology, but should not be used to replace Servlets, but used along side Servlets to provide a better designed and manageable application.
Let the servlets control what pages the user sees when, to gather data, to talk with external resources. Then forward to a JSP which simply displays what the Servlet did all the work in getting.
>
thanks -
SQLJ JSP and SERVLETS which Environment?
Hello,
I am attempting to run the samples on Chapter 5 of the
following documents with partial success.
http://technet.oracle.com/docs/products/oracle8i/doc_library/817_
doc/java.817/a83726/oraext2.htm
http://download-west.oracle.com/otndoc/oracle9i/901_doc/java.901/
a90208/oraext.htm#1015820
1. Do I need the Apache+Jserv environment to run SQLJ and JSP?
2. What do I need to do run SQLJ on oc4j if possible?
3. I dont know how to load(?) and/or run this .sqljsp file.
<%@ page language="sqlj"
import="sqlj.runtime.ref.DefaultContext,oracle.sqlj.runtime.Oracl
e" %>
<HTML>
<HEAD> <TITLE> The SQLJQuery JSP </TITLE> </HEAD>
<BODY BGCOLOR="white">
<% String empno = request.getParameter("empno");
if (empno != null) { %>
<H3> Employee # <%=empno %> Details: </H3>
<%= runQuery(empno) %>
<HR><BR>
<% } %>
<B>Enter an employee number:</B>
<FORM METHOD="get">
<INPUT TYPE="text" NAME="empno" SIZE=10>
<INPUT TYPE="submit" VALUE="Ask Oracle");
</FORM>
</BODY>
</HTML>
<%!
private String runQuery(String empno) throws
java.sql.SQLException {
DefaultContext dctx = null;
String ename = null; double sal = 0.0; String hireDate = null;
StringBuffer sb = new StringBuffer();
try {
dctx = Oracle.getConnection("jdbc:oracle:oci8:@", "scott",
"tiger");
#sql [dctx] {
select ename, sal, TO_CHAR(hiredate,'DD-MON-YYYY')
INTO :ename, :sal, :hireDate
FROM scott.emp WHERE UPPER(empno) = UPPER(:empno)
sb.append("<BLOCKQUOTE><BIG><B><PRE>\n");
sb.append("Name : " + ename + "\n");
sb.append("Salary : " + sal + "\n");
sb.append("Date hired : " + hireDate);
sb.append("</PRE></B></BIG></BLOCKQUOTE>");
} catch (java.sql.SQLException e) {
sb.append("<P> SQL error: <PRE> " + e + " </PRE> </P>\n");
} finally {
if (dctx!= null) dctx.close();
return sb.toString();
%>
I named above file as test2.sqljsp then I tried these procedures:
a) $ ojspc test2.sqljsp --these created all the files
b) $ loadjava -u -v scott/tiger _test2.class -resolve
this generated:
initialization complete
loading : _test2
creating : _test2
resolver :
resolving: _test2
errors : _test2
ORA-29521: referenced name test2$_jsp_StaticText could not
be found
ORA-29521: referenced name test2SJProfileKeys could not be
found loadjava: 2 errors
c) listed the directory and both these files are there but it
cannot resolve or find it?
d) I recall reading something about publishjsp command but I have
to establish a session shell with OSE? this part is very
confusing and am not sure what to do here.
e) not sure if i need to publish the loaded class (create a
procedure? so it can be known to the rest of plsql?)
A step by step procedure is very much appreciated. fyi.. I
have Oracle 8.1.7, + oc4j, I can run sqlj from command line
and class files generated I can run. I can also run JSP and
servlets on the oc4j accessing the database. It is this SQLJ
that throws me off balance. If you include Jdeveloper steps
ro run SQLJ thats also welcome.
Thanks in advance for kind responses posted.In many Model-View-Controller web applications implemented using J2EE, servlets are as controllers to direct the flow between the model and view. While servlets can output HTML code directly, it is much better to use JSPs for the most part. JSPs contain HTML and possibly Java scriptlets. The J2EE container will typically compile JSPs into servlets. While you could use a JSP as a controller, there are drawbacks to that approach. To minimize the amount of Java code in your JSPs, you can either use the tags provided by the JSP spec or use tag libraries written by someone else or yourself. See the JSTL for one such example.
Also see:
http://wiki.java.net/bin/preview/Javapedia/MVC
http://wiki.java.net/bin/view/Javapedia/JavaServerPages -
Hi,
Can anyone recommend a good, recently published book on JSPs and Servlets?Things on the Internet may be up to date, but they
aren't necessarily as usable as a book.
For example. I am just trying to learn Ant. There's
the Ant user manual at http://ant.apache.org/manual/
for a start. But to find anything you have to click on
a link, then on another link, then on another link.
And it doesn't have an index so even if you know what
you are looking for, you still have to start at the
beginning and click randomly until you find it. And
you can't easily browse through looking for
interesting things.
Not to mention that it doesn't give you any
suggestions on what to do and why. It simply describes
the various XML elements used by Ant. For example it
may be possible to have an element which is like a
subroutine, so you can call the same code from
multiple targets. But if it is, I haven't found out
how yet.
Sometimes a book is better. In this case it would be.I agree with DrClap. Books do have a shelf life in IT, but they're definitely worth having.
MOD -
Serialized Objects and Servlets
I'm having a lot of trouble accessing a serialized object and displaying it in a servlet. I get the following exception:
java.io.StreamCorruptedException: Type code out of range, is -84
Can anyone help me out here?OK... here's some of the code I'm using...
public Object readObject()
throws IOException, ClassNotFoundException
oin = new ObjectInputStream(fin);
Object obj = oin.readObject();
oin.close();
return obj;
public void writeObject(Object data)
throws IOException
oout = new ObjectOutputStream(fout);
oout.writeObject(data);
oout.close();
Essentially, my servlet creates and instance of an ObjectManager class. This ObjectManager then tries to execute the readObject method above.
The whole process comes to a grinding halt at this point:
Object obj = oin.readObject();
I think this problem has to do with the way that I'm trying to access the file to which I have serialized my object. The problem is that I can't think of any other way to do it. Here's how I am currently referencing the file that holds my serialized object:
File theFile = new File("Serialized.dat");
FileInputStream fin = new FileInputStream(theFile);
I've never attempted anything like this before and I suspect I'm way off in my approach. I really appreciate your willingness to help me out. -
Free Online Webinar on Java EE 6 and Servlet 3.0 - tomorrow, Thu, Dec 18th
Tomorrow I'll host an online webinar with Roberto Chinnici and Rajiv Mordani on the new JavaEE 6 and Servlet 3.0 specifications. The presentations will refer to the latest drafts (Public Review) - Roberto and Rajiv are the leads of the Expert Groups.
This is a free webinar. You can attend by just pointing your (flash-enabled) browser to http://ustream.tv/channel/theaquarium. You can also attend via an optional concall at:
Toll Free: (866) 545-5227
Int'l Access: (215) 446-3648 (caller paid)
Access Code: 3535518
Time is 11am Pacific Time.
Date is Thu, Dec 18th.
The webinar page is http://wikis.sun.com/display/TheAquarium/JavaEE+6+And+Servlet+3.0 and it includes slides and (later) recordings. uStream.TV includes an online chat that you can use to ask questions.
More details at http://wikis.sun.com/display/TheAquarium/JavaEE+6+And+Servlet+3.0
- eduard/o
Maybe you are looking for
-
How can I delete all Contact and Calendar entries on my iPhone so I re-sync from my PC
My Contacts and Calendar are messed-up on my iPhone with literally hundreds of duplicate and erroneous entries. The data is okay on my PC so I wish to clear the IPhone entries completely and then use Sync again to download from my PC. How can I cle
-
Does anyone know when Macbook Airs had matte screens?
I own a mid-2011 13" Macbook Air. I purchased this computer through th Apple website and went through all of the customization options maxing out whatever was available to me. At the time, there was the option to choose a matte or a glossy screen (t
-
HT1373 can i load music on to my new iTunes account from my old itunes account
i have a new itunes account. Can i transfer music from my old account to new one
-
Hi all, I am using the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send the file to external address. It worked fine on dev and after transporting to Q, the same prog is failing and giving the error as DOCUMENT NOT SENT. I tried to debug the FM also to under
-
I have installed the latest version of the adobe viewer. I downloaded a folio - 685MB but when it finishes the Adobe Viewer crashes and the IPAD screen returns to the screen with all the icons of my apps, then I open again the adobe viewer and it sho