ResultSet.last() problem

Hi All,
I am having proble with the ResultSet.last() method.
The query contains about 25000 records.
Methods next() and prev() works fine.
But last() hung.
The client program is running on different machine from the Oracle database Server.
Bellow is about what I did.
==========================================
protected Statement stmt = null;
protected ResultSet rset;
stmt = conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY );
rset = stmt.executeQuery( "Select * from mytable" );
rset.setFetchSize( 10 );
rset.last();
// Never got here.
stmt.close();
conn.close();
==========================================
Any help is appreciated!
Gwowen

Here is a possible reason why that would hang:
To find the "last" record, the database would have to read through all 25,000 records and send them to your program. This would take a long time, since you told it (setFetchSize(10)) to only send 10 records at a time over the network. So perhaps you just didn't wait long enough. Or perhaps something in the network timed out.
You often see this method posted as a way to find the size of a ResultSet on this forum. However (as you see) it isn't the most efficient in many cases. What you posted is probably your cut-down program -- thank you for not posting 1,000 lines of code -- but an easy way to find the size of that query without actually having to execute it is to execute "Select count(*) from mytable". It returns only 1 row with 1 column, containing the number you want.

Similar Messages

  • Last problem in my project!!

    i've intend to open this 'Receipt.class' by clicking button from other class file called 'Main.class'
    Normally we used this statement "Receipt open = new Receipt();" to open,
    but what if the class file is like that??
    Please help me even giving me the clues!! please.. this is my last problem in my project!!!
    import java.awt.geom.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.print.PrinterJob;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.print.*;
    public class Receipt extends JPanel implements Printable, ActionListener {
    final static JButton button = new JButton("Print");
    public Receipt() {
         setBackground(Color.white);
    button.addActionListener(this);
    init();
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() instanceof JButton) {  
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    catch (Exception ex) {
    ex.printStackTrace();
    public void paintComponent(Graphics g) {
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D) g;
         drawShapes(g2);
    public void drawShapes(Graphics2D g2){
    g2.drawString("Hello world",50,50);
    public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
    if (pi >= 1) {
    return Printable.NO_SUCH_PAGE;
         drawShapes((Graphics2D) g);
    return Printable.PAGE_EXISTS;
    public void init{
         JFrame f = new JFrame();
         JPanel panel = new JPanel();
         panel.add(button);
         f.getContentPane().add(BorderLayout.SOUTH, panel);
         f.getContentPane().add(BorderLayout.CENTER, new Receipt());
         f.setSize(580, 500);
         f.show();

    I don't quite get your question. What did you mean by open? Did you mean to display it. Receipt is a JPanel, to show it you need to have it inside a Frame or an Applet or some sort of container.
    try this
    import javax.swing.*;
    Receipt receipt = new Receipt();
    JFrame aFrame = new JFrame("Display Receipt Panel"); //create a JFrame
    aFrame.getContentPane().setLayout(new BorderLayout()); //set Layout Manager for the frame
    aFrame.getContentPane().add(receipt, BorderLayout.CENTER); //add panel to the frame
    aFrame.show(); //show the frameThe above block of codes create a JFrame and add the Receipt panel to the Frame. Then call the Frame to show. You can put this code in a method, if you need to use this Frame and panel again, make them instance variables rather than local variables.

  • "Invalid op for forward-only resultset : last"

    I am trying to use the oracle jdbc drivers in classes12.zip to connect to an Oracle 8.0.6 database. The documentation for classes12.zip says that these drivers allow scrollable ResultSets, but whenever I try to use ResultSet.absolute(), ResultSet.relative(), ResultSet.first(), or ResultSet.last(), I get SQLException : "Invalid op for forward-only resultset : last"
    Is there something special I need to do to my statement or resultset object to enable a scrollable ResultSet? My code looks like this:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    String userID = "scott";
    String passwd = "tiger";
    //I'm certain I have the correct
    //connection data in the
    //real version of this program
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@XXX:XXX", userID, passwd);
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("select * from mytable");
    Any suggestions?
    null

    What if I was using a CallableStatement (prepareCall() & execute()) to get my result set as a return value from a PL/SQL procedure instead of above case where a Statement (createStatement() & executeQuery()) were used. How can I make the ResulSet be scrollable? Please see below sample code.
    CallableStatement cstmt = dbConn.conn.prepareCall("{ ? = call pkg_MyPkg.fn_MyFn }", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    cstmt.registerOutParameter(1, OracleTypes.CURSOR);
    boolean b = cstmt.execute();
    OracleCallableStatement tstmt = OracleCallableStatement)cstmt;
    ResultSet cursor = tstmt.getCursor (1);
    // this works AOK
    while (cursor.next ())
    System.out.println(cursor.getString(1));
    // the following does not work
    b = rsetGetFn.first();
    System.out.println(cursor.getString(1));
    b = rsetGetFn.last();
    System.out.println(cursor.getString(1));
    The call cursor.getType() returns ResultSet.TYPE_FORWARD_ONLY, how can I get it to be ResultSet.TYPE_SCROLL_INSENSITIVE or ResultSet.TYPE_SCROLL_SENSITIVE?
    Any help will be apreciated.
    V/R,
    -aff
    null

  • ResultSet.last() / java.lang.AbstractMethodError

    Hello
    I'm programming a Java based messenger system using JDBC in the server application. I use MySQL with "mm.mysql" as JDBC driver.
    So far so good. There is no problem loading the driver, connecting the database or executing queries. But I want to know how many rows a custum ResultSet object includes.
    here's the source:
    String query = "select * from ... where ...";
    ResultSet rs = stmt.executeQuery(query);
    rs.last(); // Move to last row
    numrows = rs.getRow(); // How many rows?
    and all I get is the followiung exception which ist thrown by "rs.last()":
    java.rmi.ServerError: Error occurred in server thread;
    nested exception is: java.lang.AbstractMethodError
    What could be the Problem? Or is there another way to get the size of ResultSet...? In PHP I would write "$size = mysql_num_rows($result)" but how can I get the same information in Java using JDBC?
    Greetings,
    Adrian R.

    This is nothing but problem in your driver.
    those are abstract methods in java.sql package.
    The drivers should implement those things.if not, you will get error like this.
    Check out your vendor about these methods.
    As per my knowledge, so far no direct method to get total no of records.You have to query it in different way to get it.
    Regards
    Eswaramoorthy.G

  • Oracle resultset.last() will cost long time while the resultset is large

    we want to get the count of returned resultset rows through used last() & getRowNum() of oracle resultset . But this way the oracle driver will cache all rows in memory of our local machine and cost long time . we thought the resultset maybe cost many time on network.
    can i set any preferences,make rs.last don't transfer by network and the last() method only work in DB server.
    how to solve the problem.
    thanks so much~!

    No. The way Oracle cursors work, the only way to find out how many rows are in a ResultSet is to fetch each row. Since cursors are read-only structures, the driver has to cache the result if it is going to allow you to retrieve the data without re-executing the query. Increasing your fetch size may decrease the amount of time required to fetch all the rows, but you'll still have to go through all that effort.
    One alternative would be to add a COUNT(*) (or more generically COUNT(*) OVER ()) to the query and use that value (which will be repeated for every row in the result) to determine how many rows are being returned.
    Justin

  • MAIL: Trying to settle long-lasting problem. Mail always immediately downloads the messages I delete from any IMAP mailbox. I'm running out of HD space!

    BACKGROUND
    I only have 60GB of space on my MacBook Air. Currently, three long-standing IMAP accounts are taking up over 7GB of it!
    I have seen several related discussions about this kind of problem, but they all seem to have been solved or glossed over with setting up the IMAP interaction so that messages are deleted from the server in addition to the device or with a "Mailbox > Use This Mailbox For" fix that doesn't work for me. I like being able to save all of my email history on servers (I'm often surprised by how many years back I have to search to find a piece of information I need), but I can no longer stand losing so much of my very limited local space to really old mail.
    PROBLEM
    I'll refer to just one of the relevant accounts as "Gmail," since that's in parentheses when seen in these screenshots. These are its current Mailbox Behaviors settings:
    Under my Gmail Inbox in Mail, I have deleted every message from before 2013. The mail from 2013 is all that I want stored on my MacBook Air.
    Ultimately, I think this has something to do with the Archive (seen in the sidebar above, as well). Even when I've deleted everything from before 2013 in my Inbox, AND emptied the entire contents of Trash manually, the Archive still contains all of the mail from the server (yes, this account was started in 2011, but I have others that go back much further).
    The cherry on top is that when I delete the same messages from the Archive as I've deleted from the Inbox, Mail immediately begins re-downloading all of those messages. Last time I tried this my laptop had to download 23000 messages, but here's a screenshot of proof with a smaller sample:
    In case my Gmail server settings are useful to consider, here they are:
    Final Notes
    • There's a lot that I don't know about exactly how IMAP communication occurs between a device and a server. For my sake and the sake of anyone else who needs this kind of help, please clarify terms like "flags" and "archive" (since Gmail and Mail both use the term and I don't know think they mean exactly the same thing) if/when you use them.
    • If anyone does think that there's some sort of "Mailbox > Use This Mailbox For" solution to this, you should know that no matter what I have selected in Mail's sidebar (at no matter what level of indentation), the options available under that menu item are always grayed-out.
    • I want to keep using Mail. There's a lot that I like about it and I don't want to switch to Thunderbird or something else (remember, I need to save as much local space as I can).
    • I just upgraded to 10.9.0 Mavericks, but this problem has existed for me and behaved essentially just like this as long as I can remember. In fact, I think I recall the problem still existing before there was an Archive in the sidebar at all.

    UPDATE
    I still have the problem, but when I checked on this post to see if anyone had commented and I simply hadn't received an e-mail, I noticed that all but the last of the images I included have stopped displaying (I had friends check, too).  Most of them were just visual examples of what I was explaining in hopes of giving context and all available info that I may not have personally viewed as relevant, but the first one, about my account's Mailbox Behaviors settings sure is important. These are the settings I have:
    • Store draft messages on the server — Check
    • Store sent messages on the server — Check
    • Delete sent messages — One month old
    • Store junk messages on the server — Check
    • Delete junk messages — One week old
    • Move deleted messages to the Trash mailbox — Grayed-out and Check
    • Store deleted messages on the server — Grayed-out and Check
    • Permanently erase deleted messages when — Quitting Mail
    I hope this helps. Please comment if I'm leaving out any other important information.

  • Ipod freezing itunes, the last problem in a long list

    So ill start from the beginning with the problems ive had with my ipod...
    The first problem i had started maybe 6 months ago. My ipod would just stop playing when it played certain songs. Everything else worked fine, it would just stop sometimes. Then in the last few months it stopped being able to connected to a computer. Whenever i would hook it up it would just automatically eject itself. I tried hooking it up to a freinds computer and for some reason when it was hooked up to his computer it worked fine. I decided to just do a restore at the point hoping to end all my problems. The restore went fine. I started putting music back on it and i started getting error messages. The computer said that my ipod was missing the file that would allow me to sync with the computer or something like that. I tried to restore it again and it didnt change anything. In the last couple days i tried to put music on the ipod again and now it wont show at all in itunes. The ipod says its connected but when plugged in itunes just freezes.
    I dont know if it makes any difference but my computer is a mac, and the computer i was able to do the restore on runs vista.
    Im totally out of ideas and im not sure what my options are from here. Any and all help would be awesome.
    Thanks in advance everybody!

    I get exactly what your describing and I noticed we are using the same laptop!!
    I did not notice originally as I've got an old 40gb click wheel, about 3/4 years old. The battery is not great so assumed it may have been that but even fully charged I'm getting no luck.
    I also followed the 5 r's and all the other suggestions for Ipod in My compute but not in itunes but nothing has worked. I cannot get my laptop to recognised my ipod via Itunes but it see's it fine via My Computer.
    Both the Ipod and Itunes work fine without each other, Ipod plays songs fine etc and Itunes downloads music from cd etc and still performs all the usual functions but nothing else works.
    I'm desperate for help as I run every day and buy a new cd each week and at this rate I'm going to have to dig out my old CD player!
    Also just a point of note I looked the price to get my Ipod serviced as I figured this may help but the price quoted from apple was £160+...you can get a new 30gb for less...talk about customer explotation!!

  • ResultSet.next() and resultset.islast() problem

    I have query which returns 10 records. I run the using preparedStatement. When i use the while(resultSet.next()), the loop runs untill 10 records and after that when it come to the while check it hangs.
    Sample code
    pstmt= conn.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    rs = pstmt.executeQuery();
    while (rsAccessNoEq.next()) {...
    Then i added the code in the while loop
    if(rs.isLast()){
    return;
    For the first iteration itself the theisLast() is true and it terminates from the loop.
    Please help me

    public class ISP {
         private GFA gestorFic = null;
         private GCA gestorCad = null;
         private GBDAgestor = null;
         private String path = null;
         ServiceProcessVO javaIntra = null;
         ServiceProcessVO javaIntra1 = null;
         ServiceProcessVO javaIntra2 = null;
         ServiceProcessVO javaIntra3 = null;
         ArrayList dataList = null;
         List dataFile = null;
         ArrayList dataList1 = null;
         ArrayList dataList2 = null;
         ArrayList dataList3 = null;          
         public final void iP() throws SQLException,
         MCEA {
         ResultSet rsIntraHq = null;
              Connection connIntraHq = null;
              PreparedStatement pstmtIntraHq = null;
              ResultSet rsIntraFlow = null;
              Connection connIntraFlow = null;
              PreparedStatement pstmtIntraFlow = null;
              ResultSet rsEqNoAccess = null;
              Connection connEqNoAccess = null;
              PreparedStatement pstmtEqNoAccess = null;
              ResultSet rsAccessNoEq = null;
              Connection connAccessNoEq = null;
              PreparedStatement pstmtAccessNoEq = null;
              ResultSet rsFlowHqAccess = null;
              Connection connFlowHqAccess = null;
              PreparedStatement pstmtFlowHqAccess = null;
              dataList = new ArrayList();          
              dataFile = new ArrayList();
              System.out.println("At the begining :"+now() );
              dataFile = gestorFic.leerArchivo(path, file);
              System.out.println("After first step :"+now() );
              int size1 = dataFile.size();
              try {
                   connAccessNoEq = gestor.getConnection();
                   javaIntra = new ServiceProcessVO();
                   pstmtAccessNoEq = connAccessNoEq
                   .prepareStatement(ConsultasAssets.INTRA_ACCESS_NOEQ);
                             //ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                   pstmtAccessNoEq.setString(1, oti);
                   pstmtAccessNoEq.setString(2, oti);
                   pstmtAccessNoEq.setString(3, oti);
                   rsAccessNoEq = pstmtAccessNoEq.executeQuery();
                   //int k = rsAccessNoEq.TYPE_SCROLL_SENSITIVE;
                   int i = 0;
                   //rsAccessNoEq.last();
                   while (rsAccessNoEq.next()) {
                        i++; System.out.println("Begin of loop:"+i);
                        javaIntra = populatedata(rsAccessNoEq, true);
                        dataList.add(javaIntra);
                        // Flow Hq Access
                        try {
                             connFlowHqAccess = gestor.getConnection();
                             javaIntra1 = new ServiceProcessVO();
                             pstmtFlowHqAccess = connFlowHqAccess
                             .prepareStatement(ConsultasAssets.HQ_ACCESS);
                             pstmtFlowHqAccess.setString(1, javaIntra
                                       .getCTASOCIACION().trim());
                             pstmtFlowHqAccess.setString(2, rsAccessNoEq.getString(1)
                                       .trim());
                             pstmtFlowHqAccess.setString(3, rsAccessNoEq.getString(3)
                                       .trim());
                             pstmtFlowHqAccess.setString(4,oti);
                             pstmtFlowHqAccess.setString(5,oti);
                             pstmtFlowHqAccess.setString(6,oti);
                             rsFlowHqAccess = pstmtFlowHqAccess.executeQuery();
                             while (rsFlowHqAccess.next()) {
                                  javaIntra1 = populatedata(rsFlowHqAccess, false);
                                  dataList.add(javaIntra1);
    //                         if(rsAccessNoEq.isAfterLast()){
    //                              return;
                        } catch (SQLException se) {
                             MCLA.logFatel(ClassNameAssets
                                       .getQualifiedClassName()
                                       + ": "
                                       + ClassNameAssets.getLineNumber()
                                       + ": "
                                       + "Error Occurred in HQ_ACCESS: "
                                       + se.getMessage());
                             throw new MigracionCommonExceptionAssets(se.getMessage());
                        } finally {
                             pstmtFlowHqAccess.close();
                             if (rsFlowHqAccess != null) {
                                  rsFlowHqAccess.close();
                             //gestor.releaseConn(connFlowHqAccess);
         private SPVOpopulatedata(ResultSet rsCpProcess, boolean modify)
         throws SQLException {
              SPVOjavaIntra = new ServiceProcessVO();
              if (rsCpProcess.getString(ConstantesAssets.NU) != null
                        && !rsCpProcess.getString(ConstantesAssets.NU)
                        .equalsIgnoreCase(ConstantesAssets.BLANK))
                   javaIntra.setNU(rsCpProcess.getString(
                             ConstantesAssets.NU).trim());
              if (rsCpProcess.getString(ConstantesAssets.NU_ASO) != null
                        && !rsCpProcess.getString(ConstantesAssets.NU_ASO)
                        .equalsIgnoreCase(ConstantesAssets.BLANK))
                   javaIntra.setNU_ASO(rsCpProcess.getString(
                             ConstantesAssets.NU_ASO).trim());
              // HashTable logic to increament value for CTASOCIACION Start
              if (modify == true) {
                   if (rsCpProcess.getString(ConstantesAssets.CTASOC) != null
                             && !rsCpProcess.getString(ConstantesAssets.CTASOC)
                             .equalsIgnoreCase(ConstantesAssets.BLANK)) {
                        char cha = ConstantesAssets.A;
                        if (tempMap.get(javaIntra.getNU()) != null) {
                             cha = tempMap.get(javaIntra.getNU()).toString()
                             .charAt(0);
                             cha++;
                        tempMap.put(javaIntra.getNU(), Character
                                  .toString(cha));
                        javaIntra.setCTASOCIACION(((rsCpProcess
                                  .getString(ConstantesAssets.CTASOC).trim()) + cha)
                                  .trim());
              } else {
                   javaIntra.setCTASOCIACION(rsCpProcess.getString(
                             ConstantesAssets.CTASOC).trim());
              // HashTable logic to increament value for CTASOCIACION End
              if (rsCpProcess.getString(ConstantesAssets.CCC) != null
                        && !rsCpProcess.getString(ConstantesAssets.CCC)
                        .equalsIgnoreCase(ConstantesAssets.BLANK))
                   javaIntra.setCCC(rsCpProcess.getString(
                             ConstantesAssets.CCC).trim());
              if (rsCpProcess.getString(ConstantesAssets.FIV1) != null
                        && !rsCpProcess.getString(ConstantesAssets.FIV1)
                        .equalsIgnoreCase(ConstantesAssets.BLANK))
                   javaIntra.setFIV(rsCpProcess.getString(
                             ConstantesAssets.FIV1).trim());
              if (rsCpProcess.getString(ConstantesAssets.FFV) != null
                        && !rsCpProcess.getString(ConstantesAssets.FFV)
                        .equalsIgnoreCase(ConstantesAssets.BLANK))
                   javaIntra.setFFV(rsCpProcess.getString(
                             ConstantesAssets.FFV).trim());
              if (rsCpProcess.getString(ConstantesAssets.ES) != null
                        && !rsCpProcess.getString(ConstantesAssets.ES)
                        .equalsIgnoreCase(ConstantesAssets.BLANK))
                   javaIntra.setES(rsCpProcess.getString(
                             ConstantesAssets.ES).trim());
              javaIntra.setI(ConstantesAssets.N);
              javaIntra.setN(ConstantesAssets.BLANK);
              javaIntra.setC(ConstantesAssets.BLANK);
              javaIntra.setCO(ConstantesAssets.BLANK);
              javaIntra.setFI(ConstantesAssets.BLANK);
              return javaIntra;
    Please see the code
    Siva

  • NEXT,PREV,FIRST,LAST PROBLEM

    hi to all
    i'm using form6i and run in c\s
    i have 7 records, (1,2,3,4,5,6,7), the problem is when i click next_Record button it will go the the last_record which is 7. when i click previous it will go to the first record which is 1. when i click last_record it will go to last. when i click first it will to to first..
    my trigger is when button pressed for 4 buttons..
    execute_query
    LAST_RECORD
    execute_query
    First_Record
    execute_query
    Previous_RECORD
    execute_query
    Next_RECORD
    is my code wrong?

    my trigger is when button pressed for 4 buttons..
    execute_query
    LAST_RECORD
    execute_query
    First_Record
    execute_query
    Previous_RECORD
    execute_query
    Next_RECORD
    is my code wrong?execute query....?
    are you only navigating between the records already queried or querying the records at each button click.... clarify???

  • Jdbc ResultSet.next() problem

    this function is part of a class the extends AbstractTableModel
    the line of code that is causing all the problems is right below lines that are indented all the way to the right and are in all caps
    public void setAResultSet(ResultSet results)
    try
    ResultSetMetaData metadata =
    results.getMetaData();
    int columns = metadata.getColumnCount();
    //now we know how many columns there are, so
    //initialize the String array
    columnNames = new String[columns];
    //get the column names
    for(int i = 0; i < columns; i++)
    //remember - columns start with the indice at 1
    columnNames[i] = metadata.getColumnLabel(i+1);
    //get all the rows
    dataRows = new Vector();
    //will store the whole row of data
    String[] oneRow;
    while(results.next());
    //re-allocate memory each time, b/c its a whole
    //new row of data
    oneRow = new String[columns];
    //get the data in the current row, from every
    //column
    for(int i = 0; i < columns; i++)
    {   System.err.println("Indice: " + i);
    PROBLEM ON LINE BELOW
    EXCEPTION STATES "INVALID CURSOR STATE"
    oneRow[i] = results.getString(i+1);
    //all of the data is collected, so store
    dataRows.addElement(oneRow);
    fireTableChanged(null);
    catch(SQLException sqle)
    System.err.println("Error in ResultsModel.setResultSet()");
    System.err.println(sqle.getMessage());
    Anyone has an idea as to why the SQLException is being thrown? Why is the cursor state invalid???

    Hmmmm, try setting the cursor to the first row in the
    result set just before you wish to get the data. That led to some interesting results. Here's what I added:
    while(results.next());
    //re-allocate memory each time, b/c its a whole
    //new row of data
    oneRow = new String[columns];
    boolean texe = results.first();
    THE REST IS THE SAME AS BEFORE
    This also threw a SQLException, with the message: "Result set type is TYPE_FORWARD_ONLY"
    That's very interesting b/c I know that its doing this from iteration 1. I know this because I have an err.println() message in the for loop that's nested in the while loop. That message, which tells me what i equals, did NOT show up. So, going to the first column somehow went backwards causing an error (but I've never had a problem using previous() or any other "backwards" methods for ResultSet objects before!). And where the cursor so going to first() is backwards? Whoever can figure this out deserves Duke Dollars.

  • Dang, one last problem since updating to 10.4.9 - all others fixed though!!

    I have one last pesky problem since the update. About once a day my system will freeze, but it happens when I'm clicking on the mail icon in the doc, mail starts to come forward and about half way into my window everything freezes. I can't force quit or access any menus. I have mouse movement for about ten seconds or so then its a full lockup.
    Could it be a mail program issue or maybe an issue with the doc?
    thanks in advance for your help,
    Brown.Recluse

    Hi,
    This may sound obvious, but have you tried removing the Icon from the dock and re-adding it?
    Apps sometimes freeze in my dock, and this works for me.
    Regards

  • 100000 records resultset giving problem ?

    Hello All,
    I am using oracle database, windows 2000, OC4J(Oracle Containers for j2ee) Application Server. When I query a emp table which has 100000 records and store the 100000 records in resultset and using a while loop
    if I iterates through the resultset to store each emp record in emp bean array then my application hangs at this point so I am unable to form a emp bean array of 100000 records. What is the reason ?
    Also, I am getting 'OutOfMemoryError' exception at the client side(jsp) when I am trying iterate over a vector that stores each of 100000 emp records as inner vector. I tried to increase my system page file size(virtual memory) to 1GB but this didnt help. So how to avoid this error in windows2000 and on unix box.
    Thanks and Regards,
    Kumar.

    I'd guess the reason is memory related. The simple answer to your question is "don't do that!" Why would the user ever want to look at 100,000 records? If the result of a user request would give such a large number of hits, your app should ask the user to refine the search criteria.
    Even if browsing 100,000 rows really is a requirement (which seems doubtful), why read them all at one pass? You could store a reasonable number (e.g. 1,000) and request a new read every 1,000 records. Alternatively, store the 100,000 in a disk file and page from there.

  • Last problem....

    Hi there,
    I've still got one problem on my P35 Platinum mobo. In Bios I disabled the onboard soundcard. I installed Windows XP Pro, installed all (and newest) drivers and updates. When I look in Device Manager I still see one uninstalled PCI Device (with a "!"). I I think it has something to do with the Realtek High Definition Audio Bus, which I encountered on a earlier installation of Windows. And even then I couldn't get it away.... I can 't find drivers, not from the CD of the MoBo, Videocard or Soundcard.
    What is this device and how can I delete this 'problem'; my computer is working fine and no troubles!
    # CPU Intel Q6600
    # Motherboard P 35 Platinum
    # Memory 2x Corsair 1Gig DDR800)
    # Video card Gigabyte HD 2600 Pro
    # Hard drive(s)  2x Hitachi (160 Gb & 500 Gb) Both Sata
    # External HD Western Digital 500Gb.
    # 2 Samsung 203 DVD writers (Sata)
    # Soundcard Creative SB Audigy 2Z S (PCI)
    # Operating system Microsoft Windows XP Pro Edition SP2)
    # Power Supply Unit Antec Neo 550

    Leave it as it is, its not important if you don't use onboard audio.
    Install those patches: https://forum-en.msi.com/index.php?topic=113078.msg846427#msg846427 if you need to install it.
    Or it could be raid device perhaps? Have you checked here, what you have installed?---> http://global.msi.com.tw/index.php?func=downloaddetail&type=driver&maincat_no=1&prod_no=1212
    Or IEEE1394 of your external Audigy?

  • One last problem with videora

    i got the file to transcode to mp4, uploaded it in itunes, but now when i go to play the movie, i am only getting audio. does anyone know why im only recieveing audio and not revcieving picture? thanks for any help

    I had problems with Audio and Videora this afternoon. I converted two short videos off of TheSims2.com featuring the new Glamour Life Pack but the music was just all wrong, it kept breaking up and turning all staticy... so I re-downloaded the movies and used iTunes to convert them considering they were .mov files (something that iTunes can handle) and there is now no sound issues at all.
    Usually when this happens, you need to re-convert the video.

  • ResultSet updateRow() problem

    The RDBMS I am working with is:
    Apache Derby version = 10.1.2.1
    I cannot seem to figure out why this ResultSet update is not working.
    I create the ResultSet with the following:
    Statement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE, ResultSet.HOLD_CURSORS_OVER_COMMIT);The query that I execute to return the result set contains the primary key, FROM contains only one table, and the query contains no JOINS or UNIONS.
    So then I call next()
    Update all the columns that I am interested in updating, up to this point everything is fine, I can get the column that I updated out, and the values are the updated ones.
    When I call updateRow(), I get: Invalid cursor state - no current row
    But there is a current row, I am updating columns in it and those updates are taking place.
    Any help is appreciated.
    Thanks

    yes, it returns true.
    and it is the row that I am interested in. If
    immediately after the next() I get one of the
    columns, it is the correct value, then I set it using
    updateXXX, then get it out again it is the updated
    value. All as I would expect it to work.
    But on the call to updateRow() - Invalid cursor state
    - no current row.Then I would suspect that the database driver you're using doesn't support updateable resultsets (?)
    You do realize that not all databases support that, right?
    Although it would seem that you should get a different error message in that case, hence the (?) above.

Maybe you are looking for

  • Adding jam packs and loops

    Hello everyone. This post may have been answered. Anyway, I have installed all jam packs and sound content on external drive. I was wondering how to index them so i can access them in logic pro as loops. It seems that some are there and some are not.

  • BAPI_USER_CHANGE to change the user data

    Hi, I am using BAPI_USER_CHANGE to change the user data like telephone number, address etc. Everything is working fine but when I want to add new telephone number with no change in exsting numbers then it wont allow to add instead of adding it change

  • OT (a little): colors in ff vs safari

    when i view the same jpg in ff vs. safari, the colors look dramatically different. ff is more muted and less contrasty. anyone else notice this?

  • ODT 11g on a computer that runs client 10g

    Hi I want to (or better to say I have to because of Vista) use ODT 11 with Visual Studio 2008 but the executable has to run on machines were only the client 10 is installed? Is this possible? Or can I distribute the full client with my executable? I

  • Streaming & Syncing....can you do both?

    I have a 160GB Apple TV and I can't seem to Sync or Stream anymore. Says there is Firewall issue but firewall is not turned on and don't have any aftermarket firewall software. So currently I cant stream or Sync. Seems to have a problem when i try to