How to get sequencename.nextval in JSP

In a JSP application, I would like to get a sequence number for the primary key of a view object.
How do I go about this?.
Thanks.
Ravi

Let the database trigger do this job for u, and make sure u check the "refresh after insert" at your entity object.
null

Similar Messages

  • How to get ep authority in jsp page

    Hi all:
    I want to create a j2ee project and some jsp pages to deploy to EP server.
    My question is how to get user name or user authority in jsp page.
    Is there any APIs to use or something else.
    Thanks in advance.
    Allen

    Hai ,
    I Think  This will help ful for u check it ,
    File=new FileLog("f:/WebServiceTrace/trace2.%g.log", 800000, 10,                                        new  TraceFormatter());
    The above code specifies the path for your log file.
    Then add this file as a log location and then log the traces. For this you can use the following code like:
    Location location=Location.getLocation(className);
              location.addLog(file);
              location.setEffectiveSeverity(Severity.ALL);
              location.entering(methodName);
    To Create j2ee apllication
    In path new-j2ee-jsp to create JSP's can only be used for J2EE applications.
    So as you are using this in Portal Application, this does not work.
    You can test this bahavior by creating a new Web Application (New-Project-J2EE-Web Module Project)
    In this Web Module Project, try creating JSP, this will work.
    So dont use new-j2ee-jsp to create JSP in Portal Application instead use New-File and name the file as jsp.
    Regards ,
    venkat

  • How to get table headers in jsp page

    hi,
    this is praveen, can any one help me to solve this problem.
    how to get table headers in a jsp page. whether it is possible using javascript or is there any other way.
    pls send rep.
    thank u.

    Hai ,
    I Think  This will help ful for u check it ,
    File=new FileLog("f:/WebServiceTrace/trace2.%g.log", 800000, 10,                                        new  TraceFormatter());
    The above code specifies the path for your log file.
    Then add this file as a log location and then log the traces. For this you can use the following code like:
    Location location=Location.getLocation(className);
              location.addLog(file);
              location.setEffectiveSeverity(Severity.ALL);
              location.entering(methodName);
    To Create j2ee apllication
    In path new-j2ee-jsp to create JSP's can only be used for J2EE applications.
    So as you are using this in Portal Application, this does not work.
    You can test this bahavior by creating a new Web Application (New-Project-J2EE-Web Module Project)
    In this Web Module Project, try creating JSP, this will work.
    So dont use new-j2ee-jsp to create JSP in Portal Application instead use New-File and name the file as jsp.
    Regards ,
    venkat

  • How to get result from another JSP file?

    I have to write a jsp (my.jsp) to get information from another jsp file (other.jsp).
    The other.jsp return integer value (0 / 1) so that user can tell if certain service is available or not. And in my.jsp I need to collect such result and other information from a text file to make up of a XML string.
    How can I call other.jsp to get the result? Thanks a lot.

    Hi, I think I didn't describe the problem clearly
    enough. In fact, there is a JSP file, and if our
    database is currently connected, the JSP will return
    value 1, otherwise, it will return 0. My java program
    need to get that result, and then form an XML string,
    and send the string back to the client. I'm just
    wonder how can I write such a program to read result
    from JSP file. Thanks a lot.Why is this function implemented as a JSP file? It should be implemented as a bean. It would be simple to get the information you require from that bean.

  • How to get the querystring in jsp

    hi guys
    plz help me,
    how to get the query string in jsp page, is there any methods for getting querstring like getString() getParameter() ?

    C:\Documents and Settings\Administrator\ven\build\generated\src\org\apache\jsp\getcustomer_jsp.java:62: getQueryString() in javax.servlet.http.HttpServletRequest cannot be applied to (java.lang.String)
    i am getting error like this , if i used that method, shall i import any packages?

  • How To get getServletContext() object inside JSP from  Eclipse  IDE

    Dear friends,
    I can access methods in getServletContext class from Netbeans in my JSP web project using the following steps.
    String path=getServletContext().getRealPath("\mypath");
    . But In Eclipse when i try to build,it says that "can not find method -getServletContext()".
    How to get this object in my JSP Scriptlet From Eclipse IDE? Plz help me?

    use Expression Language instead.
    I would.
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html
    regards,i

  • How to get the size of JSP html output?

    Hi,
    Is there a JSP method to get the size of JSP HTML output.
    e.g. I would like to print the size of the JSP e.g.
    Size of this page is <%=pageContext.getPageSize()%> Kb ???
    Any ideas? Thanks.
    George
    Edited by: googchro on Jan 5, 2010 4:45 PM

    Would you like to print "the size of this page is..." before or after you calculate the size of the page.
    Because adding that bit of text to the page will make the page bigger...
    Doing it in java, the best approach would probably to have a filter counting the number of bytes that gets sent to the writer/output stream.
    A client side tool measuring the amount of bytes received would probably be easier though.
    You can always look at the Content-length header sent with a response. Though you normally don't have access to that on the java/jsp side, as it is sent by the container.
    cheers,
    evnafets

  • How to get seq.nextval as a result of an insert statement?

    Hi,
    on Oracle using sequences we can use follow command to issue an insert command and get the nextval used on this insert:
    CALL INSERT INTO "TEST2550_ENTITY" ("ID","NAME") VALUES ("TEST2550_ENTITY_SEQ".nextval,?) RETURNING "ID" INTO ?
    there is a way to do same thing in MaxDB using JDBC?
    thanks for any tip
    Clóvis

    Hi Clovis,
    sorry my fault. (I really should stop answering questions in the late evening...).
    Well, unfortunately it looks like that this actually not possible vie JDBC.
    I tried to use the getGeneratedKeys() Method that usually would give you automatically created IDs, but I only got this message:
    Exception in thread "main" com.sap.dbtech.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Retrieving auto generated keys is not supported.
         at com.sap.dbtech.jdbc.ConnectionItem.throwNotSupported(ConnectionItem.java:101)
         at com.sap.dbtech.jdbc.StatementSapDB.getGeneratedKeys(StatementSapDB.java:1108)
         at com.sap.dbtech.jdbc.trace.Statement.getGeneratedKeys(Statement.java:254)
    Maybe one fo the JDBC developers is reading this and knows a better way...
    best regards,
    Lars

  • How to get multiple selections from jsp page in my servlet

    Hello Everyone,
    I've a list that allows users to make multiple selections.
    <select name=location multiple="multiple">
        <option>
             All
        </option>
        <option>
             Hyd
        </option>
        <option>
             Dub
        </option>
        <option>
             Mtv
        </option>
      </select>I want to get the selections made by user in jsp page from my servlet, selections can be multiple too.
    ArrayList locList = new ArrayList();
    locList = request.getParameter("location");when I do so, I get compilation error as the request returns string type. How do I then get multiple selections made by the user.
    Please let me know.

    For those kind of basic questions it would help a lot if you just gently consult the javadocs and tutorials.
    HttpServletRequest API: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html]
    Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Coreservlet tutorials: [http://courses.coreservlets.com/Course-Materials/]

  • How to get Tree structure in JSP page?

    Hi,
    I would like get data from the database and display the data in tree structure with the check boxes at each nodes on a jsp page with out using any third party tools. how can i do that? Do i require any new tags to fulfill this requirement?
    can any one help me out by sending any example code?
    thanks in advance.
    Regards,
    Reddy

    Once you have the data in a list or something, can't you just use <c:forEach> and then output standard nested <ul> and <li> tags to give the tree structure.
    <html>
         <style>
              li
                   list-style-type:none;
         </style>
         <body>
              <form>
                   <ul>
                        <li>
                             <input type="checkbox">Check 1</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 1A</input>
                                  </li>
                                  <li>
                                       <input type="checkbox">Check 1B</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 2</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 2A</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 3</input>
                        </li>
                   </ul>
              </form>
         </body>
    </html>

  • How to get javascript variable in jsp variable

    Hi all,
    i have a variable str in my javascript function
    var str = somevaluei want this str value in jsp variable in the same page...
    how can this be done..???
    any ideas...
    Thanks

    I dont know if its possible or not.
    Actually it depends on what do you want to do with the variable.
    as far as assisginng value to the hidden variable is concerned it can be done this way.
    <% jsp code
    String hiddenVar = "";
    %>
    < html code
    <input type type = "hidden" name="hidden" vale="<%=hiddenVar %>"
    html ends>
    while in js function you can assign vale to the hidden variable which will ultimately assign value to the JSP variable as follows.
    var str = "value";
    document.form_name.hidden_field_name.value = str.
    hope this hepls.

  • How to get achieve this in JSP ?

    Hi friends,
    I am trying to do one scenario in jsp page. here are the steps.
    1) when i click on submit button on home page (its already there) a new window should be opened.
    2) while opening this new window , it will invoke one shell script and it results to generate one file in the server.
    3) in that window , once the file is generated hyper link should appear "click here" --> this should not appear intially/process in progress.
    4) when user clicks on this link, it should give that generated file .
    I achieved points 1,2. But struggling to get points 3 &4.
    Please find my code here , its throwing error. pls help me to solve the issue.
    code :
    <%@page language="java" %>
    <%@page import="java.util.*" %>
    <html>
    <h1 style="font-family: Georgia; font-style:italic; font-size: 16px; color: #44BDE8;">Submitted your request to server </h1>
    <marquee behavior="scroll" direction="left" style="font-family: Arial; font-style:italic; font-size: 14px; color: #B7D1DA;" >Processing ..!! Processing ..!! </marquee>
    <head>
    <%
    String unixCommand = "sh /home/dev/java/run_parse.ksh";;
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec(unixCommand);
    p.waitFor();
    values_StringBuffer.append("<a href="http://272.17.34.204:7777/tools/ready_files.zip"; /a>");
    //System.out.println(cmd[0] + " returned " + p.exitValue());
    %>
    </head>
    <body>
    </body>
    </html>

    Thanks Ankur.
    Now its not throwing any error , but my hyper link is displaying like a normal text. ( 'click here' is not activated as hyper link displaying )
    Here is the code:
    <%@page language="java" %>
    <%@page import="java.util.*" %>
    <html>
    <h1 style="font-family: Georgia; font-style:italic; font-size: 16px; color: #44BDE8;">Submitted your request to server </h1>
    <marquee behavior="scroll" direction="left" style="font-family: Arial; font-style:italic; font-size: 14px; color: #B7D1DA;"  >Processing ..!!               Processing ..!! </marquee>
    <head>
    <%
         String unixCommand = "sh /home/dev/raj/java/parse_all.ksh";
         Runtime rt = Runtime.getRuntime();
         Process p = rt.exec(unixCommand);
         p.waitFor();
    //String sLink  = http://272.17.34.204:7777/tools/ready_files.zip
      if (p.exitValue() == 0)
          System.out.println("+");
    out.write("< a href=\"http://272.17.34.204:7777/tools/ready_files.zip\">Click Here</a>");
        else
          System.out.println("-");
    %>
    </head>
    <body>
    </body>
    </html>Edited by: Rajesh on 13/06/2011 00:24

  • How to get current time in jsp page?

    my problem is :-
    i have a radio buttons with name as 9am, 11am ,1pm, 3pm , 5pm , 7pm , 9pm , 11pm , 1am , 3am ,5am 7am. what ever the current time may be the radio button of four hour plus than current time should be atomatically checked and previous radio buttons should be disabled. for example suppose current time is 11.02am than the radio button of 3pm should be automatically checked and previous radio buttons should be disabled.
    please help me if u can?

    This should work but it needs testing out around midnight ( not sure if it is 00:00 or 24:00):
    <%@ page import="java.util.*" %>
    <html>
    <head><title>Time Page</title>
    </head>
    <body>
    <% Calendar c = Calendar.getInstance();
       c.add(Calendar.HOUR_OF_DAY, 4);
       int h = c.get(Calendar.HOUR_OF_DAY); %>
    The current hour is <%= h %><br>
    <% for (int i=0; i < 24; i++) { %>
       <input type=radio name=time <%= (i < h) ? "disabled" : ""%><%= (i == h) ? "checked" : ""%>><%= (i < 10) ? "0" : ""%><%= i %>:00<br>
    <% } %>
    </body>
    </html>

  • How to get Parameters in a jsp page called by VB program via xmlHttp

    I have a VB programm sending a request using xmlHttp.
    xmlHttp.Open "POST", varTarget, True 'True means asynchronous
    xmlHttp.Send xmlSendStr
    This worked fine with ASP
    the crucial ASP code was:
         set xml = server.createObject("MSXML2.DOMDocument")
         xml.load(request)
         VBData = cstr(xml.getElementsByTagName("value").item(0).firstChild.nodeValue)
    now I have a webserver (tomcat) and try to have a simular functionality
    but
    request.getParameter()
    seems not to do the job.
    what do I have to do
    I am thankfully looking forward to you reply
    peter

    Hi,
    thanks for your reply!
    If I have the parameters in the URL and use the method GET it works all right.
    but I need the method to be POST. I suppose, I have the wrong way identifying the parameter name
    This is from VB
    varTarget = "http://localhost:9090/gm/getData" ' getData is my servlet
    xmlSendStr = "SQLStmt=SELECT TCPD_Cars.* From TCPD_Cars WHERE (((TCPD_Cars.CarIdent)=45));"
        xmlHttp.Open "POST", varTarget, True   'True means asynchronous
        xmlHttp.Send xmlSendStrthis is part of my Servlet
         protected void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter writer  = response.getWriter();
              String SQLStmt = request.getParameter("SQLStmt") ;
            //make the database query and get the returns
            writer.println(GetSQLData(SQLStmt));
            //close the write
            writer.close();                    
         }I would appreciate any suggestions

  • How to get name of a JSP

    Hi all,
    I want to see the name of the current JSP... is it somewhere in "About this page" or not?
    Thanks,
    Alexander.

    Hi;
    I belive there is no specific name for jsp, please see concept guide:
    JSP
    Acronym for JavaServer Page, an extension to Java servlet technology. JSPs are compiled
    into servlets when first requested, and can receive input from a servlet or send output
    to a servlet. Their dynamic scripting capability allows page logic to be separated from
    page display, giving greater flexibility in processing HTTP requests.
    See also: servlet
    referance:
    http://download.oracle.com/docs/cd/B53825_01/current/acrobat/121oacg.pdf
    Regard
    Helios

Maybe you are looking for