Problem when using JDBC with JSP

Hi,
I am trying to display results after a database query on a JSP page, and then provide the options delete or update one of these records or to add a new one.
What I did was to pass the ResultSet object to the webpage, and then display the result. When the buttons are pressed, I pass this ResultSet to another jsp page where I provide the required functionality. This is then forwarded back to the previous JSP, where the new data is displayed.
However, when the first page is re-displayed, it creates a new connection and i was wondering if there is a way to close the previous connection through the ResultSet?
Also, I wanted to put the ResultSet in a bean, but I think it is causing an error in the web server, saying something like it is not Serializable. Is there any other way to pass the ResultSet around?
Any suggestions on better ways to manage databases though web interfaces would be welcome, or if someone could point me to a good tutorial on this topic!
cheers
Ankur

Bad idea to be passing ResultSets around. Those are database cursors, a scarce resource.
You should load that data into a data structure, close the ResultSet immediately, and then pass the data structure around in session if you must.
Better yet, have a central servlet that deals with all database calls. Let the JSPs just do display, as they were meant to. - MOD

Similar Messages

  • Navigation problem when using tiles with JSF

    Hi all,
    I m using tiles with JSF. i have included all the libraries and jsp page is rendered properly. but when i use <h:commandLink> in the body part of the JSP , i cannot go to the specified link. when we use tiles, what changes need to be done in faces-config file?? i mean what navigation rule we need to specify ??

    Hello, I have the same problem; JSF+Tiles = No navigation.
    One basic question is should I reference the parent jsp or the included body jsp in the faces-config.xml file.
    For example: The login.jsp is a main tiles page that includes a menu.jsp, header.jsp & a loginBody.jsp.
    Hence the faces-config could have this rule;
    <navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    (I've left the outcome tag out to simplify this post)
    Or, I could refer loginBody.jsp in the navigation rule;
    <navigation-rule>
    <from-view-id>/loginBody.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    The loginBody.jsp has a commandbutton which a user clicks which starts the navigation.
    Neither seems to work unfortunately & I'm a stuck.
    Thanks

  • NIO: Strange problem when using ByteBuffer with non-blocking SocketChannel

    Hi,
    I have a server that uses multiplexed, non-blocking I/O with java.nio. When a client connects, the server waits for the message: <system cmd="knock"/>, returns a message and disconnects the client. The clients are shortly serviced in less than a second.
    But the server newer receive anything from about 20% of the clients - even though it is sent. Or with other words: it is received and the data is contained in the ByteBuffer - SocketChannel.read(ByteBuffer) - but a call to ByteBuffer.remaing() returns 0 !!
    ByteBuffer receiveBuf = ByteBuffer.allocate(65536);
    receiveBuf.clear(); // the code is elsewhere used for longer living clients
    int readBytes = channel.read(receiveBuf);
    receiveBuf.flip();
    StringBuffer sb = new StringBuffer();
    System.out.println(" * Remaining: "+receiveBuf.remaining()); // writes: ' * Remaining: 0'
    System.out.println(" * Received: "+new String(receiveBuf.array())); // writes: ' * Received: <system cmd="knock"/>'
    while(receiveBuf.remaining() >= 2) {
      byte b = receiveBuf.get();
      sb.append((char)b);
    System.out.println(" * sb content: "+sb.toString()); // writes: ' * sb content: 'The ByteBuffer clearly receives the correct data, but the ByteBuffer.remaining() returns 0 and therefore the StringBuffer will never have any content.
    The problem seems to occur randomly and for about 20% of the clients (simulated from the same computer and therefore has the same bandwidth and so on).
    Anyone knows what is going on, and how to solve the problem !?

    It's always possible in any read that the number of bytes read is less than the number of bytes requested. You need to keep reading until you have got everything you expected, and cope with every possible error condition on each iteration.
    EJP

  • Problem when using swings with thread

    Hi,
    I am trying to read a database randomly and printing it in a jframe(using jtable and jscrollpane). I am continously checking the values in the database using a infinite do .. while .. loop. and printing the values in the JFrame. I am also making the main thread sleep for every 5 seconds. but when the thread resumes from sleep the JFrame gets the focus. This disturbs me a lot, because of this i am not able to use any other programs like (outlook or word). Kindly provide me a way to continously check the database and print values in the JFrame in the background without JFrame gaining the focus until i click on it.
    Regards
    Kishdude

    It's not clear where you actually tell the JFrame to display itself (usually setVisible(true).
    But this is a bit confused.
    If the first loop is, in fact, infinite then the table will never be created, since the rest of the code won't be reached.
    Don't create a new JTable each time you update the data. Update the existing one. You should define a method, somewhere, to load the table data from the database, call it once while building the window to load the initial values and then - once the window is displayed, set a loop or a Timer going to rescan the data periodically using the same code.
    There are serveral ways you can manage the table data. The key is the TableModel associated with the table. You can change the content of the TableModel or create a new one each time you read the data and use JTable's setModel method to replace it. Personally I'd write a subclass of AbstractTableModel or perhaps DefaultTableModel and put the code to scan the database, plus the data read, in there.
    There's not a lot of point in making the main thread wait once you've openned a window. The program won't exit while it has a window open. You can call setDefaultCloseAction() on the window and tell it to close the program when the close button is clicked. Or you can add a WindowAdapter to the window and deal with the close attempt yourself.
    And don't throw away exceptions in cache clause like you are, because you're never going to debug successfully if you do that. At the very least call printStackTrace() on the exception.
    So your sequence should be (roughly)
    Load the first batch of data into a TableModel.
    Build the window, using the TableModel to create your table.
    display the window.
    Start a background Thread which repeatedly waits a few seconds, then rereads the data into the table model, ensuring it calls the fireTableModelChanged() method of the model that requests that the table be redrawn.

  • MacBook Pro (r) noise problem when using headphones with 90%+ charge?

    I've tried using other headphones on the MacBook and they work just fine; but I've also used the Denons on other devices and they too work perfectly fine. The problem is that the headphones output has too much bass, if that makes sense. It's the same as when you play a very very loud noise on a tiny speaker. I've tried playing on the settings but nothing works! I bought the laptop 2 weeks ago and the problem persisted even then but I didn't think of it as a big problem until now. I'm 100% sure the problem only exists when the charge is 90% or higher because I saw the charge drop to 89% and *poof*! it goes back to normal! This is really very annoying!

    You are still under warranty.  Call Apple Care. Make sure you get a case number as all repairs have an additional 90 days of warranty. 
    Take FULL advantage of your warranty.  Posting on a message board should be done as a last resort and if you are out of warranty or Apple Care has expired.

  • Problems when using javascript in jsp

    hello, i am implementing a program to upload files.
    a user can upload either a pdf or a latex file.
    so for example if the user uploads a pdf file the form action should be
    "uploadPDF.jsp" and if it is a latex file the action is "uploadlatex.jsp"
    currently when the user uploads the pdf file IT WORKS and does the action correctly but it does not do it for the other file (latex file) gives
    some long jasper exceptions pls help
    *************here is the code*******************
    <SCRIPT LANGUAGE="JavaScript">
    var extArray = new Array(".pdf", ".tex", ".txt");
    function LimitAttach(form, file) {
    allowSubmit = false;
    if (!file) return;
    while (file.indexOf("\\") != -1)
    file = file.slice(file.indexOf("\\") + 1);
    ext = file.slice(file.indexOf(".")).toLowerCase();
    for (var i = 0; i < extArray.length; i++) {
    if (ext = "pdf"){
    document.forms[0].action.value = "uploadPDF.jsp";
    allowSubmit = true;
    break;
    if (allowSubmit) form.submit();
    else
    alert("Please only upload files that end in types: "
    + (extArray.join(" ")) + "\nPlease select a new "
    + "file to upload and submit again.");
    </script>
    </HEAD>
    and below is the form
    <form action="" name="upform"enctype="multipart/form-data">
    <input type="file" name="PDFfilename" size="50"><br>
    <input type="hidden" name="todo" value="upload">
    <input type="submit" name="Submit" value="Upload" onclick="LimitAttach(this.form, this.form.PDFfilename.value)">
    </form>
    thanks,
    moh

    when uploading this latex file in a different jsp file and form it works fine
    however in the above form it does not...........here is the exception errors:
    org.apache.jasper.JasperException: This file appears to be damaged and cannot be repaired. This may not actually be a PDF file.
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    javax.servlet.ServletException: This file appears to be damaged and cannot be repaired. This may not actually be a PDF file.
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.uploadPDF_jsp._jspService(uploadPDF_jsp.java:209)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    com.adobe.acrobat.pdfobjstore.CantRebuildXRefException: This file appears to be damaged and cannot be repaired. This may not actually be a PDF file.
         com.adobe.acrobat.pdfobjstore.XRefTableRebuilder.buildTrailerDict(XRefTableRebuilder.java:141)
         com.adobe.acrobat.pdfobjstore.XRefTableRebuilder.rebuildXRefTable(XRefTableRebuilder.java:121)
         com.adobe.acrobat.pdfobjstore.XRefTableRebuilder.<init>(XRefTableRebuilder.java:46)
         com.adobe.acrobat.pdfobjstore.XRefTable.<init>(XRefTable.java:44)
         com.adobe.acrobat.pdfobjstore.XRefTable.<init>(XRefTable.java:64)
         com.adobe.acrobat.pdfobjstore.PDFObjMap.compute(PDFObjMap.java:122)
         com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
         com.adobe.acrobat.pdfobjstore.PDFObjMap.getTrailerDictRef(PDFObjMap.java:49)
         com.adobe.acrobat.pdfobjstore.VTrailerDict.computeReference(PDFObjStore.java:552)
         com.adobe.acrobat.pdfobjstore.VPDFReference.compute(VPDFReference.java:150)
         com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
         com.adobe.acrobat.pdfobjstore.VPDFReference.pdfReferenceValue(VPDFReference.java:161)
         com.adobe.acrobat.pdfobjstore.security.VEncryptionMethod.computeString(SecurityHandler.java:208)
         com.adobe.pe.vtypes.VString.compute(VString.java:55)
         com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
         com.adobe.pe.vtypes.VString.stringValue(VString.java:126)
         com.adobe.acrobat.pdfobjstore.security.VPDFObjStorePerms.computePDFObjStorePerms(VPDFObjStorePerms.java:41)
         com.adobe.acrobat.pdfobjstore.security.VPDFObjStorePerms.compute(VPDFObjStorePerms.java:54)
         com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
         com.adobe.acrobat.pdfobjstore.security.VPDFObjStorePerms.peObjStorePermsValue(VPDFObjStorePerms.java:32)
         com.adobe.acrobat.gui.AcroViewContext.setByteArraySource(AcroViewContext.java:587)
         com.adobe.acrobat.Viewer$3.buildChanges(Viewer.java:907)
         com.adobe.pe.notify.Transactor.commit(Transactor.java:70)
         com.adobe.acrobat.Viewer.setByteArraySource(Viewer.java:911)
         com.adobe.acrobat.Viewer.setDocumentByteArray(Viewer.java:948)
         com.adobe.acrobat.Viewer.setDocumentInputStream(Viewer.java:971)
         org.apache.jsp.uploadPDF_jsp._jspService(uploadPDF_jsp.java:106)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    on the first line it says that the file may be corrupted but it is fine and works, thanks
    moh

  • Using JDBC with JSP

    I have a standalone application using Swing. Im converting it to a web / JSP/Servlets application.
    Can my JSP acess my database using the same classes it used to or should I configure in my Tomcat a data source and call my database using the jndi name ?
    thx in advance,
    Giselle

    Agreed - JSPs are best for presentation.
    I have a front controller servlet that delegates to POJOs to do database interactions and then forwards results to JSPs for display. No scriptlet code in my pages, no database interactions, just looping through collections and displaying the results. - MOD

  • Problem when using Logger with Tomcat and eclipse

    Hi, Iam using Tomcat 5.5.7 and my IDE is eclipse.Iam using java.util.logging.Logger class for logging.Iam putting the properties file in Appname/WEB-INF directory.The properties file is not identified.The error Iam getting is Error initialising log file java.lang.NullPointerException and java.io.FileNot FoundException
    The content of my logging.properties file is
    java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=SEVERE java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
    java.util.logging.FileHandler.level=ALL java.util.logging.FileHandler.pattern=%h/javalogs%u.log java.util.logging.FileHandler.append=true java.util.logging.FileHandler.count=1
    My servlet is
    import java.io.*;
    import java.util.logging.*;
    import java.util.logging.Logger;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorldServlet extends HttpServlet
          public void init(ServletConfig config) throws ServletException
               try
                         String file=getServletConfig().getInitParameter("java.util.logging.config.file");
                        InputStream is = getServletContext().getResourceAsStream(file);
                        LogManager.getLogManager().reset();
                          LogManager.getLogManager().readConfiguration(is);
               catch(Exception e)
                    System.out.println("Error initialising log file"+e);
          public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException 
                   final Logger fLogger =
                 Logger.getLogger(HelloWorldServlet.class.getName());
                 PrintWriter  out; 
                 String title = "Simple Servlet Output";
                // set content type and other response header fields first                                   
                // then write the data of the response
                 response.setContentType("text/html");
                 fLogger.finest("this is finest");
                 fLogger.finer("this is finer");
                 fLogger.fine("this is fine");
                 fLogger.config("this is config");
                 fLogger.info("this is info");
                 fLogger.warning("this is a warning");
                 fLogger.severe("this is severe");
                 out = response.getWriter();
                out.println("<P>This is output from SimpleServlet!!!!!!!!.");  
    }My web.xml file is
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <init-param>
         <param-name>java.util.logging.config.file</param-name>
         <param-value>/WEB-INF/classes/logging1.properties</param-value>
        </init-param>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>HelloWorldServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
    </web-app>Can anybody help me out.

    Hi, Iam using Tomcat 5.5.7 and my IDE is eclipse.Iam using java.util.logging.Logger class for logging.Iam putting the properties file in Appname/WEB-INF directory.The properties file is not identified.The error Iam getting is Error initialising log file java.lang.NullPointerException and java.io.FileNot FoundException
    The content of my logging.properties file is
    java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=SEVERE java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
    java.util.logging.FileHandler.level=ALL java.util.logging.FileHandler.pattern=%h/javalogs%u.log java.util.logging.FileHandler.append=true java.util.logging.FileHandler.count=1
    My servlet is
    import java.io.*;
    import java.util.logging.*;
    import java.util.logging.Logger;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorldServlet extends HttpServlet
          public void init(ServletConfig config) throws ServletException
               try
                         String file=getServletConfig().getInitParameter("java.util.logging.config.file");
                        InputStream is = getServletContext().getResourceAsStream(file);
                        LogManager.getLogManager().reset();
                          LogManager.getLogManager().readConfiguration(is);
               catch(Exception e)
                    System.out.println("Error initialising log file"+e);
          public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException 
                   final Logger fLogger =
                 Logger.getLogger(HelloWorldServlet.class.getName());
                 PrintWriter  out; 
                 String title = "Simple Servlet Output";
                // set content type and other response header fields first                                   
                // then write the data of the response
                 response.setContentType("text/html");
                 fLogger.finest("this is finest");
                 fLogger.finer("this is finer");
                 fLogger.fine("this is fine");
                 fLogger.config("this is config");
                 fLogger.info("this is info");
                 fLogger.warning("this is a warning");
                 fLogger.severe("this is severe");
                 out = response.getWriter();
                out.println("<P>This is output from SimpleServlet!!!!!!!!.");  
    }My web.xml file is
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <init-param>
         <param-name>java.util.logging.config.file</param-name>
         <param-value>/WEB-INF/classes/logging1.properties</param-value>
        </init-param>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>HelloWorldServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
    </web-app>Can anybody help me out.

  • TS2570 doesn't work, still the same problem when using Rapidweaver software. NOT with other software.

    i tried everything in this article, but still have the same problem when using Rapidweaver software. NOT with other software. I am converting my iWeb site  to Rapidweaver, whenever there is a calmer period in my office. I have 16 Gb RAM on my NEW iMac and have Parallels desktop, mail, safari, iWeb and Rapidweaver running simultanious.
    I never have the problem if i don't use Rapidweaver, but after i have added several pages to Rapidweaver, the problem begins. my iMac won't start up. the only thing that works is re-installing Macos OS X 10.8. i tried even whiping the completeharddrive, and reinstalling with a complete new user, the same problem.
    I had it on my previous iMac also, and bought a new one because i thought the problem was in the iMac first. i hadn't noticed it only happens with using rapidweaver.
    i sent my complete rapidweaver project to the programmers from rapidweaver at Realmacsoftware, but they couldnt reproduce my problem, there macs started up without any problem.
    i deleted all the rapidweaver addons and extra stacks, and started a complete new project.
    saterday i had the problem again, after adding about 5 new pages to my rapidweaver site.
    i think i have reinstalled Macos OS X 10.8.2 20 or 30 times by now
    does anyone have a sollution?

    Type '''about:support''' in the URL bar and hit Enter.
    Scroll down almost to the bottom of that listing and see if you have '''user.js Preferences''' just above the '''''Graphics''''' category.
    If you do have that, click on '''user.js file''' in this sentence. <br />
    ''Your profile folder contains a user.js file, which includes preferences that were not created by Firefox.''
    Does that "different homepage" appear in that user.js file?

  • I have problems when using the camera on my iPhone 4S (the same for my daughter with a iPhone4) A veil around the blurred photo, a development impossible and completely unable to read the bar code or QR code. What to do?

    I have problems when using the camera on my iPhone 4S (the same for my daughter with a iPhone4)
    A veil around the blurred photo, a development impossible and completely unable to read the bar code or QR code. What to do?

    Sounds kind of stupid, but check to make sure that your iphone case cover is not blocking the edge of the camera lens.  I had a silicone case on my 3S and when it got older, it started tot slip and the edges of my pictures were blurred.

  • To run a report from command line, when using jdbc-odbc bridge

    Hi,
    How to run a report from command line, when using jdbc-odbc bridge?
    Usually with tns, we do by "rwrun module=<> userid=<user>/<passwd>@tns".
    with odbc, we do by "rwrun module=<> userid=<user>/<passwd>@odbc:DSN"
    Please specify, what is command line arguments for jdbc-odbc bridge driver?
    Environment : Oracle 9i Report Builder on WinNT
    Database : Sybase
    Regards,
    Ramanan

    Hello Ramanan,
    Report Builder : connect JDBC Query in Report Builder is to through Connection Dialog in JDBC Query Editor. User can use a Sign on parameter (can use, default : P_JDBCPDS or can create new) to connect to JDBC Data Source. Connection once made will be mentioned and will be reused through out Reports Builder.
    JDBC PDS allows user to connect one or more same or different kind of databases.
    While running report through runtime or Server, user can pass the sign on parameter(connection string) value, like any other user parameter.
    Syntax for connection string : <username>/<password>@databaseURL . The syntax of database part of connection string depend on the type of JDBC Driver used to connect to Data Source while designing the JDBC Query. databaseURL refer to the location of the database and its format depend on the JDBCPDS river selected in design time while creating the JDBC Query.
    rwrun eg :
    rwrun report=jdbc_odbc.rdf destype=file desname=output.html desformat=html P_JDBCPDS=scott/tiger@database
    Server eg :
    http://server.com:8888/servlet/RWServlet?server=MyReportServer+report=jdbc_odbc.rdf+destype=cache+desformat=html+P_JDBCPDS=scott/tiger@database
    http :
    Please see ORACLE_HOME/reports/conf/jdbcpds.conf for more information.
    With Regards
    Reports Team

  • ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate

    ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate a form.
    1) Created a FORM on EMP using the wizards. This creates an AUTOMATIC ROW FETCH
    TABLE NAME - EMP
    Item Containing PRIMARY KEY - P2099_EMPNO
    Primary key column - EMPNO
    By default the automatic fetch has a ‘Process Error Message’ of ‘Unable to fetch row.’
    2) Created a HTML region. Within this region add
    text item P2099_FIND_EMPNO
    Button GET_EMP to submit
    Branch Modified the conditional branch created during button creation to set P2099_EMPNO with &P2099_FIND_EMPNO.
    If I then run the page, enter an existing employee number into P2099_EMPNO and press the GET_EMP button the form is populated correctly. But if I enter an employee that does not exist then I get the oracle error ORA-01403: no data found and no form displayed but a message at the top of the page ‘Action Processed’.I was expecting a blank form to be displayed with the message ‘Unable to fetch row.’
    I can work around this by making the automated fetch conditional so that it checks the row exists first. Modify the Fetch row from EMP automated fetch so that it is conditional
    EXIST (SQL query returns at least one row)
    select 'x'
    from EMP
    where EMPNO = :P2099_EMPNO
    But this means that when the employee exists I must be fetching from the DB twice, once for the condition and then again for the actual row fetch.
    Rather than the above work around is there something I can change so I don’t get the Oracle error? I’m now wondering if the automatic row fetch is only supposed to be used when linking a report to a form and that I should be writing the fetch process manually. The reason I haven’t at the moment is I’m trying to stick with the automatic wizard generation as much as I can.
    Any ideas?
    Thanks Pete

    Hi Mike,
    I've tried doing that but it doesn't seem to make any difference. If I turn debug on it shows below.
    0.05: Computation point: AFTER_HEADER
    0.05: Processing point: AFTER_HEADER
    0.05: ...Process "Fetch Row from EMP": DML_FETCH_ROW (AFTER_HEADER) F|#OWNER#:EMP:P2099_EMPNO:EMPNO
    0.05: Show ERROR page...
    0.05: Performing rollback...
    0.05: Processing point: AFTER_ERROR_HEADER
    I don't really wan't the error page, either nothing with the form not being populated or a message at the top of the page.
    Thanks Pete

  • Problem when using About Operator in Contains Query

    Hi,
    I'm new to Oracle and this forums too. I have a problem when using about operator in contains query.
    I create a table with some records and then create a context index on 'name' column.
    CREATE TABLE my_items (
      id           NUMBER(10)      NOT NULL,
      name         VARCHAR2(200)   NOT NULL,
      description  VARCHAR2(4000)  NOT NULL,
      price        NUMBER(7,2)     NOT NULL
    ALTER TABLE my_items ADD (
      CONSTRAINT my_items_pk PRIMARY KEY (id)
    CREATE SEQUENCE my_items_seq;
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Car', 'Car description', 1);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Train', 'Train description', 2);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Japan', 'Japan description', 3);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'China', 'China description', 4);
    COMMIT;
    EXEC ctx_ddl.create_preference('english_lexer','basic_lexer');
    EXEC ctx_ddl.set_attribute('english_lexer','index_themes','yes');
    EXEC ctx_ddl.set_attribute('english_lexer','theme_language','english');
    CREATE INDEX my_items_name_idx ON my_items(name) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('lexer english_lexer');
    EXEC ctx_ddl.sync_index('my_items_name_idx');Then I perform contains query to retrieve record :
    SELECT count(*) FROM my_items WHERE contains(name, 'Japan', 1) > 0;
    COUNT(*)
          1
    SELECT count(*) FROM my_items WHERE contains(name, 'about(Japan)', 1) > 0;
    COUNT(*)
          1But the problem is when I using ABOUT operator like in Oracle's English Knowledge Base Category Hierarchy it return 0
    SELECT count(*) FROM my_items WHERE contains(name, 'about(Asia)', 1) > 0;
    COUNT(*)
          0
    SELECT count(*) FROM my_items WHERE contains(name, 'about(transportation)', 1) > 0;
    COUNT(*)
          0I can't figure out what 's wrong in my query or in my index.
    Any help will be appreciated.
    Thanks,
    Hieu Nguyen
    Edited by: user2944391 on Jul 10, 2009 3:25 AM

    Hello (and welcome),
    You'd be best asking this question in the Oracle Text forum, here:
    Text
    And by the way, it will help others to analyse if you put {noformat}{noformat} (lowercase code in curly brackets) before and after your code snippets.
    Good luck!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Display "blank-out" when using Maya with a GF 7800?

    I have a problem where my LCD display occasionally blinks off for about 5-10 seconds when using Maya with a scene displaying about 100,000 polys. Has anyone else encountered this? This only seems to happen when I am quickly rotating the camera in a grey shaded perspective panel?
    My LCD is a Dell 20" LCD (set at 1600x1200) connected to a Geforce 7800 in a Quad G5 with 4.5GB of ram.
    I have never seen this issue before in Maya (I have been using Maya for years, on other machines), so I suspect it is hardware or driver related?

    OK, have completed several tests. I definately seems that the my Geforce 7800 has problems when running some applications. I wonder if anyone else has encountered this problem?
    The easiest way to cause the display to momentarily shut off is to use Maya in the full screen perspective camera window in shaded mode. Proceed to rapidly move a 20,000 poly model (or greater) both zooming and rotating (the polys need to fill the entire screen and shake the mouse).My display (Dell 20" 2001fp) will blink-off for a few seconds. Of course, this in not "normal" work flow, but I have this issue happening when working normally, it can sometimes take time to occur.
    I have tried the Geforce 6600 (256mb ver) and this does not occur with that video card. I have tried several mice both wired and wireless, plus changed the Energy Saver options for Processor performance (from comments I read on Macintouch.com). The problem is consistent to my Geforce 7800. This problem will also occur in Photoshop CS, by moving images and resizing, but I found it much harder to induce.

  • Help me!! How to use JavaScript with JSP ??

    I am using JDeveloper and I created a screen in JSP which uses a bean for database connectivity and retriving info onto the page.
    The page has a ListBox where list items are populated from the database.My requirement is
    whenever the list is changed the page shuold be refreshed with the selected item info.
    I tried to use 'JavaScript' for triggering the event with 'onChange' event of the ListBox.But the event is not getting invoked. I think JavaScript is not working with JSP.
    Please help me with how to Use javaScript with JSP or any other alternative where I can meet my requirement.
    I have one more question...I have gone through the JSP samples in OTN and I am trying do download the sample 'Travel servlet' which show list of countries...etc
    I have also gone through the 'readme' but I don't know how to extract .jar file.
    I would be great if you could help me in this.
    Thanks!!
    Geeta
    null

    We have a similar need. We have used Cold Fusion to display data from Our Oracle Database. We have a simple SElect Box in HTML populated with the oracle data. When someone selects say the State of Pennsylvania. then we have an On change event that runs a Javascript to go get all the cities in Pennsylvania.
    Proble we are having is that inorder for the Javascript to work , we currently have to send all the valid data.
    Do you know of any way to dynamically query the the Oracle database in Javascript

Maybe you are looking for