Cannot ssh using jsp
Hi
I have a jsp page which contains the shell script for running an instance and then doing ssh to the remote host server .When the jsp page is loaded the instance is run but ssh cannot be done .The ssh to instance takes time (20 to 25 sec ) ,so i tried to so use waitFor() for the process but that thing didnot work ,it kepton waiting .But when i removed waitFor() it didnot allow to do ssh properly .
I donot know how to do ssh .i tried to put the content of ssh in the file using redirect opertor but that thing didnot work
There are some good java libraries that you can use for ssh.
[Here is once|http://sourceforge.net/projects/sshtools/] from sourceforge.
ram.
Similar Messages
-
Cannot access VARCHAR2s on Oracle 9i using JSP/JDBC
After upgrading from Oracle 8.1.7 to Oracle 9, I get an
exception when using JSP/JDBC to read data from columns
containing VARCHAR2s. I can successfully read columns
containing BLOBs, CLOBs, NUMBERs, and RAWs.
I still can select VARCHAR2 columns by using SQL*Plus so the
problem is with JDBC and not the database.
I get the following exception message:
java.sql.SQLException: ORA-00600: internal error code,
arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []
The following code that worked on Oracle 8 fails to execute
properly on Oracle 9:
OracleResultSet rs = null;
String sql = "select name from users where id > 100";
rs = (OracleResultSet)s.executeQuery(sql);
I'm using Windows 2000, Tomcat 3.2.2, Java 1.3, and the latest
version of OracleJSP.
Has anyone run into this problem?
I've also entered this same query on the Java-SQLJ/JDBC
discussion fourm.I4ve installed Oracle 9i on RedHat 7.2.
We develop with WebObjects and JBuilder.
When i try to connect to the database via the EOModeller (JDBC) i got the same error:
Stack Trace:
JDBCAdaptorException: ORA-00600: Interner Fehlercode, Argumente: [ttcgcshnd-1], [0], [], [], [], [], [], []
Then, i started creating and droping tables in the 9i Database >> it works fine.
Can someone give an solution for this problem?? -
hi,
i am new to java and jsp programming and i am trying to use jsp:param nested in my
jsp:forward statement.
if i specify a value in jsp:param my page would display properly. however when i passed a variable in my jsp:param i get the error:
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\star\jsp\Meeting_CreateMinutes_jsp.java:135: cannot resolve symbol
symbol : method encode (long)
location: class java.net.URLEncoder
pageContext.forward("Meeting_ActionItems.jsp" + "?" + "docno=" + java.net.URLEncoder.encode( carno ) + "&" + "formmode=" + "Add");
^
1 error
this is the snippet in my jsp page that (i suspect) caused the error:
<% long carno = newcar.getDocno(); %>
<jsp:forward page="Meeting_ActionItems.jsp">
<jsp:param name="docno" value="<%= carno %>"/>
<jsp:param name="formmode" value="Add"/>
</jsp:forward>
my question is : does jsp:param do not accept variables as values?
thanks in advance.
best regards,
noynoy<% long carno = newcar.getDocno(); %>Change this part as
<% String carno = ""+newcar.getDocno(); %>
Hafizur Rahman
SCJPhi Hafizur,
Thanks a lot. It solved my problem on the jsp:param error
More power!!!
rgds,
noynoy -
Facelet to crare web app, instead of using JSP; JSF1.2 spec in WebSphere6.1
Novice to JSF and Facelet. But, I had been using Struts since its inception.
I am required to use IBM's WebSphere Application Server 6.1 that comes with Servlet 2.4 and JSP 2.0. WebSphere 6.1 App Server limits me to using JSF 1.1. This is because, JSF 1.2 requires Servlet 2.5 and JSP 2.1, that is a part of WebSphere App Server 7.0; not a part of WebSphere 6.1.
Somebody suggested that it will be possible to use JSF 1.2 in WebSphere 6.1, if I were using Facelet, instead of JSP.
I am not eager to use JSF 1.1 and may have to forego JSF; unless and until I can use JSF 1.2.
The hold-up is that I cannot use JSF 1.2 spec in WebSphere 6.1. Is there is any way to use JSF 1.2 in WebSphere 6.1? Can I create an entire application using Facelet (instead of JSP) that will let me use JSF 1.2 spec in WebSphere 6.1? If so, how?
Here are my questions, especially because I am not very familiar with JSF and Facelet technology:
1. Can I use JSF 1.2 specification in WebSphere 6.1, if I were using facelet (as opposed to JSP) as my view technology?
2. Will it be possible to create an entire web app with facelt, instead o fusing any JSP at all? If so, how? Does it mean that all the GUI screens will only use facelet and no JSP at all?
3. Please explain how I can write a complex web app with 100s of screens using only facelet, instead of using JSP.
4. Please provide pointer on how JSF and facelet differ, or what are their demarcations boundaries.
Any comment and pointer will be greatly appreciated.Don't doublepost. It's rude. Stick to one topic. Continue here: [http://forums.sun.com/thread.jspa?threadID=5335001].
-
Cannot a get JSP page instance from a page being destroyed
We have a J2EE app, using Struts + Tiles (build 1.1-b3), running on Win2KPro, Ora9ias v9.0.3. The application is roles-based, and different users see different versions of the same page based on their role authorizations. Occasionally, when multiple users in different roles are requesting the same page, the app returns the following exception:
OracleJSP:
JSP Error:
Request URI:/fast/WEB-INF/jsp/tiles/layouts/baseLayout.jsp
Exception:
javax.servlet.ServletException: Cannot a get JSP page instance from a page being destroyed
at oracle.jsp.runtimev2.JspPageInstFacade.getInstance(JspPageInstFacade.java:147)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:303)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:119)
at org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilStrutsModulesImpl.java:124)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at web2d_inf._jsp._tiles._layouts._baseLayout._jspService(_baseLayout.java:445)
[SRC:/WEB-INF/jsp/tiles/layouts/baseLayout.jsp:149]
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1033)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:249)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:303)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at com.gal.fast.portal.web.FastActionServlet.service(FastActionServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:536)
All the code in the two custom classes above ( com.gal.fast.portal.web.SessionInitializedFilter and com.gal.fast.portal.web.FastActionServlet ) has been commented out to the point that they are NOOP stubs.
We only see this with multiple near-simultaneous requests for the same page with differet roles. It smells like a threading issue to me, but I'm no expert (hence this post). Any thoughts?
--mattWe have a J2EE app, using Struts + Tiles (build 1.1-b3), running on Win2KPro, Ora9ias v9.0.3. The application is roles-based, and different users see different versions of the same page based on their role authorizations. Occasionally, when multiple users in different roles are requesting the same page, the app returns the following exception:
OracleJSP:
JSP Error:
Request URI:/fast/WEB-INF/jsp/tiles/layouts/baseLayout.jsp
Exception:
javax.servlet.ServletException: Cannot a get JSP page instance from a page being destroyed
at oracle.jsp.runtimev2.JspPageInstFacade.getInstance(JspPageInstFacade.java:147)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:303)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:119)
at org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilStrutsModulesImpl.java:124)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at web2d_inf._jsp._tiles._layouts._baseLayout._jspService(_baseLayout.java:445)
[SRC:/WEB-INF/jsp/tiles/layouts/baseLayout.jsp:149]
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1033)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:249)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:303)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at com.gal.fast.portal.web.FastActionServlet.service(FastActionServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:536)
All the code in the two custom classes above ( com.gal.fast.portal.web.SessionInitializedFilter and com.gal.fast.portal.web.FastActionServlet ) has been commented out to the point that they are NOOP stubs.
We only see this with multiple near-simultaneous requests for the same page with differet roles. It smells like a threading issue to me, but I'm no expert (hence this post). Any thoughts?
--matt -
Deleting a row from a table using jsp
Given a table in a jsp, can an user click on a row of that table and retrieve the information so that the program can delete a record from a database table?
most of the tables that I have seen are static, the user cannot interact with them(specially when the user wants to delete several records from a database table).
Can anyone suggests a good book or way of deleting a row from table using jsp.eg use a column in the table that has a radio button or check box,
on submit, get all the rows that are checked, using the row as an index into your db store, get the key and use the key to issue the sql delete command. -
Display the images in excel using jsp
Hi
I am unable to display the images in excel using jsp. I can display the data. but cannot display the images. It is simply showing the icon without the image. Is there any way to display the images. Pls give some sample code to display the images in excel.
Thanks in advance.Presumably whoever created the images in that Excel document just put links to somewhere on their hard drive. Those links don't mean anything when you put the document on somebody else's computer, which is what you are doing. At least, that is my guess.
You could spend some time looking at the Excel file to see how the images were put in there. Or you could ask the person who put the images in there. -
Using jsp:include in iPlanet6SP2
I'm trying to include a common jsp file, say [proj_common]/common.jsp, from
another jsp file, say [proj_parent]/parent.jsp, using <jsp:include>. After
deployment both files sit under their respective folders (for example in
c:\iplanet\ias6\ias\APPS\modules) as [proj_common]/common.jsp and
[proj_parent]/parent.jsp. I've included a relative path from [proj_parent]
to [proj_common], and here's the code I've added in
[proj_parent]/parent.jsp:
<jsp:include page="../[proj_common]/common.jsp">
<jsp:param name="p1" value="v1"/>
</jsp:include>
I'm using only static HTML in common.jsp as a test. The following error then
occured when I view [proj_parent]/parent.jsp :
500 SC_INTERNAL_SERVER_ERROR
Error: 500 SC_INTERNAL_SERVER_ERROR
javac error:
c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
\[proj_parent]\..\[proj_common]\common.java:1: Identifier expected.
package jsp.APPS.[proj_parent]....[proj_common];
^ (pointing under 2nd dot of ....)
c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
\[proj_parent]\..\[proj_common]\common.java:11: Superclass HttpServlet of
class common not found.
public class common extends HttpServlet {
^ (pointing under HttpServlet)
2 errors
I believe this is not a path error (since that error explicitly tells me the
included file cannot be found). I have read other previous messages and
learn that there is a problem with <jsp:include> and relative paths... Also
a test when both files are in the same directory shows no problem at all. Is
there a solution to this problem of parsing relative paths in SP2?
Thanks and regards,
Anthony YuenAnother strange thing happened:
We have been including html and jsp files. From a certain point the system was
not able to include html files. When we renamed html includes to jsp, it was
working again.
Has anyone experienced the same thing?
Does anyone know the resolution?
Regards,
Gyorgy
Anthony Yuen wrote:
I'm trying to include a common jsp file, say [proj_common]/common.jsp, from
another jsp file, say [proj_parent]/parent.jsp, using <jsp:include>. After
deployment both files sit under their respective folders (for example in
c:\iplanet\ias6\ias\APPS\modules) as [proj_common]/common.jsp and
[proj_parent]/parent.jsp. I've included a relative path from [proj_parent]
to [proj_common], and here's the code I've added in
[proj_parent]/parent.jsp:
<jsp:include page="../[proj_common]/common.jsp">
<jsp:param name="p1" value="v1"/>
</jsp:include>
I'm using only static HTML in common.jsp as a test. The following error then
occured when I view [proj_parent]/parent.jsp :
500 SC_INTERNAL_SERVER_ERROR
Error: 500 SC_INTERNAL_SERVER_ERROR
javac error:
c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
\[proj_parent]\..\[proj_common]\common.java:1: Identifier expected.
package jsp.APPS.[proj_parent]....[proj_common];
^ (pointing under 2nd dot of ....)
c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
\[proj_parent]\..\[proj_common]\common.java:11: Superclass HttpServlet of
class common not found.
public class common extends HttpServlet {
^ (pointing under HttpServlet)
2 errors
I believe this is not a path error (since that error explicitly tells me the
included file cannot be found). I have read other previous messages and
learn that there is a problem with <jsp:include> and relative paths... Also
a test when both files are in the same directory shows no problem at all. Is
there a solution to this problem of parsing relative paths in SP2?
Thanks and regards,
Anthony Yuen -
Problem using jsp:forward in java script
hi,
when I use jsp forward tag inside java script i'm getting a problem that
when the jsp is invoked it is getting forwarded to the page specified in the forward tag, without checking the if conditions. Following code may give you a better idea.
<html>
<script>
function test()
if(document.f.htemp.value=="true")
alert("jus");
else
var s=document.f.htemp.value;
alert(s);
<jsp:forward page="success.jsp" />
</script>
<body>
<form name="f" method=post>
<input type=text name=htemp value="true">
<input type=button onclick="test()">
</form>
</body>
</html>
please help me,thanks inadvance
regards
chanduWhat pgeuens means is that you can't mix javascript and jsp/java code in this way.
ALL of the jsp/java code gets executed at the server end.
This produces an HTML page (with embedded javascript) which gets sent to the client.
The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
<%
if (testCondition){
%>
<jsp:forward>
%<
%>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
<script>
function test()
if(document.f.htemp.value=="true")
alert("jus");
else
var s=document.f.htemp.value;
alert(s);
document.f1.action="success.jsp";
document.f.submit();
</script>You cannot run JSP code based on your javascript code.
Java. Javascript. Not the same thing.
Hope this helps,
evnafets -
File Transfer b/w Client - Server using JSP
Hi,
I need to implement a file transfer between the client and the server using JSP / Beans. The files can be XML Documents, Images (.gif,.jpeg) or even MS Word documents.
The user has a set directory on his file system where the files are to be saved upon download and retrieved upon upload. This system is similar to a check-in check-out system.
How do I get a reference to the directory on the users file system and then either save the downloaded files there or retrieve the files that need to be uploaded.
Thanks
coffeejavaThe only way you can do this is by using an applet, a jsp page or servlet does not have access to the system that the browser is running on. Furthermore if you were planning on using the html file form object you cannot set a value for that programmatically. It's not allowed for security reasons.
-
Uploading images in access database using jsp
Hi, am using jsp with access database and want to upload as in a profile picture for any profile on the site[i mean depending on the user's convenience] ..
I just have a code which helps select the image from the client's machine n gets its address..but then how to use it in a form or something so that it can be submitted and inserted in the database?
Any idea? I d prefer not using servelet.. but if it just cannot be done without servelet then ok can suggest with that too.
Here is the code of Browsing to obtain the picture:
<form name=uploadForm action="uploadpic.jsp" method=post enctype="multipart/form-data" > <input type="file" > <input type="submit" name="submit" /> </form>silversurface wrote:
Hi, am using jsp with access database and want to upload as in a profile picture for any profile on the site[i mean depending on the user's convenience] ..
bad. Don't put business logic in JSP, and that includes accessing databases.
Any idea? I d prefer not using servelet.. but if it just cannot be done without servelet then ok can suggest with that too.
Don't put business logic in JSP. That's what servlets are for (and EJB). -
How to run exception using JSP?
How to run exception using JSP?
Why would you need the <%%> between the if else blocks? Even if you attempt to write some data within the blocks in java, you will still get an error. For example, this is illegal:
if(done)
System.out.println(true);
System.out.println("Hello World");
else
System.out.println(false);
}The compiler is expecting the 'else' to be directly after the body of the if. If it encounters anything else, it will complain. So you cannot do this in jsp either, regardless if it's a different technology, it's the same compiler. -
I am creating a small search program using jsp. I want to know how can I implement paging using JDBC.
It is very easy using asp. In asp only a specified no. or records can be retrieved from database using combination of PageSize and AbsolutePage properties of Recordset Object.
In jdbc I think there is no such method available. Do I have to use database base specific options to limit the number of records returned like limit keyword in mysql.
Only way I can think of is to create a resultset object and store it in session and then use the absolute() method of the resultset object to go to a specific record and then next(). But still all records have to returned by db and have to be kept in memory and not only specific no. of records (e.g 10 per page).
If I doesn't store the recordset in session then every time this search page is accessed, a new recordset is returned with all records. I then have to determine how many records to skip according to page selected in the query string and then use absolute() method of recordset to go to specific record. And then loop, say ten times to display 10 records. Again when next is clicked same procedure is repeated. Here retrieving all records every time page is accessed is very expensive operation.
In my case even this isn't possible because I am using jdbc odbc bridge, which is not allowing scrollable resultset and jvm is throwing exception in native code. Without scrollable resultset I cannot know how many records are returned. If I try to count using a loop and resultset's next() then I don't have any way to go back to first record again when I actually want to retrieve records to display. Only other way to count the records is executing query twice which isn't very good as records may have been added or deleted between two calls.
Am I wrong anywhere above?
If not then question is, can this be done efficiently with jdbc without using any database specific keywords?
If yes then which method can be used on a busy web site with huge database.
--Sukhwinder SinghThis may help: http://www.powerobj.com
providing "advice" in this manner is unethical and unhelpful. if you feel a product you are selling would be good for someone you should at the very least disclose your interest in the selling of said product.
the blatant ad you posted in the JavaServer Pages forum at least makes it clear that you are selling a product. this post does not make that clear and it really should be. -
Cannot ssh, Permission Denied
Very odd.
Cannot SSH into a Mac Pro (10.6.7) on my network
Can ping the box at it's IP
Also cannot see this Mac in ARD
I have Remote Login and Remote Management enabled for All Users
I thought it may be "Firewall" being on (which in the past will block these ports), but Firewall is off
Have read in posts something to do with /etc/ssh_config file, not sure what this file should read in order to gain access.
More than likely a re-image of this Mac will solve the issue, but do not want to do that, too much on this box, FCP, etc.
Has to be a corruption, a plist file, or some other configuration, etc.
thanks in advance,
John KPerhaps using
ssh -v -v -v [email protected]
Which should give you alot more details.
If you do 2 of these. One to the failing system, and one to a working system, and then compare the 2 debugging output streams to see where the failing system goes bad. -
Error trying to run the Sample Code Virtual Private Database using JSP's
Hi.
I`ve downloaded the Virtual Private Database using JSP's example from the Oracle9iAS Security - Sample Corner (http://otn.oracle.com/sample_code/deploy/security/9i_security.html)
I ran the SQL script just fine. I�ve Opened the JDeveloper Flile (security.jws) and tried to Make it (following step 2 on "Run the Application using JDeveloper Environmentinstructions" in the README ) but i get this error:
Error: unable to copy to output directory, web.xml not found
It seems that i need the web.xml to run this application, but in the zip file i cannot find any XML file.
What can i do?.
Thanks in advance for your helpHi,
the problem seems not to be within your application but in missing files on your embedded OC4J. Just try and unzip the JDeveloper 10.1.3 install again.
Frank
Maybe you are looking for
-
I just downloaded an update and my sophos anti-virus is going beserk. It will not allow me to remove the threat manually when I unlock the quarantine manager and I have no idea of what to do.
-
Windows server 2008 upgrade hangs at gathering files 0%
Hii, While upgrading my Virtual Machine from Windows Server 2003 STD 32 Bit to Windows Server 2008 STD 32 Bit...it gets stuck at Gathering files 0%.. I have tried my changing the ISO file and also copied the setup files to one of my local drive then
-
13in Late 2013 Retina Macbook Pro Battery Punctured
Hello! I have purchased a late 2013 Macbook Pro with Retina display (13 inch Haswell, 256 gb SSD, 8 gb ram) at the end of October 2013. Of course, I have had the system hang issue that affected so many late 2013 devices. But, just as I was about to r
-
I installed Photoshop 13 on 2 laptops and 1 desktop using the Photoshop 13 disk. All computers are running Windows 8.1 Why am I just now finding out that installing Photoshop 13 is limited to a certain number of computers? NO where on the packaging o
-
Need to build a central TOC for ~75 html help files
I'm using RH8 for HTML. A year ago, I took our 75 Winhelp projects and converted them to 75 HTML projects in order to be compatible with Windows 7. in Winhelp, the user selects Help and gets a central TOC from which to select the help for the indiv